本文整理汇总了C++中KComboBox::text方法的典型用法代码示例。如果您正苦于以下问题:C++ KComboBox::text方法的具体用法?C++ KComboBox::text怎么用?C++ KComboBox::text使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KComboBox
的用法示例。
在下文中一共展示了KComboBox::text方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
bool
StdWidgetFactory::saveSpecialProperty(const QCString &classname, const QString &name, const QVariant &, QWidget *w, QDomElement &parentNode, QDomDocument &domDoc)
{
if(name == "list_items" && classname == "KComboBox")
{
KComboBox *combo = (KComboBox*)w;
for(int i=0; i < combo->count(); i++)
{
QDomElement item = domDoc.createElement("item");
KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "text", combo->text(i));
parentNode.appendChild(item);
}
return true;
}
else if(name == "list_items" && classname == "KListBox")
{
KListBox *listbox = (KListBox*)w;
for(uint i=0; i < listbox->count(); i++)
{
QDomElement item = domDoc.createElement("item");
KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "text", listbox->text(i));
parentNode.appendChild(item);
}
return true;
}
else if(name == "list_contents" && classname == "KListView")
{
KListView *listview = (KListView*)w;
// First we save the columns
for(int i = 0; i < listview->columns(); i++)
{
QDomElement item = domDoc.createElement("column");
KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "text", listview->columnText(i));
KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "width", listview->columnWidth(i));
KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "resizable", listview->header()->isResizeEnabled(i));
KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "clickable", listview->header()->isClickEnabled(i));
KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "fullwidth", listview->header()->isStretchEnabled(i));
parentNode.appendChild(item);
}
// Then we save the list view items
QListViewItem *item = listview->firstChild();
while(item)
{
saveListItem(item, parentNode, domDoc);
item = item->nextSibling();
}
return true;
}
return false;
}