本文整理汇总了PHP中QString::fromUtf8方法的典型用法代码示例。如果您正苦于以下问题:PHP QString::fromUtf8方法的具体用法?PHP QString::fromUtf8怎么用?PHP QString::fromUtf8使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QString
的用法示例。
在下文中一共展示了QString::fromUtf8方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setupUi
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);
}
示例2: __construct
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]);
}