Beispiel #1
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);
 }
Beispiel #2
0
 public function __construct()
 {
     parent::__construct();
     $this->layout = new QVBoxLayout($this);
     // Load the test xml
     $unicodeXml = new DOMDocument();
     $unicodeXml->load("unicode.xml");
     $xpath = new DOMXPath($unicodeXml);
     $dataNodes = $xpath->query("/test/data");
     // Loop on all data node and create buttons
     foreach ($dataNodes as $data) {
         $this->buttons[] = new QLineEdit(QString::fromUtf8($data->nodeValue, -1), $this);
         foreach ($data->attributes as $attribute) {
             $this->layout->addWidget(new QLabel($attribute->name . ": " . $attribute->value));
         }
         $this->layout->addWidget($this->buttons[count($this->buttons) - 1]);
     }
     $this->buttons[] = new QLineEdit("Test", $this);
     $this->layout->addWidget($this->buttons[count($this->buttons) - 1]);
     $this->buttons[] = new QLineEdit("second Test", $this);
     $this->layout->addWidget($this->buttons[count($this->buttons) - 1]);
 }