Thursday, July 1, 2010

Qt Creator 2.0 exercise: up/down counter - II/3 : Add Quit function

Following the last article "Qt Creator 2.0 exercise: up/down counter - I : New the application and place UI elements", the Quit function of the application will be implemented here.

In Design Mode, click on the Edit Signals/Slots icon on the top menu, or press F4.


Move mouse over the Quit button, press and hold the left button of the mouse, and drag it to any empty space of the window pane.


Click to select "Show signals and slots inherited from QWidget", select clicked() on the left box, and close() on the right box, click OK.


You can note the window pane is updated with the added signal/slot.


Save All, and Run the application.
Now you can quit the application by clicking on the Quit button.