forked from qt-creator/qt-creator
TextEditor: Prevent flashing window when switching to QML outline
The reason for the flashing is that the toolbuttons in the toolbar are constructed without initial parent. The Filter toolbutton is set to visible before it is parented, and therefore it creates a top-level window. Milliseconds later it gets a parent and the window disappears. Task-number: QTCREATORBUG-18823 Change-Id: Ide100d9117484131007a4d4d2e584d0967aa7377 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -62,7 +62,11 @@ OutlineWidgetStack::OutlineWidgetStack(OutlineFactory *factory) :
|
|||||||
connect(m_toggleSync, &QAbstractButton::clicked,
|
connect(m_toggleSync, &QAbstractButton::clicked,
|
||||||
this, &OutlineWidgetStack::toggleCursorSynchronization);
|
this, &OutlineWidgetStack::toggleCursorSynchronization);
|
||||||
|
|
||||||
m_filterButton = new QToolButton;
|
m_filterButton = new QToolButton(this);
|
||||||
|
// The ToolButton needs a parent because updateFilterMenu() sets
|
||||||
|
// it visible. That would open a top-level window if the button
|
||||||
|
// did not have a parent in that moment.
|
||||||
|
|
||||||
m_filterButton->setIcon(Utils::Icons::FILTER.icon());
|
m_filterButton->setIcon(Utils::Icons::FILTER.icon());
|
||||||
m_filterButton->setToolTip(tr("Filter tree"));
|
m_filterButton->setToolTip(tr("Filter tree"));
|
||||||
m_filterButton->setPopupMode(QToolButton::InstantPopup);
|
m_filterButton->setPopupMode(QToolButton::InstantPopup);
|
||||||
|
|||||||
Reference in New Issue
Block a user