Gui: modernize C++: use default member init

This commit is contained in:
wmayer
2023-08-23 16:29:19 +02:00
committed by wwmayer
parent 1cf1a90a17
commit 6beace8da6
79 changed files with 220 additions and 325 deletions

View File

@@ -199,7 +199,7 @@ public:
DocumentItem* docItem;
DocumentObjectItems items;
ViewProviderDocumentObject* viewObject;
DocumentObjectItem* rootItem;
DocumentObjectItem* rootItem{nullptr};
std::vector<App::DocumentObject*> children;
std::set<App::DocumentObject*> childSet;
bool removeChildrenFromRoot;
@@ -214,7 +214,8 @@ public:
Connection connectStat;
DocumentObjectData(DocumentItem* docItem, ViewProviderDocumentObject* vpd)
: docItem(docItem), viewObject(vpd), rootItem(nullptr)
: docItem(docItem)
, viewObject(vpd)
{
//NOLINTBEGIN
// Setup connections
@@ -2433,13 +2434,13 @@ void TreeWidget::slotActiveDocument(const Gui::Document& Doc)
struct UpdateDisabler {
QWidget& widget;
int& blocked;
bool visible;
bool focus;
bool visible{false};
bool focus{false};
// Note! DO NOT block signal here, or else
// QTreeWidgetItem::setChildIndicatorPolicy() does not work
UpdateDisabler(QWidget& w, int& blocked)
: widget(w), blocked(blocked), visible(false), focus(false)
: widget(w), blocked(blocked)
{
if (++blocked > 1)
return;