本文整理汇总了C++中QSystemTrayIcon::showMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ QSystemTrayIcon::showMessage方法的具体用法?C++ QSystemTrayIcon::showMessage怎么用?C++ QSystemTrayIcon::showMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSystemTrayIcon
的用法示例。
在下文中一共展示了QSystemTrayIcon::showMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: popup
/**
* @brief Send a popup through Growl.
* @param icon The icon inside the notification. Currently ignored.
* @param timeout The time in ms to show the notification.
* @param title The title displayed inside the notification.
* @param message The message displayed inside the notification.
*/
void NotifyByPopupGrowl::popup( const QPixmap *icon, int timeout,
const QString &title, const QString &message )
{
Q_UNUSED( icon );
QSystemTrayIcon i;
i.show();
i.showMessage( title, message,
QSystemTrayIcon::Information, timeout );
i.hide();
}
示例2: showMessage
// Testing get/set functions
void tst_QSystemTrayIcon::showMessage()
{
QSystemTrayIcon icon;
icon.setIcon(QIcon("icons/icon.png"));
icon.showMessage("Title", "Messagecontents");
icon.showMessage("Title", "Messagecontents", QSystemTrayIcon::NoIcon);
icon.showMessage("Title", "Messagecontents", QSystemTrayIcon::Warning);
icon.showMessage("Title", "Messagecontents", QSystemTrayIcon::Critical);
icon.show();
icon.showMessage("Title", "Messagecontents");
icon.showMessage("Title", "Messagecontents", QSystemTrayIcon::NoIcon);
icon.showMessage("Title", "Messagecontents", QSystemTrayIcon::Warning);
icon.showMessage("Title", "Messagecontents", QSystemTrayIcon::Critical);
}
示例3: showMessage
void CNotificationManager::showMessage(QString title, QString message, QObject * reciever, const char * slot, CUIDevice * uiDevice) {
if (!m_NotificationsEnabled)
return;
QString titleResult = tr("QNUT");
QSystemTrayIcon * trayIcon;
if (uiDevice && m_UIDeviceIcons.contains(uiDevice) && m_UIDeviceIcons[uiDevice]->isVisible()) {
trayIcon = m_UIDeviceIcons[uiDevice];
titleResult += " (" + uiDevice->device()->getName() + ')';
}
else
trayIcon = m_MainIcon;
if (!title.isEmpty())
titleResult += " - " + title;
disconnect(trayIcon, SIGNAL(messageClicked()), NULL, NULL);
if (reciever)
connect(trayIcon, SIGNAL(messageClicked()), reciever, slot);
trayIcon->showMessage(titleResult, message, QSystemTrayIcon::Information, 4000);
}