The class QtxMenu represents the popup menu with the title. More...
#include <QtxMenu.h>
Classes | |
class | Title |
Popup menu title item. More... | |
Public Types | |
enum | TitleMode { TitleAuto, TitleOn, TitleOff } |
Popup menu title mode. More... | |
Public Slots | |
virtual void | setVisible (bool) |
Customize show/hide menu operation. More... | |
Public Member Functions | |
QtxMenu (QWidget *=0) | |
Constructor. More... | |
virtual | ~QtxMenu () |
Destructor. More... | |
QIcon | titleIcon () const |
Get title icon. More... | |
QString | titleText () const |
Get title menu text. More... | |
TitleMode | titleMode () const |
Get title item display mode. More... | |
Qt::Alignment | titleAlignment () const |
Get title alignment flags. More... | |
virtual void | setTitleIcon (const QIcon &) |
Set title icon. More... | |
virtual void | setTitleText (const QString &) |
Set title menu text. More... | |
virtual void | setTitleMode (const TitleMode) |
Set title item display mode. More... | |
virtual void | setTitleAlignment (const Qt::Alignment) |
Set title alignment flags. More... | |
virtual void | addGroup (const QString &) |
Append group title to the end of the menu. More... | |
virtual void | addGroup (const QIcon &, const QString &) |
Append group title to the end of the menu. More... | |
Private Member Functions | |
void | updateTitle () |
Update title item. More... | |
void | insertTitle () |
Insert title item to the popup menu. More... | |
void | removeTitle () |
Remove title item from the popup menu. More... | |
Private Attributes | |
TitleMode | myMode |
Title * | myTitle |
QWidgetAction * | myAction |
The title for the popup menu can be set via setTitleText() method. In addition, title item can contain the icon, which can be set using setTitleIcon() method. Current title text and icon can be retrieved with titleText() and titleIcon() methods.
The title text alignment flags can be changed using setTitleAlignment() method and retrieved with titleAlignment() method.
By default, QtxMenu::TitleAuto mode is used. In this mode, the title item is shown only if it is not empty. To show title always (even empty), pass QtxMenu::TitleOn to the setTitleMode() method. To hide the title, use setTitleMode() method with QtxMenu::TitleOff parameter.
enum QtxMenu::TitleMode |
QtxMenu::QtxMenu | ( | QWidget * | parent = 0 | ) |
|
virtual |
|
virtual |
text | group title's text |
References QtxMenu::Title::setText().
icon | group title's icon |
text | group title's text |
References QtxMenu::Title::setIcon(), and QtxMenu::Title::setText().
|
private |
References myAction, TitleAuto, titleMode(), TitleOff, and titleText().
|
private |
References myAction.
|
virtual |
a | title alignment flags |
References myTitle, QtxMenu::Title::setAlignment(), titleAlignment(), and updateTitle().
|
virtual |
ico | title item icon |
References myTitle, QtxMenu::Title::setIcon(), and updateTitle().
m | popup menu title display mode (QtxMenu::TitleMode) |
References myMode, and updateTitle().
|
virtual |
txt | menu text to be used for the title item |
References myTitle, QtxMenu::Title::setText(), titleText(), and updateTitle().
|
virtualslot |
on | new popup menu visibility state |
References insertTitle(), and removeTitle().
Qt::Alignment QtxMenu::titleAlignment | ( | ) | const |
References QtxMenu::Title::alignment(), and myTitle.
QIcon QtxMenu::titleIcon | ( | ) | const |
References QtxMenu::Title::icon(), and myTitle.
QtxMenu::TitleMode QtxMenu::titleMode | ( | ) | const |
References myMode.
QString QtxMenu::titleText | ( | ) | const |
References myTitle, and QtxMenu::Title::text().
|
private |
References insertTitle(), myAction, and removeTitle().
|
private |
|
private |
|
private |