Time for action – adding a pull-down menu

To create a menu for the window, double-click on the Type Here text on the top of the form and replace the text with &File. Then, drag the New Game action from the action editor over the newly created menu but do not drop it there yet. The menu should open now and you can drag the action so that a red bar appears in the submenu in the position where you want the menu entry to appear—now you can release the mouse button to create the entry. Afterwards, open the menu again by clicking on File and choose Add Separator. Then, repeat the drag-and-drop operation for the Quit action to insert a menu entry for it just below the separator in the File menu, as shown in the following figure:

What just happened?

Get Game Programming Using Qt now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.