Wiki Markup |
---|
{alias:qmenu}
h2. Name
*qmenu* — pulldown or |
Name
qmenu — pulldown or right-click
...
menu
...
Syntax
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
qmenu [title] |
Description
The qmenu command creates a QMenu object. The command may take an optional title argument. A QMenu object may appear as a pulldown menu, a rightclick menu, or a submenu. Menus may be attached to actions, menubars, toolbuttons, other menus, or set as right-click menus in QTreeWidget objects. The QMenu becomes the current widget.
Arguments
_title
Examples
Ex.1: QMenu
Anchor | ||||
---|---|---|---|---|
|
No Format | ||||
---|---|---|---|---|
| ||||
# Create QMainWindow with built-in menubar
set w [qmainwindow]
qsetwindowtitle QMenu
# Get menubar from mainwindow
set menubar [qmenubar $w]
# Create 'File' action and add to menubar
set fileaction [qaction File]
qaddaction $menubar $fileaction
# Create pulldown menu and add to file action
set menu [qmenu]
qsetmenu $fileaction $menu
# Populate file menu
set openaction [qaction Open qopenfilename]
qaddaction $menu $openaction
qshow $w
{noformat}
!att:_img_cmd^qmenu.png!
Example +QMenu+ shows a QMainWindow with a |
Example QMenu shows a QMainWindow with a 'File'
...
pulldown
...
menu.
...
See
...
...
for
...
information
...
on
...
how
...
to
...
attach
...
a
...
pulldown
...
menu
...
to
...
a
...
toolbutton.
...