当前位置: 首页>>代码示例>>PHP>>正文


PHP QApplication::instance方法代码示例

本文整理汇总了PHP中QApplication::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP QApplication::instance方法的具体用法?PHP QApplication::instance怎么用?PHP QApplication::instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QApplication的用法示例。


在下文中一共展示了QApplication::instance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 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();
 }
开发者ID:Shadrackn,项目名称:php-qt,代码行数:35,代码来源:main.php

示例2: testObjectBack

 function testObjectBack()
 {
     echo "\ntesting getting object back";
     $this->assertEquals(is_object(QApplication::instance()), true, "Could not fetch instance of QApplication!");
     // we need this, otherwise ZE would destroy $app too early
     QTimer::singleShot(100, QApplication::instance(), SLOT("quit()"));
     echo " passed";
 }
开发者ID:Shadrackn,项目名称:php-qt,代码行数:8,代码来源:QtApplicationTestCase.php

示例3: setupConnections

 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)'));
 }
开发者ID:0xd34df00d,项目名称:Qross,代码行数:13,代码来源:callbackTests.php

示例4: __construct

 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();
 }
开发者ID:BackupTheBerlios,项目名称:php-qt-svn,代码行数:21,代码来源:main.php


注:本文中的QApplication::instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。