font.setWeight(QFont::Normal);
item->setFont(1,font);
- const bool hide_default_items = gui_settings->value("Settings/hideDefault", false).toBool();
- if (hide_default_items)
+ const bool hide_items_with_default_value = gui_settings->value("Settings/hideDefault", false).toBool();
+ if (hide_items_with_default_value)
item->setHidden(true);
}
else
if (hide_default_values)
{
for (int i = 0; i < tree_widget->topLevelItemCount(); ++i)
- hide_default_item(tree_widget->topLevelItem(i));
+ hide_item_with_default_value(tree_widget->topLevelItem(i));
hide_default->setChecked(true);
}
else
- bool MainWindow::hide_default_item(QTreeWidgetItem *item)
+ bool MainWindow::hide_item_with_default_value(QTreeWidgetItem *item)
{
bool has_default_value = true;
}
else
{
+ // If this element has children recurse into them and check for default values
for (int i = 0; i < item->childCount(); ++i)
{
- const bool child_has_default_value = hide_default_item(item->child(i));
+ const bool child_has_default_value = hide_item_with_default_value(item->child(i));
has_default_value = has_default_value & child_has_default_value;
}
}
* and hide all default items. Returns true if the item and all of its
* children have default values.
*/
- bool hide_default_item(QTreeWidgetItem *item);
+ bool hide_item_with_default_value(QTreeWidgetItem *item);
/**
* This is the tree structure in which we store all parameters.