本文整理汇总了C++中iconActivated函数的典型用法代码示例。如果您正苦于以下问题:C++ iconActivated函数的具体用法?C++ iconActivated怎么用?C++ iconActivated使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了iconActivated函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QDialog
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
trayIcon = new QSystemTrayIcon(this);
connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
connect(ui->exit_button, SIGNAL(clicked(bool)),qApp,SLOT(quit()));
trayIcon->setIcon(QIcon(":image/bad.png"));
trayIcon->show();
trayIcon->showMessage(QTime::currentTime().toString(),"Time over!");
time = new QTime();
//ui->tableView->setVerticalHeader("Hello");
//ui->tableView->setRowCount(10);
//ui->tableView->setColumnCount(3);
//ui->tableView->set
const int WDGT_WIDTH = 271;
ui->tableWidget->setColumnWidth(0,WDGT_WIDTH/3);
ui->tableWidget->setColumnWidth(1,WDGT_WIDTH/3);
ui->tableWidget->setColumnWidth(2,WDGT_WIDTH/3);
}
示例2: createMessageGroupBox
Window::Window()
{
QDialog::setWindowFlags(Qt::WindowStaysOnTopHint| Qt::WindowCloseButtonHint | Qt::Tool);
stop = false;
createMessageGroupBox();
createActions();
createTrayIcon();
connect(StartButton, SIGNAL(clicked()), this, SLOT(startPing()));
connect(StopButton, SIGNAL(clicked()), this, SLOT(stopPing()));
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(messageGroupBox);
setLayout(mainLayout);
setWindowTitle(tr("Pinger v.1.2"));
resize(215, 100);
QIcon icon = QIcon(":/images/trash.svg");
trayIcon->setIcon(icon);
setWindowIcon(icon);
trayIcon->show();
trayIcon->setToolTip(tr("Pinger v.1.2"));
setVisible(true);
}
示例3: switch
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QDialog::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: displayError((*reinterpret_cast< QAbstractSocket::SocketError(*)>(_a[1]))); break;
case 1: connectedChannel(); break;
case 2: disconnectedChannel(); break;
case 3: readTxChannel(); break;
case 4: readRxChannel(); break;
case 5: refreshCount(); break;
case 6: iconActivated((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break;
case 7: setIcon((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 8: save(); break;
case 9: start(); break;
case 10: stop(); break;
case 11: install(); break;
case 12: uninstall(); break;
default: ;
}
_id -= 13;
}
return _id;
}
示例4: QDialog
DistributorDialog::DistributorDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::DistributorDialog)
{
ui->setupUi(this);
QString appData(getenv("APPDATA"));
dataFileName = appData.append("\\FileDistributor\\settings.dat");
copier = new Copier();
copier->moveToThread(&workerThread);
dirsModel = new QStringListModel(copier->getDestDirs(), this);
load();
icon = new QSystemTrayIcon(QIcon(":/res/FD.ico"), this);
iconMenu = new QMenu(this);
iconMenu->addAction("Settings", this, SLOT(show()));
iconMenu->addSeparator();
iconMenu->addAction("Close", this, SLOT(quit()));
icon->setContextMenu(iconMenu);
icon->show();
displayMessage("", "FileDistributor is running");
timer = new QTimer(this);
connect(icon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
connect(ui->saveButton, SIGNAL(clicked()), this, SLOT(save()));
connect(ui->sourceDirBrowse, SIGNAL(clicked()), this, SLOT(browse()));
connect(ui->addDirB, SIGNAL(clicked()), this, SLOT(addDest()));
connect(ui->removeDirB, SIGNAL(clicked()), this, SLOT(removeDest()));
connect(timer, SIGNAL(timeout()), copier, SLOT(startCopy()));
connect(this, SIGNAL(startCopy()), copier, SLOT(startCopy()));
connect(copier, SIGNAL(copyStarted()), this, SLOT(copyStarted()));
workerThread.start();
emit startCopy();
timer->start(1000*copier->getRefreshRateSeconds());
}
示例5: m_icon
Window::Window()
: m_icon(":/images/justlock.png"), m_logFiles(), m_logStreams(), m_fileWatcher(0),
m_maxRows(5), m_rowCount(0), m_warningIcon(":/images/trianglewarning.png")
{
loadPreferences(true);
createLogWidgets();
createActions();
createTrayIcon();
createMenus();
QWidget *widget = new QWidget();
widget->setLayout(m_topLayout);
setCentralWidget(widget);
createRegexps();
// setup the tray icon
trayIcon->setToolTip(tr("Shows the status of DNSSEC Requests on the system"));
trayIcon->setIcon(m_icon);
setWindowIcon(m_icon);
connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
trayIcon->show();
setWindowTitle(tr("DNSSEC Log Messages"));
}
示例6: QAction
void ATMainWindow_c::createTrayIcon()
{
QAction *aboutAction = new QAction(tr("&About..."), this);
ATVERIFY( connect(aboutAction, SIGNAL(triggered()), this, SLOT(slotShowAbout())) );
QAction *restoreAction = new QAction(tr("&Restore"), this);
ATVERIFY( connect(restoreAction, SIGNAL(triggered()), this, SLOT(showNormal())) );
QAction *quitAction = new QAction(tr("&Quit"), this);
ATVERIFY( connect(quitAction, SIGNAL(triggered()), this, SLOT(slotTentativeQuit())) );
m_trayIconMenu = new QMenu( this );
m_trayIconMenu->addAction(aboutAction);
m_trayIconMenu->addAction(restoreAction);
m_trayIconMenu->addAction(quitAction);
m_trayIcon = new QSystemTrayIcon( this );
m_trayIcon->setContextMenu( m_trayIconMenu );
m_trayIcon->setIcon( m_iconDisconnected );
m_trayIcon->show();
ATVERIFY( connect( m_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason))) );
ATVERIFY( connect(m_pMainWindow, SIGNAL(signalSetTrayIcon(int)), this, SLOT(slotSetTrayIcon(int))) );
}
示例7: QSystemTrayIcon
void widget::createSystemTrayIcon()
{
trayIcon = new QSystemTrayIcon(this);
trayIcon->setIcon(QIcon(tr(":/images/myIcon.ico")));
trayIcon->setToolTip("阁楼音乐 - 音乐播放器");
restoreAction = new QAction(tr("打开主面板"), this);
connect(restoreAction, SIGNAL(triggered()), this, SLOT(show()));
quitAction=new QAction(tr("退出"), this);
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
trayContextMenu=new QMenu(this);
playModeMenu->setTitle("播放模式");
trayContextMenu->addMenu(playModeMenu);
trayContextMenu->addSeparator();
trayContextMenu->addAction(ui->action_About);
trayContextMenu->addSeparator();
trayContextMenu->addAction(restoreAction);
trayContextMenu->addAction(quitAction);
trayIcon->setContextMenu(trayContextMenu);
trayIcon->show();
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), \
this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
}
示例8: CustomTrayIcon
void Window::createTrayIcon()
{
tray = new CustomTrayIcon(this);
setWindowIcon(tray->icon());
connect(tray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
}
示例9: QMainWindow
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow),
lastChanged(false), lastNetworkChanged(true)
{
ui->setupUi(this);
createActions();
createTrayIcon();
statusLabel = new QLabel(this);
ui->statusBar->addWidget(statusLabel, 1);
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
connect(&arpWatcher, SIGNAL(routeUpdated()), this,
SLOT(routeUpdated()));
connect(&arpWatcher, SIGNAL(networkChanged(bool)), this,
SLOT(networkChanged(bool)));
connect(&arpWatcher, SIGNAL(changeDetected(bool)), this,
SLOT(changeDetected(bool)));
connect(&arpWatcher, SIGNAL(newCheck(QString,QString,QString)),
this, SLOT(newCheck(QString,QString,QString)));
setIcon("trash", QApplication::applicationName());
trayIcon->show();
/* To show the set-up on start */
routeUpdated();
arpWatcher.start();
}
示例10: QWidget
MainWidget::MainWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::MainWidget),
ts(new RectSelector),
maximizedState(false)
{
ui->setupUi(this);
QVector<QPushButton*> modeButtons;
modeButtons.push_back(ui->mode0Button);
modeButtons.push_back(ui->mode1Button);
modeBox = new ModeBox(modeButtons);
createActions();
createTrayIcon();
windowVisibility = true;
loadSettings();
//storePositionInfo();
connect(this, SIGNAL(setPixmap(QPixmap)), ts, SLOT(loadBackgroundPixmap(QPixmap)));
connect(ts, SIGNAL(finishPixmap(QPixmap)), this, SLOT(triangleReceiver(QPixmap)));
connect(ts, SIGNAL(quitPixmap()), this, SLOT(triangleReceiver()));
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
shootFullScreen();
updateScreenshotLabel();
}
示例11: QMainWindow
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
d(new MainWindow_private(this))
{
g_pMainGuiWindow = this;
//createDockWindows();
createActions();
createMenus();
//createToolBars();
//createStatusBar();
setCentralWidget(d->m_canvasWidget);
#ifdef DEBUG
setWindowTitle(QString(APPLICATION_NAME) + "-" + QString(APP_FULL_VERSION_TAG) + " (" + QString(APP_DATE) +")");
#else
setWindowTitle(QString(APPLICATION_NAME) + "-" + QString(APP_SHORT_VERSION_TAG));
#endif //DEBUG
setWindowIcon(QIcon(":/icons/semaphored.svg"));
d->m_pTrayIcon = new QSystemTrayIcon(QIcon(":/icons/semaphored.svg"),this);
connect(this, SIGNAL(signalPlaceToTray()),this, SLOT(slotPlaceToTray()),Qt::QueuedConnection);
connect(d->m_pTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
d->m_pTrayIcon->show();
}
示例12: QMainWindow
QMainWindowTray::QMainWindowTray(QWidget *parent) :
QMainWindow(parent)
, icon_online(QIcon (":/resources/icon-online.svg"))
, icon_offline(QIcon (":/resources/icon-offline.svg"))
, icon_unread(QIcon (":/resources/icon-unread.svg"))
{
#if not __ANDROID__
if (QSystemTrayIcon::isSystemTrayAvailable()) {
createActions();
createTrayIcon();
setMainWindowIcon();
connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
trayIcon->setIcon(QIcon(":/resources/icon-offline.svg"));
trayIcon->setToolTip(tr("Vcrypt messanger"));
trayIcon->show();
}
qDebug() << "windows state: " << 0 + windowState();
#endif
}
示例13: switch
int Buddies::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QMainWindow::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: countOnlineUsers(); break;
case 1: setUserStatus(); break;
case 2: loginUser(); break;
case 3: loginCurrentStatus(); break;
case 4: validateUser(); break;
case 5: stopifNotConnected(); break;
case 6: myexit(); break;
case 7: focusTabEdit(); break;
case 8: structUser(); break;
case 9: startChat(); break;
case 10: helpAbout(); break;
case 11: getSysInfo(); break;
case 12: onlineNotify(); break;
case 13: WriteOnWall(); break;
case 14: Information(); break;
case 15: dbstatus(); break;
case 16: openNotes(); break;
case 17: setIcon((*reinterpret_cast< int(*)>(_a[1]))); break;
case 18: iconActivated((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break;
case 19: messageClicked(); break;
case 20: showMessage(); break;
}
_id -= 21;
}
return _id;
}
示例14: createIconGroupBox
//! [0]
Window::Window()
{
createIconGroupBox();
createMessageGroupBox();
iconLabel->setMinimumWidth(durationLabel->sizeHint().width());
createActions();
createTrayIcon();
connect(showMessageButton, SIGNAL(clicked()), this, SLOT(showMessage()));
connect(showIconCheckBox, SIGNAL(toggled(bool)), trayIcon, SLOT(setVisible(bool)));
connect(iconComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setIcon(int)));
connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(iconGroupBox);
mainLayout->addWidget(messageGroupBox);
setLayout(mainLayout);
iconComboBox->setCurrentIndex(1);
trayIcon->show();
setWindowTitle(tr("Systray"));
resize(400, 300);
}
示例15: QObject
Systray::Systray(QObject *parent) : QObject(parent)
{
s.setEmptyToDefaults();
createActions();
createTrayIcon();
connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
connect(trayIcon,
SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this,
SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
setTrayIcon(":/images/puush-qt.png");
trayIcon->show();
trayIcon->setToolTip("puush-qt");
history = new History();
connect(history,
SIGNAL(historyDone(QList<ApiHist::HistData>)), this,
SLOT(updateHistoryMenu(QList<ApiHist::HistData>)));
// Get the history after the app starts. For some reason the context
// menu hangs when getting the history, even though it's asynchronous.
// So just call it soon (waiting for wifi or something to come up after starting on boot...).
updateHistoryAfterTimeout();
}