QtGUI.php

Go to the documentation of this file.
00001 #!/usr/bin/php
00002 <?
00003 /***************************************************************************
00004  *   Copyright (C) 2005 by Ferenc Veres   *
00005  *   lion@netngine.hu   *
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  *   This program is distributed in the hope that it will be useful,       *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015  *   GNU General Public License for more details.                          *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU General Public License     *
00018  *   along with this program; if not, write to the                         *
00019  *   Free Software Foundation, Inc.,                                       *
00020  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
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 ?>

Generated on Tue Mar 20 00:42:40 2007 for XarayaTranslationMemory by  doxygen 1.4.7