From 6c7cd2abf0a981f37708dd38d0e7085ed31db5cb Mon Sep 17 00:00:00 2001 From: Guthrie Adams Date: Mon, 27 Sep 2021 18:50:33 -0500 Subject: [PATCH] =?UTF-8?q?Atom=20Tools:=20Fixing=20problems=20with=20insp?= =?UTF-8?q?ector=20property=20group=20layout=20and=20deletion=20=E2=80=A2?= =?UTF-8?q?=20A=20previous=20change=20introduced=20a=20heading=20section?= =?UTF-8?q?=20of=20the=20top=20of=20the=20inspector=20=E2=80=A2=20The=20co?= =?UTF-8?q?de=20was=20incorrectly=20attempting=20to=20delete=20child=20wid?= =?UTF-8?q?gets=20and=20layouts=20from=20the=20layout=20of=20each=20sectio?= =?UTF-8?q?n=20=E2=80=A2=20Size=20policies=20were=20also=20updated=20to=20?= =?UTF-8?q?give=20priority=20to=20the=20section=20containing=20the=20prope?= =?UTF-8?q?rty=20groups=20=E2=80=A2=20Tested=20material=20component=20prop?= =?UTF-8?q?erty=20editor=20and=20material=20editor=20to=20make=20sure=20th?= =?UTF-8?q?at=20widgets=20were=20laid=20out=20correctly=20at=20the=20top?= =?UTF-8?q?=20of=20the=20inspector?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Guthrie Adams --- .../Code/Source/Inspector/InspectorWidget.cpp | 18 +- .../Code/Source/Inspector/InspectorWidget.ui | 169 ++++++++---------- 2 files changed, 87 insertions(+), 100 deletions(-) diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.cpp index 5eda93ca59..5ef2dbb2c5 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.cpp @@ -31,20 +31,26 @@ namespace AtomToolsFramework void InspectorWidget::AddHeading(QWidget* headingWidget) { - headingWidget->setParent(m_ui->m_headingSection); - m_ui->m_headingSectionLayout->addWidget(headingWidget); + headingWidget->setParent(this); + m_ui->m_headingContentsLayout->addWidget(headingWidget); } void InspectorWidget::ClearHeading() { - qDeleteAll(m_ui->m_headingSection->findChildren(QString(), Qt::FindDirectChildrenOnly)); - qDeleteAll(m_ui->m_headingSectionLayout->children()); + while (QLayoutItem* child = m_ui->m_headingContentsLayout->takeAt(0)) + { + delete child->widget(); + delete child; + } } void InspectorWidget::Reset() { - qDeleteAll(m_ui->m_groupContents->findChildren(QString(), Qt::FindDirectChildrenOnly)); - qDeleteAll(m_ui->m_groupContentsLayout->children()); + while (QLayoutItem* child = m_ui->m_groupContentsLayout->takeAt(0)) + { + delete child->widget(); + delete child; + } m_groups.clear(); } diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.ui b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.ui index 13f9c9e41c..c197ee172e 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.ui +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.ui @@ -30,104 +30,85 @@ 0 - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::ScrollBarAsNeeded - - 0 + + true - - 0 - - - 0 - - - 0 - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Qt::ScrollBarAsNeeded + + + + 0 + 0 + 679 + 767 + + + + + 0 + 0 + + + + + 0 - - true + + 0 - - - - 0 - 0 - 683 - 763 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - + + 0 + + + 0 + + + 0 + + + + + +