本文整理汇总了C++中QTreeWidget::collapseAll方法的典型用法代码示例。如果您正苦于以下问题:C++ QTreeWidget::collapseAll方法的具体用法?C++ QTreeWidget::collapseAll怎么用?C++ QTreeWidget::collapseAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTreeWidget
的用法示例。
在下文中一共展示了QTreeWidget::collapseAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
dmz::V8Value
dmz::JsModuleUiV8QtBasic::_tree_collapse_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->collapseAll (); }
}
return scope.Close (result);
}
示例2: 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);
}
示例3: resizeTree
void StatsView::resizeTree() {
QTreeWidget *statsTree = this->findChild<QTreeWidget *>("statsTree");
statsTree->expandAll();
statsTree->resizeColumnToContents(0);
statsTree->collapseAll();
}