خانه > comp > gb.qt4 > menu 
 en fr de es it nl pl pt pt_BR mk sq ca hu cs tr ar id vi ko ja ru zh zh_TW eo
قبلی  بعدی  ویرایش  تغییر نام  واگرد  Search  سرپرستی  
اخطار! این صفحه ترجمه نشده است.  مشاهده نسخه انگلیسی 
Menu (gb.qt4)

This class represents a popup menu, or one element of a popup menu.

این کلاس ساختنی هست.

خصوصیات  متد ها  رویداد ها 
 Action  Caption  Checked  Children  Enabled  Name  Picture  Shortcut  Tag  Text  Toggle  Value  Visible  Window   Delete  Hide  Popup  Show   Click  Hide  Show 

Creating a popup menu.

A popup menu is built by creating a hierarchy tree of Menu objects.

Top-level menus

To create a top-level menu, i.e. an entry in the menu bar, the window must be the parent شی of the menu.

As soon as a window has at least one visible top-level menu, the window menu bar becomes visible. Otherwise, it is hidden.

The Unity desktop removes the menu bar from the application window to put it on the top desktop panel.

Alas, it does not work well on windows that are not top-level windows, but embedded windows (like the Workspace control does).

To workaround the problem, run the following code at the very beginning of your program:

Application.Env["APPMENU_DISPLAY_BOTH"] = "1"

To create a contextual popup menu not visible on the menu bar, just set its Visible property to False.

Menu entries

Menu entries are Menu objects having no child.

Note that Menu controls do not inherit the Control class, and they do not raise any event of the Control class.

The order of menu entries in its popup parent menu follows the order of the creation.


If the Text property of a menu entry is void, then that menu entry is replaced by a separator.

Useless separators are automatically removed when the popup menu is shown.