예제 #1
0
 /**
  * runs a simple model/view app for a moment
  */
 function testModelView()
 {
     if (!QCoreApplication::instance()) {
         $argv = array("");
         $app = new QApplication(1, $argv);
     }
     $model_a = new MyItemModel();
     $treeView = new QTableView();
     $treeView->setModel($model_a);
     $treeView->show();
     QTimer::singleShot(100, QCoreApplication::instance(), SLOT("quit()"));
     $app->exec();
 }
 function testCallingSlot()
 {
     #return;
     //            $clickedButton = qobject_cast($this->sender(), new QToolButton());
     $argc = 1;
     $argv = array("argv");
     $app = new MyApplication($argc, $argv);
     QTimer::singleShot(100, $app, SLOT("mySlot()"));
     print "OK";
     QTimer::singleShot(100, $app, SLOT("quit()"));
     print "OK";
     #	    $app->exec();
 }
예제 #3
0
 function testShowHide()
 {
     echo "\ntesting virtual method call 'sizeHint()' in a loop: ";
     $m = new myWidget();
     for ($i = 0; $i < 10; $i++) {
         QTimer::singleShot(10, $m, SLOT("show()"));
         usleep(20000);
         $m->hide();
     }
     echo " passed";
 }
예제 #4
0
 /**
  * @slot
  */
 public function newScreenshot()
 {
     if ($this->hideThisWindowCheckBox->isChecked()) {
         $this->hide();
     }
     $this->newScreenshotButton->setDisabled(true);
     QTimer::singleShot($this->delaySpinBox->value() * 1000, $this, SLOT("shootScreen()"));
 }