A menu that divides its entries into submenus, alphabetically. More...

#include <SubdividingMenu.h>

Inheritance diagram for SubdividingMenu:
Inheritance graph
Collaboration diagram for SubdividingMenu:
Collaboration graph

Public Member Functions

 SubdividingMenu (int lowerLimit=0, int upperLimit=0, QWidget *parent=0)
 
 SubdividingMenu (const QString &title, int lowerLimit=0, int upperLimit=0, QWidget *parent=0)
 
virtual ~SubdividingMenu ()
 
void setEntries (const std::set< QString > &entries)
 
void entriesAdded ()
 
virtual void addAction (QAction *)
 
virtual QAction * addAction (const QString &)
 
virtual void addAction (const QString &entry, QAction *)
 
virtual void addMenu (QMenu *)
 
virtual QMenu * addMenu (const QString &)
 
virtual void addMenu (const QString &entry, QMenu *)
 

Protected Attributes

std::map< QString, QMenu * > m_nameToChunkMenuMap
 
int m_lowerLimit
 
int m_upperLimit
 
bool m_entriesSet
 
std::map< QString, QObject * > m_pendingEntries
 

Detailed Description

A menu that divides its entries into submenus, alphabetically.

For menus that may contain a very large or small number of named items (e.g. plugins).

The menu needs to be told, before any of the actions are added, what the set of entry strings will be, so it can determine a reasonable categorisation. Do this by calling the setEntries() method. If it isn't practical to do this in advance, then add the entries and call entriesAdded() afterwards instead.

Definition at line 37 of file SubdividingMenu.h.

Constructor & Destructor Documentation

SubdividingMenu::SubdividingMenu ( int  lowerLimit = 0,
int  upperLimit = 0,
QWidget *  parent = 0 
)

Definition at line 27 of file SubdividingMenu.cpp.

SubdividingMenu::SubdividingMenu ( const QString &  title,
int  lowerLimit = 0,
int  upperLimit = 0,
QWidget *  parent = 0 
)

Definition at line 39 of file SubdividingMenu.cpp.

SubdividingMenu::~SubdividingMenu ( )
virtual

Definition at line 52 of file SubdividingMenu.cpp.

References m_pendingEntries.

Member Function Documentation

void SubdividingMenu::setEntries ( const std::set< QString > &  entries)

Definition at line 61 of file SubdividingMenu.cpp.

References m_entriesSet, m_lowerLimit, m_nameToChunkMenuMap, and m_upperLimit.

Referenced by entriesAdded().

void SubdividingMenu::entriesAdded ( )

Definition at line 164 of file SubdividingMenu.cpp.

References addAction(), addMenu(), m_entriesSet, m_pendingEntries, and setEntries().

void SubdividingMenu::addAction ( QAction *  action)
virtual

Definition at line 209 of file SubdividingMenu.cpp.

References m_entriesSet, m_nameToChunkMenuMap, and m_pendingEntries.

Referenced by entriesAdded().

QAction * SubdividingMenu::addAction ( const QString &  name)
virtual

Definition at line 233 of file SubdividingMenu.cpp.

References m_entriesSet, m_nameToChunkMenuMap, and m_pendingEntries.

void SubdividingMenu::addAction ( const QString &  entry,
QAction *  action 
)
virtual

Definition at line 255 of file SubdividingMenu.cpp.

References m_entriesSet, m_nameToChunkMenuMap, and m_pendingEntries.

void SubdividingMenu::addMenu ( QMenu *  menu)
virtual

Definition at line 277 of file SubdividingMenu.cpp.

References m_entriesSet, m_nameToChunkMenuMap, and m_pendingEntries.

Referenced by entriesAdded().

QMenu * SubdividingMenu::addMenu ( const QString &  name)
virtual

Definition at line 301 of file SubdividingMenu.cpp.

References m_entriesSet, m_nameToChunkMenuMap, and m_pendingEntries.

void SubdividingMenu::addMenu ( const QString &  entry,
QMenu *  menu 
)
virtual

Definition at line 324 of file SubdividingMenu.cpp.

References m_entriesSet, m_nameToChunkMenuMap, and m_pendingEntries.

Member Data Documentation

std::map<QString, QMenu *> SubdividingMenu::m_nameToChunkMenuMap
protected

Definition at line 66 of file SubdividingMenu.h.

Referenced by addAction(), addMenu(), and setEntries().

int SubdividingMenu::m_lowerLimit
protected

Definition at line 68 of file SubdividingMenu.h.

Referenced by setEntries().

int SubdividingMenu::m_upperLimit
protected

Definition at line 69 of file SubdividingMenu.h.

Referenced by setEntries().

bool SubdividingMenu::m_entriesSet
protected

Definition at line 71 of file SubdividingMenu.h.

Referenced by addAction(), addMenu(), entriesAdded(), and setEntries().

std::map<QString, QObject *> SubdividingMenu::m_pendingEntries
protected

Definition at line 72 of file SubdividingMenu.h.

Referenced by addAction(), addMenu(), entriesAdded(), and ~SubdividingMenu().


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