forked from qt-creator/qt-creator
QmlDesigner: Hide ToolButtons instead of deleting them
Task-number: QTCREATORBUG-11900 Change-Id: I009e620a19a1747ea7a1c3580c63e0a56b05564e Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
This commit is contained in:
committed by
Alessandro Portale
parent
530332c255
commit
b2814f2753
@@ -303,10 +303,10 @@ void DesignModeWidget::setCurrentDesignDocument(DesignDocument *newDesignDocumen
|
||||
|
||||
}
|
||||
|
||||
static void deleteToolButtons(QList<QToolButton*> &buttons)
|
||||
static void hideToolButtons(QList<QToolButton*> &buttons)
|
||||
{
|
||||
qDeleteAll(buttons);
|
||||
buttons.clear();
|
||||
foreach (QToolButton *button, buttons)
|
||||
button->hide();
|
||||
}
|
||||
|
||||
void DesignModeWidget::setup()
|
||||
@@ -324,17 +324,17 @@ void DesignModeWidget::setup()
|
||||
if (factory->id() == "Projects") {
|
||||
navigationView = factory->createWidget();
|
||||
projectsExplorer = navigationView.widget;
|
||||
deleteToolButtons(navigationView.dockToolBarWidgets);
|
||||
hideToolButtons(navigationView.dockToolBarWidgets);
|
||||
projectsExplorer->setWindowTitle(tr("Projects"));
|
||||
} else if (factory->id() == "File System") {
|
||||
navigationView = factory->createWidget();
|
||||
fileSystemExplorer = navigationView.widget;
|
||||
deleteToolButtons(navigationView.dockToolBarWidgets);
|
||||
hideToolButtons(navigationView.dockToolBarWidgets);
|
||||
fileSystemExplorer->setWindowTitle(tr("File System"));
|
||||
} else if (factory->id() == "Open Documents") {
|
||||
navigationView = factory->createWidget();
|
||||
openDocumentsWidget = navigationView.widget;
|
||||
deleteToolButtons(navigationView.dockToolBarWidgets);
|
||||
hideToolButtons(navigationView.dockToolBarWidgets);
|
||||
openDocumentsWidget->setWindowTitle(tr("Open Documents"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user