예제 #1
0
void CounterForm::slotDialogAccepted()
{
    image.save(openFileName.remove(".JPG").append("_counted.jpg"));
    timer.start(1000);
    ui->savePushButton->setStyleSheet("QPushButton{color: red}");
    ui->savePushButton->setText("Image Saved");

    connect(&timer, SIGNAL(timeout()), this, SLOT(slotTimeOut()));

}
예제 #2
0
CCameraOpencv::CCameraOpencv(QObject *parent) :
    CCamera(parent)
{
    m_tmCapture = 1000 / GetFrameRate();
    bool check = connect(&m_Timer, SIGNAL(timeout()),
                         SLOT(slotTimeOut()));
    Q_ASSERT(check);
    check = connect(this, SIGNAL(sigCaptureRawFrame(QVideoFrame)), 
                    &m_CaptureFrameProcess, SLOT(slotCaptureFrame(QVideoFrame)));
    Q_ASSERT(check);
}
예제 #3
0
SqueezedComboBox::SqueezedComboBox(QWidget *parent, const char *name)
        : QComboBox(parent)
{
    setObjectName(name);
    setMinimumWidth(100);
    m_timer = new QTimer(this);
    m_timer->setSingleShot(true);
    //m_tooltip = new SqueezedComboBoxTip( listBox()->viewport(), this ); XXX

    connect(m_timer, SIGNAL(timeout()),
            SLOT(slotTimeOut()));
    //connect(this, SIGNAL(activated(int)), XXX
    //        SLOT(slotUpdateToolTip(int)));
}
예제 #4
0
파일: monitor.cpp 프로젝트: speakman/qlc
void Monitor::connectTimer()
{
  s_monitorsMutex->lock();

  if (s_monitors == 0)
    {
      s_timer = new QTimer();
      s_timer->start(1000 / s_updateFrequency);
    }

  connect(s_timer, SIGNAL(timeout()), this, SLOT(slotTimeOut()));
  s_monitors++;

  s_monitorsMutex->unlock();
}
예제 #5
0
//--------------------utech--------------------utech--------------------utech--------------------
void ULoadVerInfo::loadVersion()
{
#ifdef U_DEVELOP
	qDebug() << "bool ULoadVerInfo::loadVersion() loaded.";
#endif
	netReply = accessMeneger->get(request);
	connect(netReply, SIGNAL(readyRead()), this, SLOT(slotReadyRead()));
	connect(netReply, SIGNAL(error(QNetworkReply::NetworkError)),this, SLOT(slotError(QNetworkReply::NetworkError)));
	
	netRequestDone = false;
	
	timer = new QTimer(this);
	timer->setSingleShot(true);
	connect(timer, SIGNAL(timeout()), this, SLOT(slotTimeOut()));
	timer->start(timeDelay);
}
예제 #6
0
VersionCheckDialog::VersionCheckDialog(QWidget * parent)
  : QDialog(parent)
  , ui(new Ui::VersionCheckDialog)
  , m_nam(new QNetworkAccessManager)
{
    // inject ui
    ui->setupUi(this);
    ui->currVersion->setText(QCoreApplication::applicationVersion());
    ui->nextVersion->setText(tr("checking"));

    // start the network request
    QNetworkRequest request(QUrl("http://code.google.com/p/fotowall/"));
    QNetworkReply * reply = m_nam->get(request);
    connect(reply, SIGNAL(finished()), this, SLOT(slotGotReply()));
    QTimer::singleShot(NETWORK_TIMEOUT, this, SLOT(slotTimeOut()));
}
예제 #7
0
파일: monitor.cpp 프로젝트: speakman/qlc
void Monitor::disconnectTimer()
{
  s_monitorsMutex->lock();

  disconnect(s_timer, SIGNAL(timeout()), this, SLOT(slotTimeOut()));
  s_monitors--;

  if (s_monitors == 0)
    {
      s_timer->stop();
      delete s_timer;
      s_timer = NULL;
    }

  s_monitorsMutex->unlock();
}
예제 #8
0
MainWindow::MainWindow()
{
  const char *cptr;
  int i;

#ifdef BROWSERPLUGIN
  pvbinit();
#endif

  isReconnect = 0;
#ifndef NO_WEBKIT  
  textbrowser = NULL;
#endif  
  tabToolBar  = NULL;
  maxfd = currentTab = numTabs = 0;
  for(i=0; i<MAX_TABS; i++)
  {
    pvbtab[i].s          = -1;        // socket
    pvbtab[i].in_use     = 0;         // tab is currently not used
    pvbtab[i].w          = 1280;      // default width
    pvbtab[i].h          = 1024;      // default height
    pvbtab[i].pvsVersion = 0x0040600; // last version of pvserver that does not send version
    pvbtab[i].rootWidget = NULL;
    pvbtab[i].hasLayout  = 0;
    for(int ii=0; ii<MAX_DOCK_WIDGETS; ii++) 
    {
      pvbtab[i].dock[ii] = NULL;
    }  
  }

  cptr = readIniFile();
  if(cptr != NULL)
  {
    QMessageBox::warning(NULL,"MainWindow","readIniFile ERROR: terminating ...");
    printf("readIniFile ERROR=%s\n",cptr);
    exit(-1);
  }
  if(opt.appfontsize > 0) // intoduced june 2012 for android application font setting
  {
    //QFont f = qApp->font();
    //f.setPointSize(opt.appfontsize);
    //qApp->setFont(f);
    QFont f = QApplication::font();
    f.setPointSize(opt.appfontsize);
    QApplication::setFont(f);
  }

  createActions();
  createToolBars();
  createMenus();
  createStatusBar();
  if(opt.menubar   == 0) menuBar()->hide();
  if(opt.toolbar   == 0) fileToolBar->hide();
  if(opt.statusbar == 0) statusBar()->hide();
  tcp_init();

  setCurrentFile("");
  readHosts();

  semaphore.release();
  mythread.pv = this;
  // slow_start_on_windows mythread.start();
  // there is a problem within the firefox plugin on windows
  // we do not get enough CPU time there
  // no problem on linux
  // we get more CPU time if we continiously move the mouse over the widget
  // problem not solved jet
#ifdef BROWSERPLUGIN
  mythread.start(QThread::HighestPriority); // this does not help also
#endif

  // setup watchdog
  timer = new QTimer();
  QObject::connect(timer, SIGNAL(timeout()), this, SLOT(slotTimeOut()));
  // moved timer start to end of this method  because show may need longer on mobile devices  timer->start(1000*10);

  if(opt.arg_host[0] != '\0') url = opt.arg_host;
  else                        url = opt.initialhost;
  add_host(url.toUtf8());

  if(opt.arg_x != -1 && opt.arg_y != -1 && opt.arg_w != -1 && opt.arg_h != -1)
  {
    setGeometry(opt.arg_x,opt.arg_y, opt.arg_w,opt.arg_h);
  }
  else if(opt.fullscreen)
  {
    showFullScreen();
  }
  else if(opt.maximized)
  {
    showMaximized();
  }
  else
  {
    resize(800,600);
  }

  if(opt.cursor_shape >= 0)
  {
    QApplication::restoreOverrideCursor();
    QApplication::setOverrideCursor(QCursor((Qt::CursorShape) opt.cursor_shape));
  }  

// delay textbrowser for speedup starting on windows  
// loading the help file is damn slow on windows
// thus we delay this operation until help is really needed
//QMessageBox::information(this,"pvbrowser","step begin",1);
//  textbrowser = new dlgTextBrowser;
//QMessageBox::information(this,"pvbrowser","step end",1);
  setFocus(Qt::MouseFocusReason);
#ifdef BROWSERPLUGIN
  QApplication::setActiveWindow(this); // now we will get keyboard events
#endif
  busyWidget = new QPushButton(this);
  busyWidget->setIcon(QIcon(":images/app.png"));
  busyWidgetTimer = new QTimer(this);
  busyWidgetTimer->setSingleShot(true);
  connect(busyWidgetTimer,SIGNAL(timeout()),this,SLOT(slotBusyWidgetTimeout()));
  timer->start(1000*10);
}