/** * 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(); }
public final function NonQuery($strNonQuery) { if (!$this->blnConnectedFlag) { $this->Connect(); } $timerName = ''; if ($this->blnEnableProfiling) { $timerName = 'queryExec' . mt_rand(); QTimer::Start($timerName); } $result = $this->ExecuteNonQuery($strNonQuery); if ($this->blnEnableProfiling) { $dblQueryTime = QTimer::Stop($timerName); QTimer::Reset($timerName); // Log Query (for Profiling, if applicable) $this->LogQuery($strNonQuery, $dblQueryTime); } return $result; }
public function testExceptions4() { $objTimer = QTimer::GetTimer('timer7'); $this->assertEquals(null, $objTimer, "Requests for non-existing timer objects should return null"); }
/** * Some errors are not caught by a php custom error handler, which can cause the system to silently fail. * This shutdown function will catch those errors. */ function QCubedShutdown() { if (defined('__TIMER_OUT_FILE__')) { $strTimerOutput = QTimer::VarDump(false); if ($strTimerOutput) { file_put_contents(__TIMER_OUT_FILE__, $strTimerOutput . "\n", FILE_APPEND); } } $error = error_get_last(); if ($error && is_array($error) && (!defined('QCodeGen::DebugMode') || QCodeGen::DebugMode)) { // if we are codegenning, only error if we are in debug mode. Prevents chmod error. QcubedHandleError($error['type'], $error['message'], $error['file'], $error['line'], ''); } //flush(); // required for hhvm //error_log("Flushed"); }
instance:<br> <pre><code>$objTimer = QTimer::GetTimer('timerName'); echo $objTimer->CountStarted;</code></pre> <p>Take a look at a sample usage example below by clicking View Source.</p> </div> <div id="demoZone"> <?php QTimer::start('longCalculation'); for ($i = 0; $i < 1000000; $i++) { // do nothing - just loop a bunch of times } QTimer::stop('longCalculation'); echo "Here's how long it took to execute the long calculation: " . QTimer::getTime('longCalculation') . "<br /><br />"; QTimer::start('loadPersons'); $arrPersons = Person::LoadAll(); QTimer::stop('loadPersons'); // resume the long calculation timer QTimer::start('longCalculation'); for ($i = 0; $i < 1000000; $i++) { // do nothing - just loop a bunch of times } QTimer::stop('longCalculation'); echo "<strong>Results of QTimer::varDump():</strong><br>"; QTimer::varDump(); ?> </div> <?php require '../includes/footer.inc.php';
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"; }
/** * @slot */ public function newScreenshot() { if ($this->hideThisWindowCheckBox->isChecked()) { $this->hide(); } $this->newScreenshotButton->setDisabled(true); QTimer::singleShot($this->delaySpinBox->value() * 1000, $this, SLOT("shootScreen()")); }