本文整理汇总了C++中QTreeWidget::columnCount方法的典型用法代码示例。如果您正苦于以下问题:C++ QTreeWidget::columnCount方法的具体用法?C++ QTreeWidget::columnCount怎么用?C++ QTreeWidget::columnCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTreeWidget
的用法示例。
在下文中一共展示了QTreeWidget::columnCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reloadGui
void PListEditorWidget::reloadGui(void )
{
QTreeWidget* tree = m_ui.plistTree;
tree->clear();
QTreeWidgetItem* rootNode = NULL;
if (m_currentPlist)
{
// Add information
if (m_currentPlist->GetType() == PLIST_ARRAY)
{
rootNode = generateArrayItem (m_currentPlist);
rootNode->setText (NameColumn, "Root");
}
else if (m_currentPlist->GetType() == PLIST_DICT)
{
rootNode = generateDictionaryItem (m_currentPlist);
rootNode->setText (NameColumn, "Root");
}
}
if (rootNode)
tree->addTopLevelItem(rootNode);
tree->expandAll();
for (int x=0; x < tree->columnCount(); ++x)
tree->resizeColumnToContents(x);
}
示例2:
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_tree_col_count (const v8::Arguments &Args) {
v8::HandleScope scope;
V8Value result = v8::Undefined ();
JsModuleUiV8QtBasic *self = _to_self (Args);
if (self) {
QTreeWidget *tree = self->v8_to_qobject<QTreeWidget> (Args.This ());
if (tree) {
if (Args.Length ()) { tree->setColumnCount (v8_to_uint32 (Args[0])); }
result = v8::Number::New (tree->columnCount ());
}
}
return scope.Close (result);
}
示例3: nCols
SimpleQTreeWidgetWidthInterface::SimpleQTreeWidgetWidthInterface(QTreeWidget& tbl) : TableWidthInterface(tbl.columnCount()), m_tbl(tbl)
{
int nCols (m_tbl.columnCount());
m_vbBold.resize(nCols);
QFont font (m_tbl.font());
font.setBold(true);
QFontMetrics fontMetrics (font);
QHeaderView* pHdr (tbl.header());
for (int j = 0; j < nCols; ++j)
{
if (pHdr->isSectionHidden(j))
{
setFixedWidth(j, 0);
}
else
{
m_vnHdrWidth[j] = fontMetrics.width(m_tbl.headerItem()->text(j)) + 8/*2*QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth)*/; // PM_DefaultFrameWidth is not THE thing to use, but it's one way to get some spacing for the header; (well it turned up to be too small, so it got replaced by 8; probably look at the source to see what should be used)
}
}
}