libqutim
0.3.1.0
|
#include <menucontroller.h>
Public Types | |
enum | MenuFlag { ShowSelfActions = 0x01, ShowSuperActions = 0x02, ShowOwnerActions = 0x04 } |
Public Slots | |
void | showMenu (const QPoint &pos) |
Public Member Functions | |
MenuController (QObject *parent=0) | |
virtual | ~MenuController () |
void | addAction (const ActionGenerator *gen, const QList< QByteArray > &menu=QList< QByteArray >()) |
template<int N> | |
void | addAction (const ActionGenerator *gen, const char(&menu)[N]) |
template<int N> | |
Q_INLINE_TEMPLATE void | addAction (const ActionGenerator *gen, const char(&menu)[N]) |
template<typename T, int N> | |
Q_INLINE_TEMPLATE void | addAction (const ActionGenerator *gen, const char(&menu)[N]) |
template<int N> | |
Q_INLINE_TEMPLATE void | addAction (const ActionGenerator *gen, const QMetaObject *meta, const char(&menu)[N]) |
QMenu * | menu (bool deleteOnClose=true) const |
bool | removeAction (const ActionGenerator *gen) |
Static Public Member Functions | |
static void | addAction (const ActionGenerator *gen, const QMetaObject *meta, const QList< QByteArray > &menu=QList< QByteArray >()) |
template<typename T > | |
static void | addAction (const ActionGenerator *gen, const QList< QByteArray > &menu=QList< QByteArray >()) |
template<typename T , int N> | |
static void | addAction (const ActionGenerator *gen, const char(&menu)[N]) |
template<int N> | |
static void | addAction (const ActionGenerator *gen, const QMetaObject *meta, const char(&menu)[N]) |
static QObject * | get (QAction *) |
template<typename T > | |
static T | get (QAction *) |
Protected Member Functions | |
void | setMenuFlags (const MenuFlags &flags) |
void | setMenuOwner (MenuController *controller) |
virtual void | virtual_hook (int id, void *data) |
MenuController is base type for objects which are able to have menu.
Example of how to register and use actions:
qutim_sdk_0_3::MenuController::MenuController | ( | QObject * | parent = 0 ) |
Constructs MenuController with parent.
|
virtual |
Destructor.
Q_INLINE_TEMPLATE void qutim_sdk_0_3::MenuController::addAction | ( | const ActionGenerator * | gen, |
const QList< QByteArray > & | menu = QList<QByteArray>() |
||
) |
Add action gen to this object.
If menu is not empty action will be situated not in the root of menu, but in the submenu hierarchy; menu contains untranslated names of submenus in the tree. deleteOnClose deprecated 1.
void qutim_sdk_0_3::MenuController::addAction | ( | const ActionGenerator * | gen, |
const char(&) | menu[N] | ||
) |
Add action gen to this object.
If menu is not empty action will be situated not in the root of menu, but in the submenu hierarchy; menu contains list of null-terminated strings, each of them is untranslated name of submenu.
|
static |
Add action gen to every object with QMetaObject meta.
If menu is not empty action will be situated not in the root of menu, but in the submenu hierarchy; menu contains untranslated names of submenus in the tree.
|
static |
Add action gen to every object of type T.
If menu is not empty action will be situated not in the root of menu, but in the submenu hierarchy; menu contains untranslated names of submenus in the tree.
|
static |
Add action gen to every object of type T.
If menu is not empty action will be situated not in the root of menu, but in the submenu hierarchy; menu contains list of null-terminated strings, each of them is untranslated name of submenu.
|
static |
Add action gen to every object with QMetaObject meta.
If menu is not empty action will be situated not in the root of menu, but in the submenu hierarchy; menu contains list of null-terminated strings, each of them is untranslated name of submenu.
Q_INLINE_TEMPLATE void qutim_sdk_0_3::MenuController::addAction | ( | const ActionGenerator * | gen, |
const char(&) | menu[N] | ||
) |
Q_INLINE_TEMPLATE void qutim_sdk_0_3::MenuController::addAction | ( | const ActionGenerator * | gen, |
const char(&) | menu[N] | ||
) |
Q_INLINE_TEMPLATE void qutim_sdk_0_3::MenuController::addAction | ( | const ActionGenerator * | gen, |
const QMetaObject * | meta, | ||
const char(&) | menu[N] | ||
) |
|
static |
Returns MenuController for action which has emitted signal connected to this slot.
obj must be result of sender().
Example of use inside slot method:
|
static |
QMenu* qutim_sdk_0_3::MenuController::menu | ( | bool | deleteOnClose = true ) | const |
Generate menu for this object and return pointer to it.
Menu will be deleted after closing if deleteOnClose is true.
bool qutim_sdk_0_3::MenuController::removeAction | ( | const ActionGenerator * | gen) |
|
protected |
|
protected |
Add to menu of this object also actions from another controller.
|
slot |
|
protectedvirtual |