Qt 4.8
Public Functions | Protected Variables | List of all members
QNSMenu Class Reference
Inheritance diagram for QNSMenu:

Public Functions

(id) - initWithQMenu:
 
(QMenu *) - menu
 
(void) - selectedAction:
 

Protected Variables

QMenuqmenu
 

Detailed Description

Definition at line 136 of file qsystemtrayicon_mac.mm.

Functions

◆ initWithQMenu:()

- (id) initWithQMenu: (QMenu*)  qmenu

Definition at line 489 of file qsystemtrayicon_mac.mm.

489  :(QMenu*)qm {
490  self = [super init];
491  if(self) {
492  self->qmenu = qm;
493  [self setDelegate:self];
494  }
495  return self;
496 }
The QMenu class provides a menu widget for use in menu bars, context menus, and other popup menus...
Definition: qmenu.h:72

◆ menu()

- (QMenu *) menu

Definition at line 497 of file qsystemtrayicon_mac.mm.

497  {
498  return qmenu;
499 }

◆ selectedAction:()

- (void) selectedAction: (id)  item

Definition at line 563 of file qsystemtrayicon_mac.mm.

563  :(id)a {
564  const int activated = [self indexOfItem:a];
565  QAction *action = 0;
566  QList<QAction*> actions = qmenu->actions();
567  for(int i = 0, cnt = 0; i < actions.size(); ++i) {
568  if(actions.at(i)->isVisible() && (cnt++) == activated) {
569  action = actions.at(i);
570  break;
571  }
572  }
573  if(action) {
574  action->activate(QAction::Trigger);
575  }
576 }
void activate(ActionEvent event)
Sends the relevant signals for ActionEvent event.
Definition: qaction.cpp:1326
long ASN1_INTEGER_get ASN1_INTEGER * a
bool isVisible() const
Definition: qaction.cpp:1246
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QList< QAction * > actions() const
Returns the (possibly empty) list of this widget&#39;s actions.
Definition: qwidget.cpp:3407
The QAction class provides an abstract user interface action that can be inserted into widgets...
Definition: qaction.h:64
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

Properties

◆ qmenu

- (QMenu*) qmenu
protected

Definition at line 137 of file qsystemtrayicon_mac.mm.


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