Utils: Remove check against 'autoapply' for some volatile aspect value

This was based on the wrong assumption that on !autoapply aspects
(i.e.  aspects in settings pages the non-applied value would never be
needed by user code. This is, however, not the case when e.g.
temporary checkbox states or values in comboboxes are used to
enable/disable parts of the ui while interacting with the page.

Change-Id: I4fe6a0df8137083a0a0faecc3ba20792caa5a747
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2023-05-17 16:34:54 +02:00
parent b1b9f54de7
commit 40d7fcc1d4

View File

@@ -1224,7 +1224,6 @@ void StringAspect::addToLayout(LayoutItem &parent)
QVariant StringAspect::volatileValue() const QVariant StringAspect::volatileValue() const
{ {
QTC_CHECK(!isAutoApply());
switch (d->m_displayStyle) { switch (d->m_displayStyle) {
case PathChooserDisplay: case PathChooserDisplay:
QTC_ASSERT(d->m_pathChooserDisplay, return {}); QTC_ASSERT(d->m_pathChooserDisplay, return {});
@@ -1519,7 +1518,6 @@ QAction *BoolAspect::action()
QVariant BoolAspect::volatileValue() const QVariant BoolAspect::volatileValue() const
{ {
QTC_CHECK(!isAutoApply());
if (d->m_button) if (d->m_button)
return d->m_button->isChecked(); return d->m_button->isChecked();
if (d->m_groupBox) if (d->m_groupBox)
@@ -1530,7 +1528,6 @@ QVariant BoolAspect::volatileValue() const
void BoolAspect::setVolatileValue(const QVariant &val) void BoolAspect::setVolatileValue(const QVariant &val)
{ {
QTC_CHECK(!isAutoApply());
if (d->m_button) if (d->m_button)
d->m_button->setChecked(val.toBool()); d->m_button->setChecked(val.toBool());
else if (d->m_groupBox) else if (d->m_groupBox)
@@ -1660,7 +1657,6 @@ void SelectionAspect::addToLayout(Layouting::LayoutItem &parent)
QVariant SelectionAspect::volatileValue() const QVariant SelectionAspect::volatileValue() const
{ {
QTC_CHECK(!isAutoApply());
switch (d->m_displayStyle) { switch (d->m_displayStyle) {
case DisplayStyle::RadioButtons: case DisplayStyle::RadioButtons:
QTC_ASSERT(d->m_buttonGroup, return {}); QTC_ASSERT(d->m_buttonGroup, return {});
@@ -1674,7 +1670,6 @@ QVariant SelectionAspect::volatileValue() const
void SelectionAspect::setVolatileValue(const QVariant &val) void SelectionAspect::setVolatileValue(const QVariant &val)
{ {
QTC_CHECK(!isAutoApply());
switch (d->m_displayStyle) { switch (d->m_displayStyle) {
case DisplayStyle::RadioButtons: { case DisplayStyle::RadioButtons: {
if (d->m_buttonGroup) { if (d->m_buttonGroup) {