/** * 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(); }
/** * test model-view. It uses virtual methods a lot and new zvals for the same Qt object are created very often * */ function testModelView() { echo "\ntesting Model-View: "; $model_a = new MyItemModel(); $treeView = new QTableView(); $treeView->setModel($model_a); $treeView->show(); // QTimer::singleShot(10,QApplication::instance(),SLOT("quit()")); // $this->app->exec(); echo "passed\n"; }