- Game Programming Using Qt Beginner's Guide
- Witold Wysota Lorenz Haas
- 247字
- 2021-08-20 10:45:18
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?
Using graphical tools, we created a menu for our program and added a number of actions (that were automatically transformed into menu items) to that menu. Each menu entry received some text and an icon specified by the action that was dropped in the menu.
Tip
To create submenus, first create a menu entry by clicking on the Type Here line and entering the submenu name. Then, drag and hover an action over such a submenu. After a short time, a submenu will pop up and you will be able to drop your action there to create an entry in the second-level menu.
- 程序員面試筆試寶典(第3版)
- Spring 5.0 By Example
- FreeSWITCH 1.6 Cookbook
- 實戰Java程序設計
- 數據結構與算法JavaScript描述
- Python程序設計案例教程
- 深度強化學習算法與實踐:基于PyTorch的實現
- C語言程序設計
- 微信公眾平臺開發:從零基礎到ThinkPHP5高性能框架實踐
- 快人一步:系統性能提高之道
- 深入理解Android:Wi-Fi、NFC和GPS卷
- Haskell Data Analysis Cookbook
- Hands-On Nuxt.js Web Development
- Django 5企業級Web應用開發實戰(視頻教學版)
- Oracle SOA Suite 12c Administrator's Guide