[Kde-bindings] playground/bindings/phpqt [POSSIBLY UNSAFE] [BROKEN EMAIL]

Thomas Moenicke tm at php-qt.org
Fri Aug 31 14:07:36 UTC 2007


SVN commit 706885 by moenicke:

* adding user interface compiler

CCMAIL: kde-bindings at kde.org



 M  +6 -0      CMakeLists.txt  
 M  +3 -0      php_qt/functions.cpp  
 M  +1 -1      php_qt/php_qt.cpp  
 M  +4 -0      php_qt/php_qt.h  
 M  +9 -4      php_qt/phpqt_internals.cpp  
 A             tools (directory)  
 A             tools/CMakeLists.txt  
 A             tools/uic (directory)  
 A             tools/uic/CMakeLists.txt  
 A             tools/uic/customwidgetsinfo.cpp   [License: UNKNOWN]
 A             tools/uic/customwidgetsinfo.h   [License: UNKNOWN]
 A             tools/uic/databaseinfo.cpp   [License: UNKNOWN]
 A             tools/uic/databaseinfo.h   [License: UNKNOWN]
 A             tools/uic/driver.cpp   [License: UNKNOWN]
 A             tools/uic/driver.h   [License: UNKNOWN]
 A             tools/uic/globaldefs.h   [License: UNKNOWN]
 A             tools/uic/main.cpp   [POSSIBLY UNSAFE: system] [License: UNKNOWN]
 A             tools/uic/option.h   [License: UNKNOWN]
 A             tools/uic/php (directory)  
 A             tools/uic/php/phpextractimages.cpp   [License: UNKNOWN]
 A             tools/uic/php/phpextractimages.h   [License: UNKNOWN]
 A             tools/uic/php/phpwritedeclaration.cpp   [License: UNKNOWN]
 A             tools/uic/php/phpwritedeclaration.h   [License: UNKNOWN]
 A             tools/uic/php/phpwriteicondata.cpp   [License: UNKNOWN]
 A             tools/uic/php/phpwriteicondata.h   [License: UNKNOWN]
 A             tools/uic/php/phpwriteicondeclaration.cpp   [License: UNKNOWN]
 A             tools/uic/php/phpwriteicondeclaration.h   [License: UNKNOWN]
 A             tools/uic/php/phpwriteiconinitialization.cpp   [License: UNKNOWN]
 A             tools/uic/php/phpwriteiconinitialization.h   [License: UNKNOWN]
 A             tools/uic/php/phpwriteincludes.cpp   [License: UNKNOWN]
 A             tools/uic/php/phpwriteincludes.h   [License: UNKNOWN]
 A             tools/uic/php/phpwriteinitialization.cpp   [License: UNKNOWN]
 A             tools/uic/php/phpwriteinitialization.h   [License: UNKNOWN]
 A             tools/uic/qclass_lib_map.h   [License: no copyright]
 A             tools/uic/treewalker.cpp   [License: UNKNOWN]
 A             tools/uic/treewalker.h   [License: UNKNOWN]
 A             tools/uic/ui4.cpp   [License: UNKNOWN]
 A             tools/uic/ui4.h   [License: UNKNOWN]
 A             tools/uic/uic.cpp   [License: GENERATED FILE]
 A             tools/uic/uic.h   [License: UNKNOWN]
 A             tools/uic/uic.pri  
 A             tools/uic/uic.pro  
 A             tools/uic/utils.h   [License: UNKNOWN]
 A             tools/uic/validator.cpp   [License: UNKNOWN]
 A             tools/uic/validator.h   [License: UNKNOWN]
 M  +2 -2      tutorials/t8/cannonfield.php  
 M  +7 -4      tutorials/t8/lcdrange.php  
 M  +3 -2      tutorials/t8/main.php  


--- trunk/playground/bindings/phpqt/CMakeLists.txt #706884:706885
@@ -8,6 +8,8 @@
 find_package(Perl REQUIRED)	# for kalyptus
 find_package(Qt4 REQUIRED)	# for kalyptus
 
+INCLUDE_DIRECTORIES (${QT_INCLUDES})
+
 include(FindPHP5)
 
 IF(NOT PHP5_FOUND)
@@ -17,4 +19,8 @@
 OPTION(ENABLE_SMOKEKDE "build SmokeKDE" OFF)
 add_subdirectory(smoke)
 add_subdirectory(php_qt)
+add_subdirectory(tests)
+add_subdirectory(tools)
 
+
+
--- trunk/playground/bindings/phpqt/php_qt/functions.cpp #706884:706885
@@ -699,3 +699,6 @@
  return "unknown";
 }
 
+PHP_FUNCTION(Q_UNUSED) {
+// just nothing
+}
--- trunk/playground/bindings/phpqt/php_qt/php_qt.cpp #706884:706885
@@ -385,7 +385,7 @@
 	// cache class entries
 	Smoke::Index i = 1;
 	QHash<const char*, zend_class_entry*> tmpCeTable;
-
+	
 	// loop for all classes, register class entries
 	for(i = 1; i <= PQ::smoke()->numClasses; i++){
 
--- trunk/playground/bindings/phpqt/php_qt/php_qt.h #706884:706885
@@ -27,6 +27,8 @@
 #define PHPQT_VERSION "0.0.4"
 #define QIDI_VERSION "1.0"
 
+#define MOC_DEBUG
+
 #define MONITOR
 
 #define COMPILE_DL_PHP_QT
@@ -117,6 +119,8 @@
 PHP_FUNCTION(qobject_cast);
 PHP_FUNCTION(tr);
 PHP_FUNCTION(check_qobject);
+PHP_FUNCTION(Q_UNUSED);
+
 void check_qobject(zval* zobject);
 
 void init_codec();
--- trunk/playground/bindings/phpqt/php_qt/phpqt_internals.cpp #706884:706885
@@ -69,7 +69,8 @@
 	    i[3].s_voidp = (void*) args[3].s_voidp;
 	    (*fn)(m.method, so->mPtr(), i);
 #ifdef MOC_DEBUG
-	    cout << "+\tcall Qt slot " << so->ce_ptr()->name << "::" << PQ::smoke()->methodNames[method] << endl;
+//	    cout << "+\tcall Qt slot " << so->ce_ptr()->name << "::" << PQ::smoke()->methodNames[method] << endl;
+	    cout << "+\tcall Qt slot " << endl;
 #endif
 	    
 	    if((int)i[0].s_int < 0)
@@ -101,8 +102,8 @@
     if(d->method(_id).methodType() == QMetaMethod::Slot)
     {
         int j = 0;
-        zval*** zargs = (zval***) safe_emalloc( 2, sizeof(zval*), 0 );
         QList<QByteArray> qargs = d->method(_id).parameterTypes();
+        zval*** zargs = (zval***) safe_emalloc( qargs.count(), sizeof(zval*), 0 );
         for(int i = 0; i < qargs.count(); i++)
 	{
             zval *arg;
@@ -133,8 +134,12 @@
 	    cout << "+\tcall PHP slot " << so->ce_ptr()->name << "::" << method_name << endl;
 #endif
 	    PHPQt::callPHPMethod(so->zval_ptr(), method_name, j, *zargs);
-	} else 
-	 goto CPP;
+	    efree(zargs);
+	} else {    
+	    qDebug("goto!");
+	    goto CPP;
+	}
+	
     } 
 
 // is a signal
--- trunk/playground/bindings/phpqt/tutorials/t8/cannonfield.php #706884:706885
@@ -44,8 +44,8 @@
 		return;
 	    $this->currentAngle = $angle;
 	    $this->update();
-	    $this->emit($this->angleChanged($this->currentAngle));
-
+echo $this->currentAngle." <//////// here";
+	    emit($this->angleChanged($this->currentAngle));
 	}
 
 	protected function paintEvent ($event) {
--- trunk/playground/bindings/phpqt/tutorials/t8/lcdrange.php #706884:706885
@@ -27,7 +27,8 @@
 
 	    $this->lcd = new QLCDNumber(2);
 	    $this->lcd->setSegmentStyle(QLCDNumber::Filled);
-
+	    $this->b = new QLineEdit($this);
+	    
 	    $this->slider = new QSlider(Qt::Horizontal);
 	    $this->slider->setRange(0, 99);
 	    $this->slider->setValue(0);
@@ -39,7 +40,6 @@
 	    $layout->addWidget($this->lcd);
 	    $layout->addWidget($this->slider);
 	    $this->setLayout($layout);
-
 	    $this->setFocusProxy($this->slider);
 	}
 
@@ -48,11 +48,14 @@
 	    return $this->slider->value();
 	}
 	
-	public function setValue($value)
+	public function setValue($value=0)
 	{
+echo "PHP user space" . $value." <<<<<<<<<<<<<<<<<<<\n";
 	    $this->slider->setValue($value);
+
+#	    $this->lcd->display($value);
 	}
-		
+
 	public function setRange($minValue, $maxValue)
 	{
 	    if ($minValue < 0 || $maxValue > 99 || $minValue > $maxValue) {
--- trunk/playground/bindings/phpqt/tutorials/t8/main.php #706884:706885
@@ -24,7 +24,7 @@
 	    $quit = new QPushButton(tr("Quit"));
     	    $quit->setFont(new QFont("Times", 18, QFont::Bold));
 
-//	    QObject::connect($quit, SIGNAL('clicked()'), qApp(), SLOT('quit()'));
+#	    QObject::connect($quit, SIGNAL('clicked()'), qApp(), SLOT('quit()'));
 	    QObject::connect($quit, SIGNAL('clicked()'), QApplication::instance(), SLOT('quit()'));
 
 	    $angle = new LCDRange();
@@ -33,7 +33,8 @@
 	    $cannonField = new CannonField();
 
 	    QObject::connect($angle, SIGNAL('valueChanged(int)'), $cannonField, SLOT('setAngle(int)'));
-	    QObject::connect($cannonField, SIGNAL('angleChanged(int)'), $angle, SLOT('setValue(int)'));
+#	    QObject::connect($cannonField, SIGNAL('angleChanged(int)'), $angle, SLOT('setValue(int)'));
+	    QObject::connect($angle, SIGNAL('valueChanged(int)'), $angle->lcd, SLOT('display(int)'));
 
 	    $gridLayout = new QGridLayout();
 	    $gridLayout->addWidget($quit, 0, 0);



More information about the Kde-bindings mailing list