当前位置: 首页>>代码示例>>C++>>正文


C++ QSystemTrayIcon::showMessage方法代码示例

本文整理汇总了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();
}
开发者ID:KDE,项目名称:kde-runtime,代码行数:18,代码来源:notifybypopupgrowl.cpp

示例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);
}
开发者ID:husninazer,项目名称:qt,代码行数:17,代码来源:tst_qsystemtrayicon.cpp

示例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);
	}
开发者ID:stbuehler,项目名称:nut,代码行数:21,代码来源:cnotificationmanager.cpp


注:本文中的QSystemTrayIcon::showMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。