Esempio n. 1
0
 function testCreatingObjects()
 {
     for ($i = 0; $i < 8000; $i++) {
         //	    while(true){
         $b = new QObject();
         $b->setObjectName("hallo");
         echo $i++ . "\n";
         echo $b->objectName();
         $b->__destruct();
     }
 }
Esempio n. 2
0
 public function __construct()
 {
     parent::__construct();
     $quit = new QPushButton(tr("&Quit"));
     $quit->setFont(new QFont("Times", 18, QFont::Bold));
     QObject::connect($quit, SIGNAL('clicked()'), QApplication::instance(), SLOT('quit()'));
     $angle = new LCDRange();
     $angle->setRange(5, 70);
     $force = new LCDRange();
     $force->setRange(10, 50);
     $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($force, SIGNAL('valueChanged(int)'), $cannonField, SLOT('setForce(int)'));
     QObject::connect($cannonField, SIGNAL('forceChanged(int)'), $force, SLOT('setValue(int)'));
     $shoot = new QPushButton(tr("&Shoot"));
     $shoot->setFont(new QFont("Times", 18, QFont::Bold));
     QObject::connect($shoot, SIGNAL('clicked()'), $cannonField, SLOT('shoot()'));
     $topLayout = new QHBoxLayout();
     $topLayout->addWidget($shoot);
     $topLayout->addStretch(1);
     $leftLayout = new QVBoxLayout();
     $leftLayout->addWidget($angle);
     $leftLayout->addWidget($force);
     $gridLayout = new QGridLayout();
     $gridLayout->addWidget($quit, 0, 0);
     $gridLayout->addLayout($topLayout, 0, 1);
     $gridLayout->addLayout($leftLayout, 1, 0);
     $gridLayout->addWidget($cannonField, 1, 1, 2, 1);
     $gridLayout->setColumnStretch(1, 10);
     $this->setLayout($gridLayout);
     $angle->setValue(60);
     $force->setValue(25);
     $angle->setFocus();
 }
Esempio n. 3
0
 public function setupUi($Dialog)
 {
     if ($Dialog->objectName()->isEmpty()) {
         $Dialog->setObjectName(QString::fromUtf8("Dialog"));
     }
     $size = new QSize(394, 311);
     $size = $size->expandedTo($Dialog->minimumSizeHint());
     $Dialog->resize($size);
     $this->buttonBox = new QDialogButtonBox($Dialog);
     $buttonBox = $this->buttonBox;
     // scope
     $buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
     $buttonBox->setGeometry(new QRect(40, 270, 341, 32));
     $buttonBox->setOrientation(Qt::Horizontal);
     $buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::NoButton | QDialogButtonBox::Ok);
     $this->textBrowser = new QTextBrowser($Dialog);
     $textBrowser = $this->textBrowser;
     // scope
     $textBrowser->setObjectName(QString::fromUtf8("textBrowser"));
     $textBrowser->setGeometry(new QRect(10, 10, 371, 211));
     $this->lineEdit = new QLineEdit($Dialog);
     $lineEdit = $this->lineEdit;
     // scope
     $lineEdit->setObjectName(QString::fromUtf8("lineEdit"));
     $lineEdit->setGeometry(new QRect(10, 230, 371, 25));
     $this->retranslateUi($Dialog);
     QObject::connect($buttonBox, SIGNAL('accepted()'), $Dialog, SLOT('accept()'));
     QObject::connect($buttonBox, SIGNAL('rejected()'), $Dialog, SLOT('reject()'));
     QMetaObject::connectSlotsByName($Dialog);
 }
Esempio n. 4
0
 public function free()
 {
     $this->lt->free();
     $this->lb->free();
     $this->lm->free();
     $this->rt->free();
     $this->rb->free();
     $this->rm->free();
     $this->tm->free();
     $this->bm->free();
     parent::free();
 }
Esempio n. 5
0
 public function setupConnections()
 {
     $this->quit = new QPushButton(tr("Quit"));
     $this->quit->setFont(new QFont("Times", 18, QFont::Bold));
     QObject::connect($this->quit, SIGNAL('clicked()'), QApplication::instance(), SLOT('quit()'));
     $this->angle = new LCDRange();
     $this->angle->setRange(5, 70);
     /*
     $this->cannonField = new CannonField();
     */
     //    QObject::connect($this->angle, SIGNAL('valueChanged(int)'), $this->cannonField, SLOT('setAngle(int)'));
     //    QObject::connect($this->cannonField, SIGNAL('angleChanged(int)'), $this->angle, SLOT('setValue(int)'));
 }
Esempio n. 6
0
 public function __construct()
 {
     parent::__construct();
     $this->currentAngle = 45;
     $this->currentForce = 0;
     $this->timerCount = 0;
     $this->autoShootTimer = new QTimer($this);
     QObject::connect($this->autoShootTimer, SIGNAL('timeout()'), $this, SLOT('moveShot()'));
     $this->shootAngle = 0;
     $this->shootForce = 0;
     $this->setPalette(new QPalette(new QColor(250, 250, 200)));
     $this->setAutoFillBackground(true);
     $this->barrelRect = new QRect(30, -5, 20, 10);
 }
Esempio n. 7
0
 public function __construct()
 {
     parent::__construct();
     $this->objectName = PQNAME;
     $this->currentPath = QDir::CurrentPath;
     $this->iconsPath = $this->currentPath . '/core/design/faenza-icons';
     $this->qticonsPath = $this->currentPath . '/core/design/qt-icons';
     $this->pqpackPath = ___pq_prepare_path(getenv("PROGRAMFILES")) . '/PQPack';
     // Components
     $this->csPath = $this->currentPath . '/core/components';
     $this->csName = 'component.php';
     $this->csProperties = 'properties.php';
     $this->csEvents = 'events.php';
     $this->csIcon = 'icon.png';
     $this->init();
 }
Esempio n. 8
0
 public function __construct()
 {
     parent::__construct();
     $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()'), QApplication::instance(), SLOT('quit()'));
     $angle = new LCDRange();
     $angle->setRange(5, 70);
     $cannonField = new CannonField();
     QObject::connect($angle, SIGNAL('valueChanged(int)'), $cannonField, SLOT('setAngle(int)'));
     QObject::connect($cannonField, SIGNAL('angleChanged(int)'), $angle, SLOT('setValue(int)'));
     $gridLayout = new QGridLayout();
     $gridLayout->addWidget($quit, 0, 0);
     $gridLayout->addWidget($angle, 1, 0);
     $gridLayout->addWidget($cannonField, 1, 1, 2, 1);
     $gridLayout->setColumnStretch(1, 10);
     $this->setLayout($gridLayout);
     $angle->setValue(60);
     $angle->setFocus();
 }
Esempio n. 9
0
 public function blockSignals($bool)
 {
     return parent::blockSignals($bool);
 }
Esempio n. 10
0
{
    private $mainWidget;
    public $button1;
    public $button2;
    function __construct()
    {
        $mainWidget = new QWidget();
        parent::__construct(QBoxLayout::TopToBottom, $mainWidget);
        $this->mainWidget = $mainWidget;
        $this->button1 = new QPushButton("About Qt!");
        $this->button2 = new QPushButton("Quit");
        $this->addWidget($this->button1);
        $this->addWidget($this->button2);
    }
    function __destruct()
    {
        $this->button1 = 0;
        $this->button2 = 0;
        $this->mainWidget = 0;
    }
    function show()
    {
        $this->mainWidget->show();
    }
}
$app = new QApplication($argc, $argv);
$box = new Box();
$box->show();
QObject::connect($box->button1, SIGNAL("clicked()"), $app, SLOT("aboutQt()"));
QObject::connect($box->button2, SIGNAL("clicked()"), $app, SLOT("quit()"));
$app->exec();
Esempio n. 11
0
 /**
  * QString as argument			<br><br>
  * <code>
  * $object = new QObject();				<br>
  * $object->setObjectName(new QString("hello string"));	<br>
  * $s = $object->objectName();		     		<br>
  * $s->toAscii()					<br>
  * </code>
  */
 function testAddQString()
 {
     echo "\ntesting QString as argument";
     $object = new QObject();
     $object->setObjectName(new QString("hello string"));
     $s = $object->objectName();
     $this->assertEquals($s->toAscii(), "hello string", "Return object does not contain the same text!");
     echo " passed";
 }
Esempio n. 12
0
<?php

/****************************************************************
 **
 ** Qt tutorial 3
 **
 ** original:
 ** http://doc.trolltech.com/4.1/tutorial-t3.html
 **
 ****************************************************************/
if (!extension_loaded('php_qt')) {
    dl('php_qt.' . PHP_SHLIB_SUFFIX);
}
$app = new QApplication($argc, $argv);
$window = new QWidget();
$window->resize(200, 120);
$quit = new QPushButton("Quit", $window);
$quit->setFont(new QFont("Times", 18, QFont::Bold));
$quit->setGeometry(10, 40, 180, 40);
QObject::connect($quit, SIGNAL('clicked()'), $app, SLOT('quit()'));
$window->show();
$app->exec();
Esempio n. 13
0
<?php

require_once 'treeitem.php';
require_once 'treemodel.php';
$app = new QApplication($argc, $argv);
$file = new QFile("default.txt");
$file->open(QIODevice::ReadOnly);
$model = new TreeModel($file->readAll());
$file->close();
$view = new QTreeView();
$view->setModel($model);
$view->setWindowTitle(QObject::tr("Simple Tree Model"));
$view->show();
$app->exec();