Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QtxMenu Class Reference

The class QtxMenu represents the popup menu with the title. More...

#include <QtxMenu.h>

Inheritance diagram for QtxMenu:
Inheritance graph

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
 
TitlemyTitle
 
QWidgetActionmyAction
 

Detailed Description

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.

Member Enumeration Documentation

Enumerator
TitleAuto 

auto mode

TitleOn 

always on (display title)

TitleOff 

always off (do not display title)

Constructor & Destructor Documentation

QtxMenu::QtxMenu ( QWidget parent = 0)
Parameters
parentparent widget

References myAction, and myTitle.

QtxMenu::~QtxMenu ( )
virtual

Member Function Documentation

void QtxMenu::addGroup ( const QString &  text)
virtual
Parameters
textgroup title's text

References QtxMenu::Title::setText().

void QtxMenu::addGroup ( const QIcon &  icon,
const QString &  text 
)
virtual
Parameters
icongroup title's icon
textgroup title's text

References QtxMenu::Title::setIcon(), and QtxMenu::Title::setText().

void QtxMenu::insertTitle ( )
private
void QtxMenu::removeTitle ( )
private

References myAction.

void QtxMenu::setTitleAlignment ( const Qt::Alignment  a)
virtual
Parameters
atitle alignment flags

References myTitle, QtxMenu::Title::setAlignment(), titleAlignment(), and updateTitle().

void QtxMenu::setTitleIcon ( const QIcon &  ico)
virtual
Parameters
icotitle item icon

References myTitle, QtxMenu::Title::setIcon(), and updateTitle().

void QtxMenu::setTitleMode ( const TitleMode  m)
virtual
Parameters
mpopup menu title display mode (QtxMenu::TitleMode)

References myMode, and updateTitle().

void QtxMenu::setTitleText ( const QString &  txt)
virtual
Parameters
txtmenu text to be used for the title item

References myTitle, QtxMenu::Title::setText(), titleText(), and updateTitle().

void QtxMenu::setVisible ( bool  on)
virtualslot
Parameters
onnew popup menu visibility state

References insertTitle(), and removeTitle().

Qt::Alignment QtxMenu::titleAlignment ( ) const
Returns
title alignment flags

References QtxMenu::Title::alignment(), and myTitle.

QIcon QtxMenu::titleIcon ( ) const
Returns
title item icon

References QtxMenu::Title::icon(), and myTitle.

QtxMenu::TitleMode QtxMenu::titleMode ( ) const
Returns
popup menu title display mode (QtxMenu::TitleMode)

References myMode.

QString QtxMenu::titleText ( ) const
Returns
menu text for the title item

References myTitle, and QtxMenu::Title::text().

void QtxMenu::updateTitle ( )
private

Member Data Documentation

QWidgetAction* QtxMenu::myAction
private
TitleMode QtxMenu::myMode
private
Title* QtxMenu::myTitle
private

The documentation for this class was generated from the following files: