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


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

本文整理汇总了C++中QTreeWidget::expandAll方法的典型用法代码示例。如果您正苦于以下问题:C++ QTreeWidget::expandAll方法的具体用法?C++ QTreeWidget::expandAll怎么用?C++ QTreeWidget::expandAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QTreeWidget的用法示例。


在下文中一共展示了QTreeWidget::expandAll方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: CreateStructureWidget

QWidget* CarManagePage::CreateStructureWidget()
{
	QGroupBox* structureWidget = new QGroupBox();

	QHBoxLayout* hBox = new QHBoxLayout();
	QToolButton* add = new QToolButton();
	add->setText("+");
	QToolButton* remove = new QToolButton();
	remove->setText( "-" );
	hBox->addWidget( add );
	hBox->addWidget( remove );
	hBox->addStretch( 1 );

	QTreeWidget* tree = new QTreeWidget();
	tree->setColumnCount( 1 );
	QTreeWidgetItem* root = new QTreeWidgetItem( QStringList( tr( "DaQing GPS Center") ) );
	QTreeWidgetItem* child1 = new QTreeWidgetItem( QStringList( tr( "test1" ) ) );
	QTreeWidgetItem* child2 = new QTreeWidgetItem( QStringList( tr( "test2" ) ) );
	root->addChild( child1 );
	root->addChild( child2 );
	root->setCheckState( 0, Qt::Unchecked );
	child1->setCheckState( 0, Qt::Unchecked );
	child2->setCheckState( 0, Qt::Unchecked );

	tree->addTopLevelItem( root );
	tree->expandAll();
	QVBoxLayout* vBox = new QVBoxLayout();
	vBox->addLayout( hBox );
	vBox->addWidget( tree );

	structureWidget->setLayout( vBox );
	return structureWidget;
}
开发者ID:zhygit,项目名称:QtTestGui,代码行数:33,代码来源:carmanagepage.cpp

示例3: modelModelCodeFiles

void OutputWindow::modelModelCodeFiles(const QStringList &sl)
{
    QTreeWidget * tree = ui->treeProject;
    QTreeWidgetItem* root = tree->topLevelItem(0);
    //Remove and return children list
    root->takeChildren();

    for(int i=0; i<sl.size(); ++i) {
        //        QString flabspath = sl.at(i);
        //        QString xlpath = flabspath.left(flabspath.lastIndexOf("/")).replace(modelFolder, tr(""));
        //        QString xlfile = flabspath.right(flabspath.length() -1 - flabspath.lastIndexOf("/") );
        QFileInfo info(sl.at(i));
        QString xlpath = info.absolutePath().replace(modelFolder, tr(""));
        QString xlfile = info.fileName();
        QString flabspath = info.absoluteFilePath();
        if(xlpath.compare("")!=0) {
            bool inserted = false;
            for(int j = 0; j<root->childCount(); ++j) {
                if(root->child(j)->text(0).compare(xlpath, Qt::CaseInsensitive) == 0) {
                    QTreeWidgetItem* item = new QTreeWidgetItem(
                                root->child(j),
                                QStringList(xlfile));
                    item->setIcon(0, GetIcon(xlfile) );
                    item->setData(0, Qt::UserRole, flabspath);
                    //                    item->setIcon(0, style()->standardIcon(QStyle::SP_FileIcon) );
                    inserted= true;
                    break;//for-j
                }
            }
            if(!inserted) {
                QTreeWidgetItem* path = new QTreeWidgetItem(
                            root,
                            QStringList(xlpath) );
                path->setIcon(0, style()->standardIcon(QStyle::SP_DirIcon));
                //path->setIcon(0, QIcon(px.copy(4*px_width,4*px_height,  px_width,px_height)));
                QTreeWidgetItem* item = new QTreeWidgetItem(
                            path,
                            QStringList(xlfile));
                //                item->setIcon(0, style()->standardIcon(QStyle::SP_FileIcon) );
                item->setIcon(0, GetIcon(xlfile) );
                item->setData(0, Qt::UserRole, flabspath );
                //                root->addChild(path);
            }
        } else { //path is empty


            QTreeWidgetItem* item = new QTreeWidgetItem(
                        root,
                        QStringList(xlfile));
            item->setIcon(0, GetIcon(xlfile) );
            item->setData(0, Qt::UserRole, flabspath );
        }
    }
    tree->expandAll();
}
开发者ID:LMiceOrg,项目名称:Modelingtools,代码行数:55,代码来源:outputwindow.cpp

示例4: modelExcelListChanged

void OutputWindow::modelExcelListChanged(const QStringList &sl)
{
    QTreeWidget* tree = ui->treeWidget;
    QTreeWidgetItem* root = tree->topLevelItem(0);

    //Remove and return children list
    root->takeChildren();

    for(int i=0; i<sl.size(); ++i) {
        modelExcelAddFile(sl.at(i));
    }
    tree->expandAll();
}
开发者ID:LMiceOrg,项目名称:Modelingtools,代码行数:13,代码来源:outputwindow.cpp

示例5: rebuildSceneGraph

void SceneDockWidget::rebuildSceneGraph()
{
    SceneData* data = controller->getSceneData();

    QTreeWidget* sceneGraph = ui->treeWidgetSceneGraph;

    QTreeWidgetItem* top;
    while((top = sceneGraph->takeTopLevelItem(0)) != 0);

    QTreeWidgetItem* root = createNodeItem(data->rootNode);
    sceneGraph->addTopLevelItem(root);

    sceneGraph->expandAll();
}
开发者ID:madrenegade,项目名称:PGameStudio,代码行数:14,代码来源:scenedockwidget.cpp

示例6:

dmz::V8Value
dmz::JsModuleUiV8QtBasic::_tree_expand_all (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) { tree->expandAll (); }
   }

   return scope.Close (result);
}
开发者ID:bstewart33,项目名称:js,代码行数:15,代码来源:dmzJsModuleUiV8QtBasicTreeWidget.cpp

示例7: modelDataStructFiles

void OutputWindow::modelDataStructFiles(const QStringList &sl)
{
    QTreeWidget * tree = ui->treeDataStruct;
    QTreeWidgetItem* root = tree->topLevelItem(0);
    //Remove and return children list
    root->takeChildren();

    for(int i=0; i<sl.size(); ++i) {
        QFileInfo info(sl.at(i));
        QString xmlfile = info.fileName();
        QTreeWidgetItem* item = new QTreeWidgetItem(root, QStringList( xmlfile ));
        //        item->setIcon(0, style()->standardIcon(QStyle::SP_DriveNetIcon));
        item->setIcon(0, *xmlIcon);
        item->setData(0, Qt::UserRole, info.absoluteFilePath() );
    }
    tree->expandAll();

}
开发者ID:LMiceOrg,项目名称:Modelingtools,代码行数:18,代码来源:outputwindow.cpp

示例8: populateSkillTree

void SkillEditFrame::populateSkillTree() {
	QTreeWidget *skillTree = this->findChild<QTreeWidget *>("skillTree");
	for (int i=0; i<skillStats->size(); ++i) {
		StatsContainer *skill = skillStats->at(i);
		std::string abilityText = skill->getData("Ability");
		std::string elementText = skill->getData("Element");
		if (elementText.size() == 0) {
			elementText = "Unknown";
		}
		std::string skillText = skill->getData("DisplayNameRef");
		std::string skillInternalText = skill->getArg(0);
		QTreeWidgetItem *abilityFolder = createFolderIfNeeded(skillTree->invisibleRootItem(), abilityText.c_str(), 0);
		QTreeWidgetItem *elementFolder = createFolderIfNeeded(abilityFolder, elementText.c_str(), 0);
		createFolderIfNeeded(elementFolder, skillText.c_str(), skillInternalText.c_str());
	}
	skillTree->setUpdatesEnabled(false);
	skillTree->expandAll();
	skillTree->resizeColumnToContents(0);
	skillTree->collapseAll();
	skillTree->setUpdatesEnabled(true);
}
开发者ID:mishley,项目名称:MooseEdit,代码行数:21,代码来源:SkillEditFrame.cpp

示例9: QWidget

QWidget *PluginAboutPage::createPage(QWidget *parent)
{
    if (!m_Spec)
        return new QWidget(parent);

    QWidget *w = new QWidget(parent);
    QVBoxLayout *layout = new QVBoxLayout(w);
    layout->setSpacing(0);
    layout->setMargin(0);
    QTreeWidget *tree = new QTreeWidget(w);
    tree->header()->hide();
    layout->addWidget(tree);
    QLabel *lbl = new QLabel(w);
    lbl->setText(tkTr(Trans::Constants::DESCRIPTION));
    layout->addWidget(lbl);
    QTextBrowser *tb = new QTextBrowser(w);
    layout->addWidget(tb);

    // popuplate tree
    tree->clear();
    QFont f;
    f.setBold(true);
    QTreeWidgetItem *i = 0;
    i = new QTreeWidgetItem(tree, QStringList() << tkTr(Trans::Constants::INFORMATION));
    i->setFont(0,f);
    new QTreeWidgetItem(i, QStringList() << tkTr(Trans::Constants::VERSION) + " " + m_Spec->version() );
    if (Utils::isDebugWithoutInstallCompilation()) {
        new QTreeWidgetItem( i, QStringList() << tkTr(Trans::Constants::BUILD_DEBUG) + " - no install");
    } else {
        new QTreeWidgetItem( i, QStringList() << tkTr(Trans::Constants::BUILD_RELEASE) );
    }
    new QTreeWidgetItem(i, QStringList() << "License: " + m_Spec->license());
    tree->expandAll();

    // populate textbrowser
    tb->setPlainText(m_Spec->description());

    return w;
}
开发者ID:NyFanomezana,项目名称:freemedforms,代码行数:39,代码来源:pluginaboutpage.cpp

示例10: item

// Slot.
void
TransitionEditorWindow::updateEquationsTree()
{
	if (model_ == nullptr) return;

	QTreeWidget* tree = ui_->equationsTree;

	tree->clear();
	for (const auto& group : model_->equationGroupList()) {
		std::unique_ptr<QTreeWidgetItem> item(new QTreeWidgetItem);
		item->setText(0, group.name.c_str());
		item->setFlags(Qt::ItemIsEnabled);

		for (const auto& equation : group.equationList) {
			std::unique_ptr<QTreeWidgetItem> childItem(new QTreeWidgetItem);
			childItem->setText(0, equation->name().c_str());
			childItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
			item->addChild(childItem.release());
		}

		tree->addTopLevelItem(item.release());
	}
	tree->expandAll();
}
开发者ID:mymatuda,项目名称:gama_tts_editor,代码行数:25,代码来源:TransitionEditorWindow.cpp

示例11: updateViewTree

// Update the tree widget to show datasets, pipelines and views
void HandleViewList::updateViewTree() {
	QTreeWidget* viewTree = m_viewListDock->m_viewTree;

	viewTree->clear();

	// Get the active window No. We will select it in the tree widget
	int activeWinNo = m_viewManager->getActiveViewWindowNo();
	QTreeWidgetItem * currentItem = 0;

	int i,j,k;
	QList<QTreeWidgetItem *> datasets;
	// Traverse all original dataset
	for ( i=0; i<m_pipelineManager->getOrigDatasetsCount(); i++) {
		Data* data = m_pipelineManager->getOrigDataset(i);
		if ( data ) {
			// We assume that all data is OkcData
			OkcData* okcdata = dynamic_cast<OkcData*>(data);
			DatasetItem* newDatasetItem = new DatasetItem( (QTreeWidget*)0, okcdata->filename, data);

			// Search all pipelines to find those associated with this data
			QList<QTreeWidgetItem *> pipelines;
			for ( j=0; j<m_pipelineManager->getPipelinesCount(); j++ ) {
				Pipeline* pl = m_pipelineManager->getPipeline(j);
				if (!pl) {
					// If this is a null pointer, the pipeline has been removed
					continue;
				}
				int pipelineID = pl->getPipelineID();
				if ( pl->getOrigDataset()==data ) {
					PipelineItem* newPipelineItem = 0;
					// If this pipeline is associated with this data
					switch  ( pl->getPipelineType() ) {
					case XmdvTool::PLTYPE_FLATNORMAL :
						newPipelineItem = new PipelineItem( (QTreeWidget*)0, "Flat Data Mode Pipeline", pl );
						break;
					case XmdvTool::PLTYPE_SBB :
						newPipelineItem = new PipelineItem( (QTreeWidget*)0, "Hierarchical Data Mode Pipeline", pl );
						break;
					case XmdvTool::PLTYPE_DIMR :
						newPipelineItem = new PipelineItem( (QTreeWidget*)0, "Hierarchical Dimension Mode Pipeline", pl );
						break;
					}

					QList<QTreeWidgetItem *> views;
					int viewNo = 0;
					for ( k=0; k<m_viewManager->getViewWindowsCount(); k++ ) {
						ViewWindow* win = m_viewManager->getViewWindow(k);
						if ( !win ){
							// If this is a null pointer, the view has been removed
							continue;
						}
						if (win && win->getPipelineID()==pipelineID ) {
							ViewItem* newViewItem =
								new ViewItem((QTreeWidget*)0,
										ViewWindow::createViewName( win->getOrder() ),
										win );
							viewNo++;
							views.append( newViewItem);

							// If this is the active view, we record it to set as the current item
							// after we finish initializing the tree widget
							if ( k == activeWinNo ) {
								currentItem = (QTreeWidgetItem*)newViewItem;
							}
						}
					}
					// Add the view nodes as the children of the pipeline node
					newPipelineItem->addChildren (views);

					pipelines.append( newPipelineItem );
				}
			}

			// Add the pipeline nodes as the children of the dataset node
			newDatasetItem->addChildren(pipelines);

			datasets.append( newDatasetItem );
		}
	}

	viewTree->insertTopLevelItems(0, datasets);
	viewTree->setCurrentItem(currentItem, 0, QItemSelectionModel::SelectCurrent);

	viewTree->expandAll ();
}
开发者ID:63n,项目名称:XmdvTool,代码行数:86,代码来源:HandleViewList.cpp

示例12: resizeTree

void StatsView::resizeTree() {
	QTreeWidget *statsTree = this->findChild<QTreeWidget *>("statsTree");
	statsTree->expandAll();
	statsTree->resizeColumnToContents(0);
	statsTree->collapseAll();
}
开发者ID:mishley,项目名称:MooseEdit,代码行数:6,代码来源:StatsView.cpp


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