Quark  0.1
AbstractItemModelMenuAdapter Class Reference

A non-parameterized abstract base class for Quark item model menu adapters. More...

#include <AbstractItemModelMenuAdapter.h++>

Inheritance diagram for AbstractItemModelMenuAdapter:

Public Types

enum  Option { InsertAtTop = 1 << 0, Checkable = 1 << 1, Exclusive = 1 << 2 }
 Item model menu adapter options. More...
 

Public Member Functions

 Q_DECLARE_FLAGS (Options, Option)
 
 AbstractItemModelMenuAdapter (const QAbstractItemModel *model, QMenu *menu, Options options=0)
 Constructor. More...
 
virtual ~AbstractItemModelMenuAdapter ()
 Destructor. More...
 
void sync ()
 Synchronizes the menu with the model. More...
 

Detailed Description

A non-parameterized abstract base class for Quark item model menu adapters.

This class should not be subclassed directly.

Author
Mark Lindner

Member Enumeration Documentation

◆ Option

enum Option

Item model menu adapter options.

Enumerator
InsertAtTop 

An option indicating that the menu items should be inserted above any menu items that existed in the menu at the time of this adapter's construction.

By default, items are added below existing items.

Checkable 

An option indicating that the menu items created by this adapter are checkable.

Exclusive 

An option indicating that the menu items created by this adapter are mutually exclusive; that is, only one may be checked at any given time.

This option is only meaningful if the Checkable option is also set.

Constructor & Destructor Documentation

◆ AbstractItemModelMenuAdapter()

AbstractItemModelMenuAdapter ( const QAbstractItemModel *  model,
QMenu *  menu,
Options  options = 0 
)

Constructor.

◆ ~AbstractItemModelMenuAdapter()

virtual ~AbstractItemModelMenuAdapter ( )
virtual

Destructor.

Member Function Documentation

◆ Q_DECLARE_FLAGS()

Q_DECLARE_FLAGS ( Options  ,
Option   
)

◆ sync()

void sync ( )

Synchronizes the menu with the model.

This method must be called at least once to populate the menu with any items that may exist in the model.


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