Exemple #1
0
 public function __construct($designer, $parent = 0)
 {
     if ($parent == 0) {
         parent::__construct();
     } else {
         parent::__construct($parent);
     }
     $this->designer = $designer;
     $this->setPHPEventListener($this, eventListener);
     $this->addPHPEventListenerType(QEvent::ContextMenu);
     $this->addPHPEventListenerType(QEvent::Show);
     $this->addPHPEventListenerType(QEvent::Resize);
     $this->addPHPEventListenerType(QEvent::MouseButtonRelease);
     $this->objectName = '___pq_formwidget_';
     $this->styleSheet = '#___pq_formwidget_ { border:1px dashed #222; margin:10px; } ';
     $this->borderWidget = new QFrame($this);
     $this->borderWidget->objectName = '___pq_formwidget__borderwidget_';
     $this->borderWidget->styleSheet = '#___pq_formwidget__borderwidget_ { border:7px solid #aaa; background:#f0f0f0;}';
     $this->centralWidget = new QWidget($this->borderWidget);
     $this->centralWidget->objectName = '___pq_formwidget__centralwidget_';
     $this->centralWidget->m_lockParentClassEvents = true;
     $this->centralWidget->setPHPEventListener($this, eventListener);
     $this->centralWidget->addPHPEventListenerType(QEvent::Paint);
     $borderWidget_layout = new QHBoxLayout();
     $borderWidget_layout->setMargin(0);
     $borderWidget_layout->addWidget($this->centralWidget);
     $layout = new QHBoxLayout();
     $layout->setMargin(0);
     $layout->addWidget($this->borderWidget);
     $this->borderWidget->setLayout($borderWidget_layout);
     $this->setLayout($layout);
     $this->penStyle = Qt::SolidLine;
 }
Exemple #2
0
<?php

require_once 'QFrame/Loader.php';
require_once 'auto_load.php';
$webApp = QFrame::createWebApp();
$webApp->throwException(QFrameConfig::getConfig('EXCEPTION'));
//自定义ControllerPath
//$webApp->setControllerPath('/home/chenchao/project/fw/example/src/application/controllers/');
//$webApp->setViewPath('/home/chenchao/project/test/src/application/testview/scripts/');
/*
* 自定义路由规则
*
 $userroute = new QFrameStandRoute(
      'u/:qid',
      array(
             'controller' => 'my',
             'action'     => 'index',
      )
);
QFrameContainer::find('QFrameRouter')->addRoute('user',$userroute);
*/
$webApp->run();