![]() Now we will add a slot for the “Quit” button’s “clicked” signal. Clicking the “Count” button will increment a counter and display it on the label, and the “Quit” button will quit the application. Double-click the push-buttons and change their text to “Count” and “Quit” double-click the label and clear the text. The dialogue window should look like what’s shown in Figure 7.įor the sake of simplicity, let’s not use any layout. In our first example, let us use one label and two push-buttons. ![]() The left pane has different widgets that you can simply drag and drop on the dialogue box. Double-click the UI file to open the UI editor (Figure 6). The class we named during project creation has three files: dialog.h (header file), dialog.cpp (CPP source) and dialog.ui (UI or form). The project will have one project file, project-name.pro in this case, 1.pro since I named my project “1”.īelow that are three folders: Headers, Sources and Forms, which contain the respective types of files. Once this is done, Qt Creator will open your newly created project (Figure 5), with the project window on the left side. Name your class, then click Next, and finally, Finish. For now, select the QDialog Base Class (Figure 4). In the Base Class combo box, you will find three options, each used for a different purpose. Then you will be asked for class information.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |