本文整理汇总了C++中Q3Header::label方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3Header::label方法的具体用法?C++ Q3Header::label怎么用?C++ Q3Header::label使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3Header
的用法示例。
在下文中一共展示了Q3Header::label方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DomColumn
bool Q3ListViewExtraInfo::saveWidgetExtraInfo(DomWidget *ui_widget)
{
// ### finish me
Q3ListView *listView = qobject_cast<Q3ListView*>(widget());
Q_ASSERT(listView != 0);
QList<DomColumn*> columns;
Q3Header *header = listView->header();
for (int i=0; i<header->count(); ++i) {
DomColumn *c = new DomColumn();
QList<DomProperty*> properties;
DomString *str = new DomString();
str->setText(header->label(i));
DomProperty *ptext = new DomProperty();
ptext->setAttributeName(QLatin1String("text"));
ptext->setElementString(str);
DomProperty *pclickable = new DomProperty();
pclickable->setAttributeName(QLatin1String("clickable"));
pclickable->setElementBool(header->isClickEnabled(i) ? QLatin1String("true") : QLatin1String("false"));
DomProperty *presizable = new DomProperty();
presizable->setAttributeName(QLatin1String("resizable"));
presizable->setElementBool(header->isResizeEnabled(i) ? QLatin1String("true") : QLatin1String("false"));
properties.append(ptext);
properties.append(pclickable);
properties.append(presizable);
c->setElementProperty(properties);
columns.append(c);
}
ui_widget->setElementColumn(columns);
QList<DomItem *> items;
Q3ListViewItem *child = listView->firstChild();
while (child) {
items.append(saveQ3ListViewItem(child));
child = child->nextSibling();
}
ui_widget->setElementItem(items);
return true;
}
示例2: contentsMouseDoubleClickEvent
void toListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
{
#if 0 // todo
QPoint p = e->pos();
int col = headerItem()->sectionAt(p.x());
toTreeWidgetItem *item = itemAt(contentsToViewport(p));
toResultViewItem *resItem = dynamic_cast<toResultViewItem *>(item);
toResultViewCheck *chkItem = dynamic_cast<toResultViewCheck *>(item);
QClipboard *clip = qApp->clipboard();
if (resItem)
clip->setText(resItem->allText(col));
else if (chkItem)
clip->setText(chkItem->allText(col));
else if (item)
clip->setText(item->text(col));
Q3Header *head = header();
for (int i = 0; i < columns(); i++)
{
QString str;
if (resItem)
str = resItem->allText(i);
else if (chkItem)
str = chkItem->allText(col);
else if (item)
str = item->text(i);
try
{
toParamGet::setDefault(toCurrentConnection(this),
head->label(i).lower(), toUnnull(str));
}
catch (...) {}
}
toTreeWidget::contentsMouseDoubleClickEvent(e);
#endif
}