MeVisLab Scripting Reference
MLABPopupMenuControl Class Reference

#include <mlabPopupMenuControl.h>

Inherits MLABWidgetControl.

Public Slots

Scripting access.


MLABPopupMenuControlappendPopupItem (const QString &text, const QString &name)
 
MLABPopupMenuControlappendPopupItem (const QString &text)
 
MLABPopupMenuControlinsertPopupItem (int index, const QString &text, const QString &name)
 
MLABPopupMenuControlinsertPopupItem (int index, const QString &text)
 
MLABPopupMenuControlgetPopupItem (const QString &name)
 
QAction * appendItem (const QString &text, const QVariant &script, const QString &name)
 
QAction * appendItem (const QString &text, const QVariant &script)
 
QAction * appendFieldItem (MLABField *field, const QString &text=QString())
 
QAction * appendSeparator ()
 
QAction * insertSeparator (QAction *action)
 
QAction * appendSeparator (const QString &name)
 
QAction * insertSeparator (QAction *action, const QString &name)
 
QAction * insertSeparator (int index)
 
QAction * insertSeparator (int index, const QString &name)
 
QAction * insertItem (int index, const QString &text, const QVariant &script, const QString &name)
 
QAction * insertItem (int index, const QString &text, const QVariant &script)
 
QAction * insertFieldItem (int index, MLABField *field, const QString &text=QString())
 
bool hasItem (const QString &name)
 
bool isItemChecked (const QString &name)
 
void setItemChecked (const QString &name, bool flag)
 
bool isItemEnabled (const QString &name)
 
void setItemEnabled (const QString &name, bool flag)
 
bool isItemVisible (const QString &name)
 
void setItemVisible (const QString &name, bool flag)
 
void setItemText (const QString &name, const QString &text)
 
QString itemText (const QString &name)
 
void setItemIcon (const QString &name, const QString &pixmapfile)
 
void setItemPixmap (const QString &name, const QString &pixmapfile)
 
void setItemAccel (const QString &name, const QString &accel)
 
void setItemWhatsThis (const QString &name, const QString &whatsthis)
 
void setItemIconVisibleInMenu (const QString &name, bool visible=true)
 
void removeItem (const QString &name)
 
void clearItems ()
 
void popup ()
 
void popup (const QPoint &pos)
 
QMenu * menu ()
 
- Public Slots inherited from MLABWidgetControl
void adjustSize ()
 
virtual void setEnabled (bool flag)
 
virtual void setVisible (bool flag)
 
virtual bool isVisible ()
 
virtual void setFocus ()
 
virtual bool hasFocus ()
 
virtual void setToolTip (const QString &string)
 
virtual void setWhatsThis (const QString &string)
 
void displayWhatsThis ()
 
void displayWhatsThis (const QString &text)
 
virtual void setTitle (const QString &)
 
QWidget * widget ()
 
QLayout * layout ()
 
virtual QString windowHandle ()
 
virtual bool createScreenshot (const QString &filename, bool grabFromScreen=true, bool scaleToLowRes=false)
 
bool isReloadable () const
 
void reload (MLABTree *tree)
 
QString createGlobalScreenshot ()
 
QString applicationName ()
 
QSize size ()
 
int width ()
 
int height ()
 
int minWidth ()
 
int minHeight ()
 
int maxWidth ()
 
int maxHeight ()
 
virtual void setMinWidth (int s)
 
virtual void setMinHeight (int s)
 
void setMaxWidth (int s)
 
void setMaxHeight (int s)
 
QSize sizeHint ()
 
QSize minSize ()
 
QSize maxSize ()
 
void setMinSize (QSize size)
 
void setMaxSize (QSize size)
 
void updateLayout ()
 
int windowID ()
 
MLABWidgetControlcontrol (const QString &name)
 
float scaleFactor ()
 
MLABModulemodule ()
 
QString getType ()
 
QString getName ()
 
bool acceptDrops ()
 
void setAcceptDrops (bool flag)
 
void raiseWidget ()
 
void setStyleSheetFromString (const QString &styleSheetText)
 
void setStyleSheetFromFile (const QString &styleSheetFileName)
 
MLABTreetree ()
 
void updateMaxSize ()
 
bool expandX ()
 
bool expandY ()
 
MLABTreePtr getDefaultTagValues () const
 
virtual bool hasUncommittedChanges () const
 
virtual void applyUncommittedChanges ()
 
virtual void revertUncommittedChanges ()
 
MLABFieldfield () const
 

Detailed Description

PopupMenu control.

PopupMenu control to access popup menus from scripting.

Member Function Documentation

◆ appendFieldItem

QAction * MLABPopupMenuControl::appendFieldItem ( MLABField * field,
const QString & text = QString() )
slot

Appends a field item.

The field is touched if the item is triggered. Bool fields are toggled when the item is triggered.

◆ appendItem [1/2]

QAction * MLABPopupMenuControl::appendItem ( const QString & text,
const QVariant & script )
slot

Appends an item (unnamed).

◆ appendItem [2/2]

QAction * MLABPopupMenuControl::appendItem ( const QString & text,
const QVariant & script,
const QString & name )
slot

Appends an item (with given name).

◆ appendPopupItem [1/2]

MLABPopupMenuControl * MLABPopupMenuControl::appendPopupItem ( const QString & text)
slot

Appends a popup menu item (unnamed).

◆ appendPopupItem [2/2]

MLABPopupMenuControl * MLABPopupMenuControl::appendPopupItem ( const QString & text,
const QString & name )
slot

Appends a popup menu item (with given name, the new popup is both registered as a control and as a menu item).

Note
If you want to remove it again, call .widget().delete() on the returned control.

◆ appendSeparator [1/2]

QAction * MLABPopupMenuControl::appendSeparator ( )
slot

Appends a separator item.

◆ appendSeparator [2/2]

QAction * MLABPopupMenuControl::appendSeparator ( const QString & name)
slot

Appends a separator item.

◆ clearItems

void MLABPopupMenuControl::clearItems ( )
slot

Removes all items.

◆ getPopupItem

MLABPopupMenuControl * MLABPopupMenuControl::getPopupItem ( const QString & name)
slot

Returns the item popup with the given name, or NULL if it does not exists.

◆ hasItem

bool MLABPopupMenuControl::hasItem ( const QString & name)
slot

Returns whether an item with the given name exists.

◆ insertFieldItem

QAction * MLABPopupMenuControl::insertFieldItem ( int index,
MLABField * field,
const QString & text = QString() )
slot

Appends a field item.

The field is touched if the item is triggered. Bool fields are toggled when the item is triggered.

◆ insertItem [1/2]

QAction * MLABPopupMenuControl::insertItem ( int index,
const QString & text,
const QVariant & script )
slot

Inserts an item (unnamed) at index (0= top, -1= bottom).

◆ insertItem [2/2]

QAction * MLABPopupMenuControl::insertItem ( int index,
const QString & text,
const QVariant & script,
const QString & name )
slot

Inserts an item (with given name) at index (0= top, -1= bottom).

◆ insertPopupItem [1/2]

MLABPopupMenuControl * MLABPopupMenuControl::insertPopupItem ( int index,
const QString & text )
slot

Inserts a popup menu item (unnamed).

◆ insertPopupItem [2/2]

MLABPopupMenuControl * MLABPopupMenuControl::insertPopupItem ( int index,
const QString & text,
const QString & name )
slot

Inserts a popup menu item (with given name , the new popup is both registered as a control and as a menu item).

◆ insertSeparator [1/4]

QAction * MLABPopupMenuControl::insertSeparator ( int index)
slot

Inserts a separator item (deprecated, use one of the other overloads).

◆ insertSeparator [2/4]

QAction * MLABPopupMenuControl::insertSeparator ( int index,
const QString & name )
slot

Inserts a separator item (deprecated, use one of the other overloads).

◆ insertSeparator [3/4]

QAction * MLABPopupMenuControl::insertSeparator ( QAction * action)
slot

Inserts a separator item.

◆ insertSeparator [4/4]

QAction * MLABPopupMenuControl::insertSeparator ( QAction * action,
const QString & name )
slot

Inserts a separator item.

◆ isItemChecked

bool MLABPopupMenuControl::isItemChecked ( const QString & name)
slot

Returns whether an item is checked.

◆ isItemEnabled

bool MLABPopupMenuControl::isItemEnabled ( const QString & name)
slot

Returns whether an item is enabled.

◆ isItemVisible

bool MLABPopupMenuControl::isItemVisible ( const QString & name)
slot

Returns whether an item is visible.

◆ itemText

QString MLABPopupMenuControl::itemText ( const QString & name)
slot

Returns an item's text.

◆ menu

QMenu * MLABPopupMenuControl::menu ( )
inlineslot

Returns access to the underlying QMenu.

◆ popup [1/2]

void MLABPopupMenuControl::popup ( )
slot

Pops up the menu at the current cursor pos.

◆ popup [2/2]

void MLABPopupMenuControl::popup ( const QPoint & pos)
slot

Pops up the menu at the given screen position.

◆ removeItem

void MLABPopupMenuControl::removeItem ( const QString & name)
slot

Removes an item.

◆ setItemAccel

void MLABPopupMenuControl::setItemAccel ( const QString & name,
const QString & accel )
slot

Sets a keyboard accelerator for the item.

◆ setItemChecked

void MLABPopupMenuControl::setItemChecked ( const QString & name,
bool flag )
slot

Sets whether an item is checked.

◆ setItemEnabled

void MLABPopupMenuControl::setItemEnabled ( const QString & name,
bool flag )
slot

Sets whether an item is enabled.

◆ setItemIcon

void MLABPopupMenuControl::setItemIcon ( const QString & name,
const QString & pixmapfile )
slot

Sets an icon that is shown to the left of the text.

◆ setItemIconVisibleInMenu

void MLABPopupMenuControl::setItemIconVisibleInMenu ( const QString & name,
bool visible = true )
slot

On some platforms icons are generally not shown in menus (such as OS X).

This function may be used to override this setting (Qt::AA_DontShowIconsInMenus attribute). If true, the icon is shown in the menu, when it is false, it is not shown.

◆ setItemPixmap

void MLABPopupMenuControl::setItemPixmap ( const QString & name,
const QString & pixmapfile )
slot

Sets a pixmap for the item (overwrites the text that may be set).

◆ setItemText

void MLABPopupMenuControl::setItemText ( const QString & name,
const QString & text )
slot

Sets the text of an item.

◆ setItemVisible

void MLABPopupMenuControl::setItemVisible ( const QString & name,
bool flag )
slot

Sets whether an item is visible.

◆ setItemWhatsThis

void MLABPopupMenuControl::setItemWhatsThis ( const QString & name,
const QString & whatsthis )
slot

Sets a keyboard accelerator for of the item.