Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Wiki Markup
{alias:qmenu}
h2. Name

*qmenu* — pulldown or 

Name

qmenu — pulldown or right-click

...

menu

...

Syntax

Panel
bgColor#FFFFAA
borderWidth1
borderStylesolid

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
QMenu
QMenu

No Format
bgColor#eeeeee
borderWidth1
# 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 

Image Added

Example QMenu shows a QMainWindow with a 'File'

...

pulldown

...

menu.

...

See

...

qtoolbar

...

for

...

information

...

on

...

how

...

to

...

attach

...

a

...

pulldown

...

menu

...

to

...

a

...

toolbutton.

...