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 class QtxMenu represents the popup menu with the title.
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 |
Destructor.
|
virtual |
Append group title to the end of the menu.
icon | group title's icon |
text | group title's text |
References QtxMenu::Title::setIcon(), and QtxMenu::Title::setText().
|
virtual |
Append group title to the end of the menu.
text | group title's text |
References QtxMenu::Title::setText().
|
private |
Insert title item to the popup menu.
References myAction, TitleAuto, titleMode(), TitleOff, and titleText().
|
private |
Remove title item from the popup menu.
References myAction.
|
virtual |
Set title alignment flags.
a | title alignment flags |
References myTitle, QtxMenu::Title::setAlignment(), titleAlignment(), and updateTitle().
|
virtual |
Set title icon.
ico | title item icon |
References myTitle, QtxMenu::Title::setIcon(), and updateTitle().
|
virtual |
Set title item display mode.
m | popup menu title display mode (QtxMenu::TitleMode) |
References myMode, and updateTitle().
|
virtual |
Set title menu text.
txt | menu text to be used for the title item |
References myTitle, QtxMenu::Title::setText(), titleText(), and updateTitle().
|
virtualslot |
Customize show/hide menu operation.
on | new popup menu visibility state |
References insertTitle(), and removeTitle().
Qt::Alignment QtxMenu::titleAlignment | ( | ) | const |
Get title alignment flags.
References QtxMenu::Title::alignment(), and myTitle.
QIcon QtxMenu::titleIcon | ( | ) | const |
QtxMenu::TitleMode QtxMenu::titleMode | ( | ) | const |
Get title item display mode.
References myMode.
QString QtxMenu::titleText | ( | ) | const |
Get title menu text.
References myTitle, and QtxMenu::Title::text().
|
private |
Update title item.
References insertTitle(), myAction, and removeTitle().
|
private |
|
private |
|
private |