|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QSystemTrayIcon
public class QSystemTrayIcon
The QSystemTrayIcon
class provides an icon for an application in the system tray. Modern operating systems usually provide a special area on the desktop, called the system tray or notification area, where long-running applications can display icons and short messages.
QSystemTrayIcon
class can be used on the following platforms: QSystemTrayIcon::showMessage()
to display messages.QSystemTrayIcon::isSystemTrayAvailable()
static function. To add a system tray entry, create a QSystemTrayIcon
object, call setContextMenu()
to provide a context menu for the icon, and call show()
to make it visible in the system tray. Status notification messages ("balloon messages") can be displayed at any time using showMessage()
.
If the system tray is unavailable when a system tray icon is constructed, but becomes available later, QSystemTrayIcon
will automatically add an entry for the application in the system tray if the icon is visible
.
The activated()
signal is emitted when the user activates the icon.
Only on X11, when a tooltip is requested, the QSystemTrayIcon
receives a QHelpEvent
of type QEvent::ToolTip
. Additionally, the QSystemTrayIcon
receives wheel events of type QEvent::Wheel
. These are not supported on any other platform.
QDesktopServices
, QDesktopWidget
, Desktop Integration, and System Tray Icon Example.
Nested Class Summary | |
---|---|
static class |
QSystemTrayIcon.ActivationReason
This enum describes the reason the system tray was activated. |
static class |
QSystemTrayIcon.MessageIcon
This enum describes the icon that is shown when a balloon message is displayed. |
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary | |
---|---|
QSignalEmitter.Signal1 |
activated
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal0 |
messageClicked
This signal is emitted when the message displayed using showMessage() was clicked by the user. |
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Constructor Summary | |
---|---|
QSystemTrayIcon()
Constructs a QSystemTrayIcon object with the given parent. |
|
QSystemTrayIcon(QIcon icon)
Constructs a QSystemTrayIcon object with the given icon and parent. |
|
QSystemTrayIcon(QIcon icon,
QObject parent)
Constructs a QSystemTrayIcon object with the given icon and parent. |
|
QSystemTrayIcon(QObject parent)
Constructs a QSystemTrayIcon object with the given parent. |
Method Summary | |
---|---|
QMenu |
contextMenu()
Returns the current context menu for the system tray entry. |
QRect |
geometry()
Returns the geometry of the system tray icon in screen coordinates. |
void |
hide()
Hides the system tray entry. |
QIcon |
icon()
This property holds the system tray icon. |
static boolean |
isSystemTrayAvailable()
Returns true if the system tray is available; otherwise returns false. |
boolean |
isVisible()
This property holds whether the system tray entry is visible. |
void |
setContextMenu(QMenu menu)
Sets the specified menu to be the context menu for the system tray icon. |
void |
setIcon(QIcon icon)
This property holds the system tray icon. |
void |
setToolTip(java.lang.String tip)
This property holds the tooltip for the system tray entry. |
void |
setVisible(boolean visible)
This property holds whether the system tray entry is visible. |
void |
show()
Shows the icon in the system tray. |
void |
showMessage(java.lang.String title,
java.lang.String msg)
Shows a balloon message for the entry with the given title, message and icon for the time specified in millisecondsTimeoutHint. |
void |
showMessage(java.lang.String title,
java.lang.String msg,
QSystemTrayIcon.MessageIcon icon)
Shows a balloon message for the entry with the given title, message and icon for the time specified in millisecondsTimeoutHint. |
void |
showMessage(java.lang.String title,
java.lang.String msg,
QSystemTrayIcon.MessageIcon icon,
int msecs)
Shows a balloon message for the entry with the given title, message and icon for the time specified in millisecondsTimeoutHint. |
static boolean |
supportsMessages()
Returns true if the system tray supports balloon messages; otherwise returns false. |
java.lang.String |
toolTip()
This property holds the tooltip for the system tray entry. |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Field Detail |
---|
public final QSignalEmitter.Signal1 activated
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <com.trolltech.qt.gui.QSystemTrayIcon$ActivationReason(named: reason)>:
This signal is emitted when the user activates the system tray icon. reason specifies the reason for activation. QSystemTrayIcon::ActivationReason
enumerates the various reasons.
QSystemTrayIcon::ActivationReason
.
public final QSignalEmitter.Signal0 messageClicked
showMessage()
was clicked by the user. activated()
.
Constructor Detail |
---|
public QSystemTrayIcon()
QSystemTrayIcon
object with the given parent. The icon is initially invisible.
visible
.
public QSystemTrayIcon(QObject parent)
QSystemTrayIcon
object with the given parent. The icon is initially invisible.
visible
.
public QSystemTrayIcon(QIcon icon)
QSystemTrayIcon
object with the given icon and parent. The icon is initially invisible.
visible
.
public QSystemTrayIcon(QIcon icon, QObject parent)
QSystemTrayIcon
object with the given icon and parent. The icon is initially invisible.
visible
.
Method Detail |
---|
public final QMenu contextMenu()
setContextMenu()
.
public final QRect geometry()
visible
.
public final void hide()
show()
, and visible
.
public final QIcon icon()
public final boolean isVisible()
show()
makes the system tray icon visible; setting this property to false or calling hide()
hides it.
public final void setContextMenu(QMenu menu)
The menu will pop up when the user requests the context menu for the system tray icon by clicking the mouse button.
On Mac OS X, this is currenly converted to a NSMenu, so the aboutToHide() signal is not emitted.
Note: The system tray icon does not take ownership of the menu. You must ensure that it is deleted at the appropriate time by, for example, creating the menu with a suitable parent object.
contextMenu()
.
public final void setIcon(QIcon icon)
public final void setToolTip(java.lang.String tip)
public final void setVisible(boolean visible)
show()
makes the system tray icon visible; setting this property to false or calling hide()
hides it.
public final void show()
hide()
, and visible
.
public final void showMessage(java.lang.String title, java.lang.String msg, QSystemTrayIcon.MessageIcon icon)
Message can be clicked by the user; the messageClicked()
signal will emitted when this occurs.
Note that display of messages are dependent on the system configuration and user preferences, and that messages may not appear at all. Hence, it should not be relied upon as the sole means for providing critical information.
On Windows, the millisecondsTimeoutHint is usually ignored by the system when the application has focus.
show()
, and supportsMessages()
.
public final void showMessage(java.lang.String title, java.lang.String msg)
Message can be clicked by the user; the messageClicked()
signal will emitted when this occurs.
Note that display of messages are dependent on the system configuration and user preferences, and that messages may not appear at all. Hence, it should not be relied upon as the sole means for providing critical information.
On Windows, the millisecondsTimeoutHint is usually ignored by the system when the application has focus.
show()
, and supportsMessages()
.
public final void showMessage(java.lang.String title, java.lang.String msg, QSystemTrayIcon.MessageIcon icon, int msecs)
Message can be clicked by the user; the messageClicked()
signal will emitted when this occurs.
Note that display of messages are dependent on the system configuration and user preferences, and that messages may not appear at all. Hence, it should not be relied upon as the sole means for providing critical information.
On Windows, the millisecondsTimeoutHint is usually ignored by the system when the application has focus.
show()
, and supportsMessages()
.
public final java.lang.String toolTip()
public static boolean isSystemTrayAvailable()
If the system tray is currently unavailable but becomes available later, QSystemTrayIcon
will automatically add an entry in the system tray if it is visible
.
public static boolean supportsMessages()
showMessage()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |