00001 #!/usr/bin/php
00002 <?
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 if(empty($argc))
00023 {
00024 exit;
00025 }
00026 if(!extension_loaded('php_qt')) {
00027 dl('php_qt.so');
00028 }
00029
00030 include_once('QtBackend.php');
00031 include_once('lib-qt/MainWindow.php');
00032
00033 $app = new QApplication(&$argc,$argv);
00034 $widget = new MainWindow();
00035 $widget->show();
00036
00037 $app->exec();
00038
00039 class ProjectTreeModel extends QAbstractItemModel
00040 {
00041 public $rootItem;
00042 public $headerData;
00043
00044 function __construct($data = 0, $parent = 0)
00045 {
00046 parent::__construct($parent);
00047 $this->rootItem = new ProjectTreeItem();
00048 $this->headerData = new QVariant();
00049 $this->headerData->setValue("hello");
00050 }
00051
00052 function data(QModelIndex &$index, $role)
00053 {
00054 return $this->rootItem;
00055 }
00056 function flags(QModelIndex &$index)
00057 {
00058 }
00059
00060 function headerData($section, $orientation, $role)
00061 {
00062 return $this->headerData;
00063 }
00064
00065 function index($row, $column, &$parent)
00066 {
00067 return new QModelIndex();
00068 }
00069
00070 function parent($index)
00071 {
00072 return null;
00073 }
00074
00075 function rowCount($parent)
00076 {
00077 return 1;
00078 }
00079
00080 function columnCount($parent)
00081 {
00082 return 1;
00083 }
00084
00085 }
00086
00087 class ProjectTreeItem
00088 {
00089 public $parent;
00090 public $row = 0;
00091 function childCount()
00092 {
00093 return 0;
00094 }
00095 function columnCount()
00096 {
00097 return 1;
00098 }
00099 function data($column)
00100 {
00101 return "feri";
00102 }
00103 function parent()
00104 {
00105 return $this->parent;
00106 }
00107 }
00108
00109
00110 ?>