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

Public Functions

(void) - dealloc
 
(void) - doubleClickSelector:
 
(QRectF- geometry
 
(QSystemTrayIcon *) - icon
 
(id) - initWithIcon:iconPrivate:
 
(NSStatusItem *) - item
 
(void) - triggerSelector:button:
 

Protected Variables

QSystemTrayIconicon
 
QSystemTrayIconPrivateiconPrivate
 
QNSImageViewimageCell
 
NSStatusItem * item
 

Detailed Description

Definition at line 102 of file qsystemtrayicon_mac.mm.

Functions

◆ dealloc()

- (void) dealloc

Definition at line 421 of file qsystemtrayicon_mac.mm.

421  {
422  [[NSStatusBar systemStatusBar] removeStatusItem:item];
423  [imageCell release];
424  [item release];
425  [super dealloc];
426 
427 }

◆ doubleClickSelector:()

- (void) doubleClickSelector: (id)  sender

Definition at line 471 of file qsystemtrayicon_mac.mm.

471  :(id)sender {
472  Q_UNUSED(sender);
473  if(!icon)
474  return;
476 }
void qtsystray_sendActivated(QSystemTrayIcon *i, int r)
QSystemTrayIcon * icon()
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ geometry()

- (QRectF) geometry

Definition at line 436 of file qsystemtrayicon_mac.mm.

436  {
437  if(NSWindow *window = [[item view] window]) {
438  NSRect screenRect = [[window screen] frame];
439  NSRect windowRect = [window frame];
440  return QRectF(windowRect.origin.x, screenRect.size.height-windowRect.origin.y-windowRect.size.height, windowRect.size.width, windowRect.size.height);
441  }
442  return QRectF();
443 }
NSWindow * window
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
NSStatusItem * item()

◆ icon()

- (QSystemTrayIcon*) icon

◆ initWithIcon:iconPrivate:()

- (id) initWithIcon: (QSystemTrayIcon*)  icon
iconPrivate: (QSystemTrayIconPrivate *)  iprivate 

Definition at line 409 of file qsystemtrayicon_mac.mm.

410 {
411  self = [super init];
412  if(self) {
413  icon = i;
414  iconPrivate = iPrivate;
415  item = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength] retain];
416  imageCell = [[QT_MANGLE_NAMESPACE(QNSImageView) alloc] initWithParent:self];
417  [item setView: imageCell];
418  }
419  return self;
420 }
QSystemTrayIconPrivate * iconPrivate
NSStatusItem * item()
The QSystemTrayIcon class provides an icon for an application in the system tray. ...
QNSImageView * imageCell

◆ item()

- (NSStatusItem*) item

◆ triggerSelector:button:()

- (void) triggerSelector: (id)  sender
button: (Qt::MouseButton mouseButton 

Definition at line 445 of file qsystemtrayicon_mac.mm.

445  :(id)sender button:(Qt::MouseButton)mouseButton {
446  Q_UNUSED(sender);
447  if (!icon)
448  return;
449 
450  if (mouseButton == Qt::MidButton)
452  else
454 
455  if (icon->contextMenu()) {
456 #ifndef QT_MAC_USE_COCOA
457  [[[self item] view] removeAllToolTips];
459 #endif
460  NSMenu *m = [[QT_MANGLE_NAMESPACE(QNSMenu) alloc] initWithQMenu:icon->contextMenu()];
461  [m setAutoenablesItems: NO];
462  [[NSNotificationCenter defaultCenter] addObserver:imageCell
463  selector:@selector(menuTrackingDone:)
464  name:NSMenuDidEndTrackingNotification
465  object:m];
466  [item popUpStatusItemMenu: m];
467  [m release];
468  }
469 }
void qtsystray_sendActivated(QSystemTrayIcon *i, int r)
QSystemTrayIconPrivate * iconPrivate
QMenu * contextMenu() const
Returns the current context menu for the system tray entry.
QSystemTrayIcon * icon()
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
MouseButton
Definition: qnamespace.h:150

Properties

◆ icon

- (QSystemTrayIcon *) icon
protected

Definition at line 104 of file qsystemtrayicon_mac.mm.

Referenced by QNSImageView::icon.

◆ iconPrivate

- (QSystemTrayIconPrivate*) iconPrivate
protected

Definition at line 105 of file qsystemtrayicon_mac.mm.

◆ imageCell

- (QNSImageView*) imageCell
protected

Definition at line 106 of file qsystemtrayicon_mac.mm.

◆ item

- (NSStatusItem *) item
protected

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