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