Utils: Make Aspect::addToLayout() const

It's conceptionally const, and would be useful to use as such, but
the current implementations often modifie mutable state.

To ease the transition pain, rename the previous non-const version to
addToLayoutImpl() and call it after const_cast'ing.

Change-Id: Ic8ca38e40f5df69c3d11121f96ea37648cf4feb7
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
hjk
2024-07-02 15:24:47 +02:00
parent d34d716c37
commit 9e413cb458
35 changed files with 108 additions and 100 deletions

View File

@@ -149,7 +149,7 @@ private:
// KitAspectWidget interface
void makeReadOnly() override { m_comboBox->setEnabled(false); }
void addToLayoutImpl(Layouting::Layout &builder) override
void addToInnerLayout(Layouting::Layout &builder) override
{
addMutableAction(m_comboBox);
builder.addItem(m_comboBox);
@@ -377,7 +377,7 @@ private:
// KitAspectWidget interface
void makeReadOnly() override { m_changeButton->setEnabled(false); }
void addToLayoutImpl(Layouting::Layout &parent) override
void addToInnerLayout(Layouting::Layout &parent) override
{
addMutableAction(m_label);
parent.addItem(m_label);
@@ -888,7 +888,7 @@ public:
private:
// KitAspectWidget interface
void addToLayoutImpl(Layouting::Layout &parent) override
void addToInnerLayout(Layouting::Layout &parent) override
{
addMutableAction(m_summaryLabel);
parent.addItem(m_summaryLabel);