Tray::Tray(QObject *parent) : QSystemTrayIcon(parent) { QIcon icon("icon\\trayIcon.png"); this->setIcon(icon); this->setToolTip("AltRun"); createContextMenu(); connect ( this,SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this,SLOT(activatedSlot(QSystemTrayIcon::ActivationReason)) ); // shortcut = new QxtGlobalShortcut(QKeySequence("Alt+t"), this); // QObject::connect(shortcut, SIGNAL(activated()),this, SLOT(showDlgSlot())); }
TrayIcon::TrayIcon(const QString& trayIcon,const QString& programName, QObject *parent) : QSystemTrayIcon(QIcon(trayIcon),parent) { setToolTip(programName); pMenu=new QMenu; pMenu->addAction("Головне вікно",this,SIGNAL(mainWindowSignal())); pMenu->addAction("Вікно налаштувань",this,SIGNAL(settingsSignal())); pMenu->addAction("Оновити курси",this,SIGNAL(updateSignal())); pMenu->addSeparator(); pMenu->addAction("Вийти",qApp,SLOT(quit())); setContextMenu(pMenu); connect(this,SIGNAL(activated(QSystemTrayIcon::ActivationReason)), SLOT(activatedSlot(QSystemTrayIcon::ActivationReason))); }
GTreeView::GTreeView(QWidget *parent,VM *pVM) : QTreeView(parent) { this->pVM = pVM; this->pParaList = ring_list_new(0); strcpy(this->ccollapsedEvent,""); strcpy(this->cexpandedEvent,""); strcpy(this->cactivatedEvent,""); strcpy(this->cclickedEvent,""); strcpy(this->cdoubleClickedEvent,""); strcpy(this->centeredEvent,""); strcpy(this->cpressedEvent,""); strcpy(this->cviewportEnteredEvent,""); QObject::connect(this, SIGNAL(collapsed(QModelIndex)),this, SLOT(collapsedSlot())); QObject::connect(this, SIGNAL(expanded(QModelIndex)),this, SLOT(expandedSlot())); QObject::connect(this, SIGNAL(activated(QModelIndex)),this, SLOT(activatedSlot())); QObject::connect(this, SIGNAL(clicked(QModelIndex)),this, SLOT(clickedSlot())); QObject::connect(this, SIGNAL(doubleClicked(QModelIndex)),this, SLOT(doubleClickedSlot())); QObject::connect(this, SIGNAL(entered(QModelIndex)),this, SLOT(enteredSlot())); QObject::connect(this, SIGNAL(pressed(QModelIndex)),this, SLOT(pressedSlot())); QObject::connect(this, SIGNAL(viewportEntered()),this, SLOT(viewportEnteredSlot())); }