当前位置: 首页>>代码示例>>C++>>正文


C++ QTreeWidget::columnCount方法代码示例

本文整理汇总了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);
}
开发者ID:thothonegan,项目名称:KPlistEditor,代码行数:30,代码来源:plisteditorwidget.cpp

示例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);
}
开发者ID:bstewart33,项目名称:js,代码行数:19,代码来源:dmzJsModuleUiV8QtBasicTreeWidget.cpp

示例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)
        }
    }
}
开发者ID:wangd,项目名称:mp3diags,代码行数:23,代码来源:ColumnResizer.cpp


注:本文中的QTreeWidget::columnCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。