VSCToolBar::VSCToolBar(QWidget *parent) : QWidget(parent) { ui.setupUi(this); setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::WindowStaysOnBottomHint); //setWindowFlags( Qt::WindowStaysOnTopHint | Qt::WindowStaysOnBottomHint); setWindowOpacity(0.8); int x, y, w, h; QDesktopWidget *desktop = QApplication::desktop(); QRect rect = desktop->screenGeometry(0); x = rect.x(); y = rect.y(); w = rect.width(); h = rect.height(); //rect.getRect(&x, &y, &w, &h); VDC_DEBUG( "%s rect x:%d y:%d w:%d h:%d \n",__FUNCTION__, x, y, w, h); QPoint p(x + w/2 - 240, y + h - 150 ); move(p); m_Timer = new QTimer(this); connect(m_Timer, SIGNAL(timeout()), this, SLOT(showcurrentTime())); m_Timer->start(1000); m_TimerAlarm = new QTimer(this); connect(m_TimerAlarm, SIGNAL(timeout()), this, SLOT(showAlarm())); ui.pbAlarm->setIcon(QIcon(":/action/resources/alarmno.png")); //m_TimerAlarm->start(300); m_alarm = false; }
VSCToolBar::VSCToolBar(QWidget *parent) : QWidget(parent) { ui.setupUi(this); setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::WindowStaysOnBottomHint); //setWindowFlags( Qt::WindowStaysOnTopHint | Qt::WindowStaysOnBottomHint); setWindowOpacity(0.8); int x, y, w, h; QDesktopWidget *desktop = QApplication::desktop(); QRect rect = desktop->screenGeometry(0); x = rect.x(); y = rect.y(); w = rect.width(); h = rect.height(); //rect.getRect(&x, &y, &w, &h); VDC_DEBUG( "%s rect x:%d y:%d w:%d h:%d \n",__FUNCTION__, x, y, w, h); QPoint p(x + w/2 - 240, y + h - 150 ); move(p); m_Timer = new QTimer(this); connect(m_Timer, SIGNAL(timeout()), this, SLOT(showcurrentTime())); m_Timer->start(1000); m_TimerPrcessing = new QTimer(this); connect(m_TimerPrcessing, SIGNAL(timeout()), this, SLOT(showProcessingTimer())); m_TimerPrcessing->start(1000); m_TimerAlarm = new QTimer(this); connect(m_TimerAlarm, SIGNAL(timeout()), this, SLOT(showAlarm())); ui.pbAlarm->setIcon(QIcon(":/action/resources/alarmno.png")); //m_TimerAlarm->start(300); m_alarm = false; m_movie = new QMovie(":/action/resources/processing.gif"); ui.lbProcess->setScaledContents(true); ui.lbProcess->setMovie(m_movie); m_movie->start(); showProcessing(FALSE); m_cpu = new VSCCalculate(ui.cpu); #if 0 ui.Tour->addItem("Tour 1"); ui.Tour->addItem("Tour 2"); ui.Tour->addItem("Tour 3"); #endif //ui.pbTourStop->hide(); }