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

Public Functions

(QSystemTrayIcon *) - icon
 
(id) - initWithParent:
 
(void) - menuTrackingDone:
 
(void) - mousePressed:button:
 

Protected Variables

BOOL down
 
QNSStatusItemparent
 

Detailed Description

Definition at line 117 of file qsystemtrayicon_mac.mm.

Functions

◆ icon()

- (QSystemTrayIcon *) icon

Definition at line 314 of file qsystemtrayicon_mac.mm.

314  {
315  return [parent icon];
316 }

◆ initWithParent:()

- (id) initWithParent: (QNSStatusItem *)  myParent

Definition at line 307 of file qsystemtrayicon_mac.mm.

307  :(QT_MANGLE_NAMESPACE(QNSStatusItem)*)myParent {
308  self = [super init];
309  parent = myParent;
310  down = NO;
311  return self;
312 }
QNSStatusItem * parent
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106

◆ menuTrackingDone:()

- (void) menuTrackingDone: (NSNotification*)  notification

Definition at line 318 of file qsystemtrayicon_mac.mm.

318  :(NSNotification*)notification
319 {
320  Q_UNUSED(notification);
321  down = NO;
322 
323  if( ![self icon]->icon().isNull() ) {
324 #ifndef QT_MAC_USE_COCOA
325  const short scale = GetMBarHeight()-4;
326 #else
327  CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight];
328  const short scale = hgt - 4;
329 #endif
330  NSImage *nsimage = static_cast<NSImage *>(qt_mac_create_nsimage([self icon]->icon().pixmap(QSize(scale, scale))));
331  [self setImage: nsimage];
332  [nsimage release];
333  }
334 
335  if([self icon]->contextMenu())
336  [self icon]->contextMenu()->hide();
337 
338  [self setNeedsDisplay:YES];
339 }
void * qt_mac_create_nsimage(const QPixmap &pm)
QSystemTrayIcon * icon()
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
#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
static bool isNull(const QVariant::Private *d)
Definition: qvariant.cpp:300
float CGFloat

◆ mousePressed:button:()

- (void) mousePressed: (NSEvent *)  mouseEvent
button: (Qt::MouseButton mouseButton 

Definition at line 341 of file qsystemtrayicon_mac.mm.

341  :(NSEvent *)mouseEvent button:(Qt::MouseButton)mouseButton
342 {
343  down = YES;
344  int clickCount = [mouseEvent clickCount];
345  [self setNeedsDisplay:YES];
346 
347 #ifndef QT_MAC_USE_COCOA
348  const short scale = GetMBarHeight()-4;
349 #else
350  CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight];
351  const short scale = hgt - 4;
352 #endif
353 
354  if (![self icon]->icon().isNull() ) {
355  NSImage *nsaltimage = static_cast<NSImage *>(qt_mac_create_nsimage([self icon]->icon().pixmap(QSize(scale, scale), QIcon::Selected)));
356  [self setImage: nsaltimage];
357  [nsaltimage release];
358  }
359 
360  if ((clickCount == 2)) {
361  [self menuTrackingDone:nil];
362  [parent doubleClickSelector:self];
363  } else {
364  [parent triggerSelector:self button:mouseButton];
365  }
366 }
void * qt_mac_create_nsimage(const QPixmap &pm)
QSystemTrayIcon * icon()
static void mouseEvent(MouseAction action, QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1)
Definition: qtestmouse.h:71
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
static bool isNull(const QVariant::Private *d)
Definition: qvariant.cpp:300
float CGFloat
MouseButton
Definition: qnamespace.h:150

Properties

◆ down

- (BOOL) down
protected

Definition at line 118 of file qsystemtrayicon_mac.mm.

◆ parent

- (QNSStatusItem*) parent
protected

Definition at line 119 of file qsystemtrayicon_mac.mm.

Referenced by icon.


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