Qt 4.8
Classes | Macros | Functions
qsystemtrayicon_mac.mm File Reference
#include <private/qt_cocoa_helpers_mac_p.h>
#include <private/qsystemtrayicon_p.h>
#include <qtemporaryfile.h>
#include <qimagewriter.h>
#include <qapplication.h>
#include <qdebug.h>
#include <qstyle.h>
#include <private/qt_mac_p.h>
#import <AppKit/AppKit.h>

Go to the source code of this file.

Classes

protocol  <NSMenuDelegate >
 
class  QNSImageView
 
class  QNSMenu
 
class  QNSStatusItem
 
class  QSystemTrayIconQMenu
 
class  QSystemTrayIconSys
 

Macros

#define QT_MAC_SYSTEMTRAY_USE_GROWL
 

Functions

Qt::MouseButton cocoaButton2QtButton (NSInteger buttonNum)
 
NSUInteger keySequenceModifierMask (const QKeySequence &accel)
 
NSString * keySequenceToKeyEqivalent (const QKeySequence &accel)
 
bool qt_mac_execute_apple_script (const QString &script, AEDesc *ret)
 
void qtsystray_sendActivated (QSystemTrayIcon *i, int r)
 

Macro Definition Documentation

◆ QT_MAC_SYSTEMTRAY_USE_GROWL

#define QT_MAC_SYSTEMTRAY_USE_GROWL

Definition at line 76 of file qsystemtrayicon_mac.mm.

Function Documentation

◆ cocoaButton2QtButton()

Qt::MouseButton cocoaButton2QtButton ( NSInteger  buttonNum)

Definition at line 797 of file qt_cocoa_helpers_mac.mm.

Referenced by flipPoint().

798 {
799  if (buttonNum == 0)
800  return Qt::LeftButton;
801  if (buttonNum == 1)
802  return Qt::RightButton;
803  if (buttonNum == 2)
804  return Qt::MidButton;
805  if (buttonNum == 3)
806  return Qt::XButton1;
807  if (buttonNum == 4)
808  return Qt::XButton2;
809  return Qt::NoButton;
810 }

◆ keySequenceModifierMask()

NSUInteger keySequenceModifierMask ( const QKeySequence accel)

Definition at line 1265 of file qmenu_mac.mm.

Referenced by QMenuPrivate::QMacMenuPrivate::syncAction().

1266 {
1267  return constructModifierMask(accel[0]);
1268 }
static quint32 constructModifierMask(quint32 accel_key)
Definition: qmenu_mac.mm:145

◆ keySequenceToKeyEqivalent()

NSString* keySequenceToKeyEqivalent ( const QKeySequence accel)

Definition at line 1254 of file qmenu_mac.mm.

Referenced by QMenuPrivate::QMacMenuPrivate::syncAction().

1255 {
1256  quint32 accel_key = (accel[0] & ~(Qt::MODIFIER_MASK | Qt::UNICODE_ACCEL));
1257  extern QChar qtKey2CocoaKey(Qt::Key key);
1258  QChar cocoa_key = qtKey2CocoaKey(Qt::Key(accel_key));
1259  if (cocoa_key.isNull())
1260  cocoa_key = QChar(accel_key).toLower().unicode();
1261  return [NSString stringWithCharacters:&cocoa_key.unicode() length:1];
1262 }
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251
bool isNull() const
Returns true if the character is the Unicode character 0x0000 (&#39;\0&#39;); otherwise returns false...
Definition: qchar.h:262
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
int key
unsigned int quint32
Definition: qglobal.h:938
QChar qtKey2CocoaKey(Qt::Key key)
QChar toLower() const
Returns the lowercase equivalent if the character is uppercase or titlecase; otherwise returns the ch...
Definition: qchar.cpp:1239

◆ qt_mac_execute_apple_script()

bool qt_mac_execute_apple_script ( const QString script,
AEDesc *  ret 
)

Definition at line 346 of file qapplication_mac.mm.

Referenced by QSystemTrayIconPrivate::showMessage_sys().

347 {
348  const QByteArray l = script.toUtf8(); return qt_mac_execute_apple_script(l.constData(), l.size(), ret);
349 }
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
Definition: qstring.cpp:4074
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
QFactoryLoader * l
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402
Q_GUI_EXPORT bool qt_mac_execute_apple_script(const char *script, long script_len, AEDesc *ret)

◆ qtsystray_sendActivated()

void qtsystray_sendActivated ( QSystemTrayIcon i,
int  r 
)

Definition at line 703 of file qsystemtrayicon.cpp.

704 {
706 }
void activated(QSystemTrayIcon::ActivationReason reason)
This signal is emitted when the user activates the system tray icon.
#define emit
Definition: qobjectdefs.h:76
ActivationReason
This enum describes the reason the system tray was activated.