本文整理汇总了C++中DomProperty::elementString方法的典型用法代码示例。如果您正苦于以下问题:C++ DomProperty::elementString方法的具体用法?C++ DomProperty::elementString怎么用?C++ DomProperty::elementString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DomProperty
的用法示例。
在下文中一共展示了DomProperty::elementString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pixmap
bool Q3ListBoxExtraInfo::loadWidgetExtraInfo(DomWidget *ui_widget)
{
Q3ListBox *listBox = qobject_cast<Q3ListBox*>(widget());
Q_ASSERT(listBox != 0);
QList<DomItem *> items = ui_widget->elementItem();
for (int i = 0; i < items.size(); ++i) {
DomItem *item = items.at(i);
QHash<QString, DomProperty*> properties = propertyMap(item->elementProperty());
DomProperty *text = properties.value(QLatin1String("text"));
DomProperty *pixmap = properties.value(QLatin1String("pixmap"));
QString txt = text->elementString()->text();
if (pixmap != 0) {
DomResourcePixmap *pix = pixmap->elementPixmap();
QPixmap pixmap(core()->iconCache()->resolveQrcPath(pix->text(), pix->attributeResource(), workingDirectory()));
listBox->insertItem(pixmap, txt);
} else {
listBox->insertItem(txt);
}
}
return true;
}
示例2: pixmap
void Q3ListViewExtraInfo::initializeQ3ListViewItems(const QList<DomItem *> &items, Q3ListViewItem *parentItem)
{
for (int i=0; i<items.size(); ++i) {
DomItem *item = items.at(i);
Q3ListViewItem *__item = 0;
if (parentItem != 0)
__item = new Q3ListViewItem(parentItem);
else
__item = new Q3ListViewItem(static_cast<Q3ListView*>(widget()));
int textCount = 0, pixCount = 0;
QList<DomProperty*> properties = item->elementProperty();
for (int i=0; i<properties.size(); ++i) {
DomProperty *p = properties.at(i);
if (p->attributeName() == QLatin1String("text"))
__item->setText(textCount++, p->elementString()->text());
if (p->attributeName() == QLatin1String("pixmap")) {
DomResourcePixmap *pix = p->elementPixmap();
QPixmap pixmap(core()->iconCache()->resolveQrcPath(pix->text(), pix->attributeResource(), workingDirectory()));
__item->setPixmap(pixCount++, pixmap);
}
}
if (item->elementItem().size()) {
__item->setOpen(true);
initializeQ3ListViewItems(item->elementItem(), __item);
}
}
}
示例3: icon
bool Q3ListViewExtraInfo::loadWidgetExtraInfo(DomWidget *ui_widget)
{
Q3ListView *listView = qobject_cast<Q3ListView*>(widget());
Q_ASSERT(listView != 0);
Q3Header *header = listView->header();
QList<DomColumn*> columns = ui_widget->elementColumn();
for (int i=0; i<columns.size(); ++i) {
DomColumn *column = columns.at(i);
QHash<QString, DomProperty*> properties = propertyMap(column->elementProperty());
DomProperty *text = properties.value(QLatin1String("text"));
DomProperty *pixmap = properties.value(QLatin1String("pixmap"));
DomProperty *clickable = properties.value(QLatin1String("clickable"));
DomProperty *resizable = properties.value(QLatin1String("resizable"));
QString txt = text->elementString()->text();
if (pixmap != 0) {
DomResourcePixmap *pix = pixmap->elementPixmap();
QIcon icon(core()->iconCache()->resolveQrcPath(pix->text(), pix->attributeResource(), workingDirectory()));
listView->addColumn(icon, txt);
} else {
listView->addColumn(txt);
}
if (clickable != 0) {
header->setClickEnabled(clickable->elementBool() == QLatin1String("true"), header->count() - 1);
}
if (resizable != 0) {
header->setResizeEnabled(resizable->elementBool() == QLatin1String("true"), header->count() - 1);
}
}
if (ui_widget->elementItem().size()) {
initializeQ3ListViewItems(ui_widget->elementItem());
}
return true;
}
示例4: pixmap
void Q3IconViewExtraInfo::initializeQ3IconViewItems(const QList<DomItem *> &items)
{
Q3IconView *iconView = qobject_cast<Q3IconView*>(widget());
Q_ASSERT(iconView != 0);
for (int i=0; i<items.size(); ++i) {
DomItem *item = items.at(i);
Q3IconViewItem *__item = new Q3IconViewItem(iconView);
QList<DomProperty*> properties = item->elementProperty();
for (int i=0; i<properties.size(); ++i) {
DomProperty *p = properties.at(i);
if (p->attributeName() == QLatin1String("text"))
__item->setText(p->elementString()->text());
if (p->attributeName() == QLatin1String("pixmap")) {
DomResourcePixmap *pix = p->elementPixmap();
QPixmap pixmap(core()->iconCache()->resolveQrcPath(pix->text(), pix->attributeResource(), workingDirectory()));
__item->setPixmap(pixmap);
}
}
}
}