• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ iconActivated函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中iconActivated函数的典型用法代码示例。如果您正苦于以下问题:C++ iconActivated函数的具体用法?C++ iconActivated怎么用?C++ iconActivated使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了iconActivated函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:scientistnik,项目名称:wakeup,代码行数:30,代码来源:dialog.cpp


示例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);
}
开发者ID:gotlium,项目名称:pinger,代码行数:29,代码来源:window.cpp


示例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;
}
开发者ID:bxxbht,项目名称:Github,代码行数:26,代码来源:moc_mainwindow.cpp


示例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());
}
开发者ID:username115,项目名称:FileDistributor,代码行数:35,代码来源:distributordialog.cpp


示例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"));
}
开发者ID:hardaker,项目名称:dnssec-tools,代码行数:29,代码来源:dnssec-system-tray.cpp


示例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))) );
}
开发者ID:elnat,项目名称:eztunnelssh,代码行数:26,代码来源:ATMainWindow.cpp


示例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)));
}
开发者ID:UndertakerMouni,项目名称:AtticMusic,代码行数:26,代码来源:widget.cpp


示例8: CustomTrayIcon

void Window::createTrayIcon()
{
    tray = new CustomTrayIcon(this);
    setWindowIcon(tray->icon());
    connect(tray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
}
开发者ID:7omate,项目名称:pydio-sync-ui,代码行数:7,代码来源:window.cpp


示例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();
}
开发者ID:y0ug,项目名称:QArpWatch,代码行数:34,代码来源:mainwindow.cpp


示例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();
}
开发者ID:SunRunAway,项目名称:AprilShot,代码行数:29,代码来源:mainwidget.cpp


示例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();
}
开发者ID:safrm,项目名称:semaphored,代码行数:25,代码来源:mainwindow.cpp


示例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
}
开发者ID:vcryptfoundation,项目名称:vcrypt,代码行数:25,代码来源:qmainwindowtray.cpp


示例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;
}
开发者ID:ioannisb,项目名称:Buddies-1.10,代码行数:33,代码来源:moc_buddies.cpp


示例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);
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:29,代码来源:window.cpp


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


示例16: switch

int Widget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: mySignal(); break;
        case 1: on_toolButton_List_clicked((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 2: tableWidget_cellDoubleClicked((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 3: on_toolButton_lrcD_clicked((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 4: on_toolButton_next_clicked(); break;
        case 5: on_toolButton_stop_clicked(); break;
        case 6: on_toolButton_playpause_clicked(); break;
        case 7: on_toolButton_previous_clicked(); break;
        case 8: on_toolButton_open_clicked(); break;
        case 9: showTime((*reinterpret_cast< qint64(*)>(_a[1]))); break;
        case 10: Timeout(); break;
        case 11: musicInformationStateChanged((*reinterpret_cast< Phonon::State(*)>(_a[1])),(*reinterpret_cast< Phonon::State(*)>(_a[2]))); break;
        case 12: mediaObjectStateChanged((*reinterpret_cast< Phonon::State(*)>(_a[1])),(*reinterpret_cast< Phonon::State(*)>(_a[2]))); break;
        case 13: musicAboutToFinish(); break;
        case 14: currentMusicSourceChanged((*reinterpret_cast< Phonon::MediaSource(*)>(_a[1]))); break;
        case 15: removeSlot(); break;
        case 16: exitSlot(); break;
        case 17: iconActivated((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 18;
    }
    return _id;
}
开发者ID:leenetworks,项目名称:qt,代码行数:31,代码来源:moc_widget.cpp


示例17: QMainWindow

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    this->initGlobaShortcut();
    trayIcon = new QSystemTrayIcon(this);

    createActions();
    createTrayIcon();

    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));



    QIcon icon = QIcon(":/images/icon.svg");

    trayIcon->setIcon(icon);
    trayIcon->show();

    this->setWindowIcon(icon);
    setWindowTitle(trUtf8("quteNote"));

    this->setTreeNode();

    QSet<QString> set;
}
开发者ID:romulka,项目名称:quteNote,代码行数:28,代码来源:mainwindow.cpp


示例18: QMenu

void radeon_profile::setupTrayIcon() {
    trayMenu = new QMenu(this);
    setWindowState(Qt::WindowMinimized);
    //close //
    closeApp = new QAction(trayMenu);
    closeApp->setText(tr("Quit"));
    connect(closeApp,SIGNAL(triggered()),this,SLOT(closeFromTray()));

    // standard profiles
    changeProfile = new QAction(trayMenu);
    changeProfile->setText(tr("Change standard profile"));
    connect(changeProfile,SIGNAL(triggered()),this,SLOT(on_chProfile_clicked()));

    // refresh when hidden
    refreshWhenHidden = new QAction(trayMenu);
    refreshWhenHidden->setCheckable(true);
    refreshWhenHidden->setChecked(true);
    refreshWhenHidden->setText(tr("Keep refreshing when hidden"));

    // dpm menu //
    dpmMenu = new QMenu(this);
    dpmMenu->setTitle(tr("DPM"));

    dpmSetBattery = new QAction(dpmMenu);
    dpmSetBalanced = new QAction(dpmMenu);
    dpmSetPerformance = new QAction(dpmMenu);

    dpmSetBattery->setText(tr("Battery"));
    dpmSetBattery->setIcon(QIcon(":/icon/symbols/arrow1.png"));
    dpmSetBalanced->setText(tr("Balanced"));
    dpmSetBalanced->setIcon(QIcon(":/icon/symbols/arrow2.png"));
    dpmSetPerformance->setText(tr("Performance"));
    dpmSetPerformance->setIcon(QIcon(":/icon/symbols/arrow3.png"));

    connect(dpmSetBattery,SIGNAL(triggered()),this,SLOT(on_btn_dpmBattery_clicked()));
    connect(dpmSetBalanced,SIGNAL(triggered()),this, SLOT(on_btn_dpmBalanced_clicked()));
    connect(dpmSetPerformance,SIGNAL(triggered()),this,SLOT(on_btn_dpmPerformance_clicked()));

    dpmMenu->addAction(dpmSetBattery);
    dpmMenu->addAction(dpmSetBalanced);
    dpmMenu->addAction(dpmSetPerformance);
    dpmMenu->addSeparator();
    dpmMenu->addMenu(forcePowerMenu);

    // add stuff above to menu //
    trayMenu->addAction(refreshWhenHidden);
    trayMenu->addSeparator();
    trayMenu->addAction(changeProfile);
    trayMenu->addMenu(dpmMenu);
    trayMenu->addSeparator();
    trayMenu->addAction(closeApp);

    // setup icon finally //
    QIcon appicon(":/icon/extra/radeon-profile.png");
    trayIcon = new QSystemTrayIcon(appicon,this);
    trayIcon->show();
    trayIcon->setContextMenu(trayMenu);
    connect(trayIcon,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),this,SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
}
开发者ID:Danysan1,项目名称:radeon-profile,代码行数:59,代码来源:uiElements.cpp


示例19: QMainWindow

Buddies::Buddies(QWidget *parent)
    : QMainWindow(parent)
{
	ui.setupUi(this);
	getSysInfo();
	createIconGroupBox();
	createActions();
	createTrayIcon();
	countOnlineUsers();




    QTimer * counter = new QTimer( this );
    connect( counter, SIGNAL(timeout()),
	             this, SLOT(structUser()) );
	counter->start( 3000 );
	qDebug("=> Starting timer 1sec interval...");






	//connect(ui.sendBtn, SIGNAL(clicked()), this, SLOT(showMessage()));
	// connect(ui.showIconCheckBox, SIGNAL(toggled(bool)), trayIcon, SLOT(setVisible(bool)));
    connect(ui.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)));

	ui.iconComboBox->setCurrentIndex(1);

	trayIcon->show();

	setWindowTitle(tr("Buddies"));
	//resize(400, 300);


	ui.listWidget->setIconSize(QSize(40, 40));

	//showMessage();

//-- timer 5 min for online Users Baloon

	QTimer * onlinetimer = new QTimer( this );
		    connect( onlinetimer, SIGNAL(timeout()),
			             this, SLOT(onlineNotify()) );
			onlinetimer->start( 300000 );
			qDebug("=> Starting timer 5min interval...");

//-- Information on Edit Tab

			Information();
//-- Database status
			dbstatus();

}
开发者ID:ioannisb,项目名称:Buddies-1.10,代码行数:58,代码来源:buddies.cpp


示例20: QErrorMessage

//------------------------------------------------------------------------------------------------
//################################################################################################
//------------------------------------------------------------------------------------------------
Window::Window()
{
    errorMessage = new QErrorMessage(this);

    createTabs();

    createActions();
    createTrayIcon();

    connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(tabs);

    QHBoxLayout *bl = new QHBoxLayout;

    quitButton = new QPushButton(QIcon(":/images/door-open-out.png"), tr("Quit"));
    quitButton->setAutoDefault(false);
    quitButton->setFocusPolicy(Qt::NoFocus);
    connect(quitButton, SIGNAL(clicked()), this, SLOT(quitApp()));
    bl->addWidget(quitButton, 0, Qt::AlignLeft);

    aboutButton = new QPushButton(QIcon(":/images/question-balloon.png"), tr("About"));
    aboutButton->setAutoDefault(false);
    aboutButton->setFocusPolicy(Qt::NoFocus);
    connect(aboutButton, SIGNAL(clicked()), this, SLOT(about()));
    bl->addWidget(aboutButton, 0, Qt::AlignCenter);

    closeButton = new QPushButton(QIcon(":/images/tick.png"), tr("Close"));
    closeButton->setAutoDefault(false);
    closeButton->setFocusPolicy(Qt::NoFocus);
    connect(closeButton, SIGNAL(clicked()), this, SLOT(closeWanted()));
    bl->addWidget(closeButton, 0, Qt::AlignRight);

    mainLayout->addLayout(bl);

    setLayout(mainLayout);

    pingTimer = new QTimer(this);
    connect(pingTimer, SIGNAL(timeout()), this, SLOT(pingProc()));
    switchTimer = new QTimer(this);
    connect(switchTimer, SIGNAL(timeout()), this, SLOT(switchProc()));
    prioTimer = new QTimer(this);
    connect(prioTimer, SIGNAL(timeout()), this, SLOT(prioProc()));

    trayIcon->show();
    setWindowTitle("QGateway");

    readSettings();

    settChanged = false;
    startupChanged = true;
    checkStartup();

    setWindowIcon(QIcon(":/images/computer-network.png"));
}
开发者ID:qtdevel,项目名称:qgateway,代码行数:61,代码来源:window.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ iconDatabase函数代码示例发布时间:2022-05-30
下一篇:
C++ icon函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap