forked from qt-creator/qt-creator
Toolchain Options Page: Hide widget
Sometimes on repeated and fast clicking the old widget wasn't hidden correctly. Change-Id: I0c00416593609a46b8c2229fdb855110deeb9354 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Tobias Hunger
parent
db7d64f15f
commit
fd43bdd563
@@ -573,7 +573,9 @@ void ToolChainOptionsPage::toolChainSelectionChanged()
|
|||||||
if (!m_container)
|
if (!m_container)
|
||||||
return;
|
return;
|
||||||
QModelIndex current = currentIndex();
|
QModelIndex current = currentIndex();
|
||||||
(void)m_container->takeWidget(); // Prevent deletion.
|
QWidget *oldWidget = m_container->takeWidget(); // Prevent deletion.
|
||||||
|
if (oldWidget)
|
||||||
|
oldWidget->setVisible(false);
|
||||||
QWidget *currentTcWidget = current.isValid() ? m_model->widget(current) : 0;
|
QWidget *currentTcWidget = current.isValid() ? m_model->widget(current) : 0;
|
||||||
m_container->setWidget(currentTcWidget);
|
m_container->setWidget(currentTcWidget);
|
||||||
m_container->setVisible(currentTcWidget != 0);
|
m_container->setVisible(currentTcWidget != 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user