| OpendTect 8.0

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
uiMenu Class Reference
uiBase

`#include <uimenu.h>`

Inheritance diagram for uiMenu:
[legend]

## Public Member Functions
| uiMenu (const MenuItem &)
| uiMenu (const uiString &txt=uiString::emptyString(), const char *iconnm=nullptr)
| uiMenu (uiParent *, const uiString &txt=uiString::emptyString(), const char *iconfilenm=0)
| ~uiMenu ()
void | addItems (const ObjectSet< MenuItem > &)
void | clear ()
void | doIntercept (bool yn, uiAction *activateitm=0)
int | exec ()
| pops-up at mouse position
const char * | getIconName () const
QMenu * | getQMenu ()
QWidget * | getWidget () override
bool | isCheckable () const
bool | isChecked () const
bool | isEnabled () const
bool | isStandAlone () const
| mOD_DisableCopy (uiMenu) bool isMenu() const override
void | preventClose (bool yn=true)
void | setCheckable (bool)
void | setChecked (bool)
void | setEnabled (bool)
void | setIcon (const char *iconnm)
void | setIcon (const uiIcon &)
void | setText (const uiString &)
const uiString & | text () const
Public Member Functions inherited from uiActionContainer
virtual | ~uiActionContainer ()
const ObjectSet< uiAction > & | actions () const
uiMenu * | addMenu (uiMenu *, const uiAction *before)
uiMenu * | addMenu (uiMenu *, const uiMenu *before=nullptr)
const uiAction * | findAction (const char *itmtxt) const
const uiAction * | findAction (const StringView &fs) const
const uiAction * | findAction (const uiActionSeparString &) const
const uiAction * | findAction (const uiMenu *) const
const uiAction * | findAction (const uiString &itmtxt) const
| The full string of the text will be used.
const uiAction * | findAction (int id) const
int | getID (const QAction *) const
int | getID (const uiAction *) const
bool | hasSharedActions () const
const TypeSet< int > & | ids () const
int | insertAction (const MenuItem &)
int | insertAction (uiAction *act, int id=-1, const uiAction *before=0)
int | insertItem (uiAction *a, int id=-1, const uiAction *before=0)
int | insertItem (uiMenu *mnu)
uiAction * | insertSeparator ()
bool | isEmpty () const
virtual bool | isMenu () const
int | nrActions () const
void | reloadIcons ()
void | removeAction (int id)
void | removeAction (uiAction *)
void | removeActions (const TypeSet< int > &ids)
void | removeAllActions ()
void | removeItem (int id)
| Legacy.
void | removeItem (uiAction *a)
| Legacy.
bool | removeMenu (uiMenu &)
void | shareActionsFrom (const uiActionContainer *)
Public Member Functions inherited from uiBaseObject
virtual | ~uiBaseObject ()
int | beginCmdRecEvent (const BufferString &msg)
int | beginCmdRecEvent (const char *msg=0)
int | beginCmdRecEvent (od_uint64 id, const char *msg=0)
uiBody * | body ()
const uiBody * | body () const
void | clear ()
void | endCmdRecEvent (int refnr, const char *msg=0)
void | endCmdRecEvent (od_uint64 id, int refnr, const char *msg=0)
void | finalise ()
bool | finalised () const
bool | finalized () const
const QWidget * | getWidget () const
| mOD_DisableCopy (uiBaseObject) void final ize()
virtual Notifier< uiBaseObject > & | postFinalise ()
virtual Notifier< uiBaseObject > & | postFinalize ()
virtual Notifier< uiBaseObject > & | preFinalise ()
virtual Notifier< uiBaseObject > & | preFinalize ()
virtual void | translateText ()
Public Member Functions inherited from NamedCallBacker
| NamedCallBacker (const char *nm=nullptr)
| NamedCallBacker (const NamedCallBacker &)=delete
| ~NamedCallBacker ()
virtual Notifier< NamedCallBacker > & | objectToBeDeleted () const
NamedCallBacker & | operator= (const NamedCallBacker &)=delete
bool | operator== (const NamedCallBacker &oth) const
bool | operator== (const NamedObject &oth) const
Public Member Functions inherited from CallBacker
| CallBacker ()
| CallBacker (const CallBacker &)
virtual | ~CallBacker ()
bool | attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
bool | attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
void | detachAllNotifiers () const
| Call from the destructor of your inherited object.
void | detachCB (const NotifierAccess &, const CallBack &) const
void | detachCB (const NotifierAccess *notif, const CallBack &cb) const
virtual bool | isCapsule () const
bool | isNotifierAttached (const NotifierAccess *) const
| Only for debugging purposes, don't use.
CallBacker & | operator= (const CallBacker &)=delete
void | stopReceivingNotifications () const
virtual CallBacker * | trueCaller ()
Public Member Functions inherited from NamedObject
| NamedObject (const char *nm=nullptr)
| NamedObject (const NamedObject &oth)
virtual | ~NamedObject ()
virtual BufferString | getName () const
bool | getNameFromPar (const IOPar &)
const name_type & | name () const override
NamedObject & | operator= (const NamedObject &)
bool | operator== (const NamedObject &oth) const
virtual void | setName (const char *nm)
Public Member Functions inherited from ObjectWithName
virtual | ~ObjectWithName ()
bool | hasName (const char *nm) const
bool | hasName (const name_type &nm) const
void | putNameInPar (IOPar &) const

## Static Public Member Functions
static void | addInterceptor (const CallBack &)
| Not for casual use.
static void | removeInterceptor (const CallBack &)
Static Public Member Functions inherited from uiBaseObject
static void | addCmdRecorder (const CallBack &)
static void | removeCmdRecorder (const CallBack &)
Static Public Member Functions inherited from CallBacker
static void | createReceiverForCurrentThread ()
static void | removeReceiverForCurrentThread ()

## Private Member Functions
void | doClear () override
void | doInsertAction (QAction *, QAction *before) override
void | doInsertMenu (QMenu *, QAction *before) override
void | doInsertSeparator (QAction *before) override
void | doRemoveAction (QAction *) override
void | setAction (uiAction *)
void | useStyleSheet ()

## Private Attributes
bool | dointercept_ = false
BufferString | iconnm_
uiAction * | interceptaction_ = nullptr
QMenu * | qmenu_
uiAction * | submenuaction_ = nullptr
uiString | text_

## Friends
class | uiAction

## Additional Inherited Members
Public Types inherited from ObjectWithName
typedef OD::String | name_type
Protected Member Functions inherited from uiActionContainer
| uiActionContainer ()
int | getFreeID () const
Protected Member Functions inherited from uiBaseObject
| uiBaseObject (const char *nm, uiBody *=nullptr)
void | setBody (uiBody *b)
Protected Member Functions inherited from NamedCallBacker
void | sendDelNotif () const
Protected Attributes inherited from uiActionContainer
ObjectSet< uiAction > | actions_
bool | hassharedactions_ = false
TypeSet< int > | ids_
Protected Attributes inherited from NamedCallBacker
Threads::Atomic< bool > | delalreadytriggered_
Notifier< NamedCallBacker > | delnotif_
Protected Attributes inherited from NamedObject
BufferString | name_

## Detailed Description

A standard menu. If you create one yourself, you own it and should delete it. If you insert it into a menu or toolbar, ownership is transfered.

<>

## Constructor & Destructor Documentation

## ◆ uiMenu() [1/3]

uiMenu::uiMenu | ( | const uiString & | txt = uiString::emptyString(),
|  | const char * | iconnm = nullptr )

## ◆ uiMenu() [2/3]

uiMenu::uiMenu | ( | const MenuItem & |  | ) |

## ◆ ~uiMenu()

uiMenu::~uiMenu | ( |  | ) |

## ◆ uiMenu() [3/3]

uiMenu::uiMenu | ( | uiParent * | ,
|  | const uiString & | txt = uiString::emptyString(),
|  | const char * | iconfilenm = 0 )

## Member Function Documentation

## ◆ addInterceptor()

static void uiMenu::addInterceptor | ( | const CallBack & |  | ) |
| static

Not for casual use.

## ◆ addItems()

void uiMenu::addItems | ( | const ObjectSet< MenuItem > & |  | ) |

## ◆ clear()

void uiMenu::clear | ( |  | ) |
| inline

## ◆ doClear()

void uiMenu::doClear | ( |  | ) |
| override private virtual

Implements uiActionContainer.

## ◆ doInsertAction()

void uiMenu::doInsertAction | ( | QAction * | ,
|  | QAction * | before )
| override private virtual

Implements uiActionContainer.

## ◆ doInsertMenu()

void uiMenu::doInsertMenu | ( | QMenu * | ,
|  | QAction * | before )
| override private virtual

Implements uiActionContainer.

## ◆ doInsertSeparator()

void uiMenu::doInsertSeparator | ( | QAction * | before | ) |
| override private virtual

Implements uiActionContainer.

## ◆ doIntercept()

void uiMenu::doIntercept | ( | bool | yn,
|  | uiAction * | activateitm = 0 )

## ◆ doRemoveAction()

void uiMenu::doRemoveAction | ( | QAction * |  | ) |
| override private virtual

Implements uiActionContainer.

## ◆ exec()

int uiMenu::exec | ( |  | ) |

pops-up at mouse position

The return code is the id of the selected item in either the popup menu or one of its submenus, or -1 if no item is selected (normally because the user presses Escape).

## ◆ getIconName()

const char * uiMenu::getIconName | ( |  | ) | const

## ◆ getQMenu()

QMenu * uiMenu::getQMenu | ( |  | ) |
| inline

## ◆ getWidget()

QWidget * uiMenu::getWidget | ( |  | ) |
| override virtual

Reimplemented from uiBaseObject.

## ◆ isCheckable()

bool uiMenu::isCheckable | ( |  | ) | const

Returns
  true if this menu is not inserted into a menu with an item that owns it.

## ◆ isChecked()

bool uiMenu::isChecked | ( |  | ) | const

## ◆ isEnabled()

bool uiMenu::isEnabled | ( |  | ) | const

## ◆ isStandAlone()

bool uiMenu::isStandAlone | ( |  | ) | const
| inline

## ◆ mOD_DisableCopy()

uiMenu::mOD_DisableCopy | ( | uiMenu |  | ) | const
| inline override

## ◆ preventClose()

void uiMenu::preventClose | ( | bool | yn = true | ) |

## ◆ removeInterceptor()

static void uiMenu::removeInterceptor | ( | const CallBack & |  | ) |
| static

## ◆ setAction()

void uiMenu::setAction | ( | uiAction * |  | ) |
| private

## ◆ setCheckable()

void uiMenu::setCheckable | ( | bool |  | ) |

## ◆ setChecked()

void uiMenu::setChecked | ( | bool |  | ) |

## ◆ setEnabled()

void uiMenu::setEnabled | ( | bool |  | ) |

## ◆ setIcon() [1/2]

void uiMenu::setIcon | ( | const char * | iconnm | ) |

## ◆ setIcon() [2/2]

void uiMenu::setIcon | ( | const uiIcon & |  | ) |

## ◆ setText()

void uiMenu::setText | ( | const uiString & |  | ) |

## ◆ text()

const uiString & uiMenu::text | ( |  | ) | const

## ◆ useStyleSheet()

void uiMenu::useStyleSheet | ( |  | ) |
| private

## Friends And Related Symbol Documentation

## ◆ uiAction

friend class uiAction
| friend

## Member Data Documentation

## ◆ dointercept_

bool uiMenu::dointercept_ = false
| private

## ◆ iconnm_

BufferString uiMenu::iconnm_
| private

## ◆ interceptaction_

uiAction* uiMenu::interceptaction_ = nullptr
| private

## ◆ qmenu_

QMenu* uiMenu::qmenu_
| private

## ◆ submenuaction_

uiAction* uiMenu::submenuaction_ = nullptr
| private

## ◆ text_

uiString uiMenu::text_
| private

Generated at
for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2025