forked from qt-creator/qt-creator
Introduce standardViews() function for ViewManager
Change-Id: I699f081e23db92cf96292b10e9427d9747e76f22 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -119,6 +119,7 @@ private: // functions
|
|||||||
void switchStateEditorViewToBaseState();
|
void switchStateEditorViewToBaseState();
|
||||||
void switchStateEditorViewToSavedState();
|
void switchStateEditorViewToSavedState();
|
||||||
QList<QPointer<AbstractView>> views() const;
|
QList<QPointer<AbstractView>> views() const;
|
||||||
|
QList<QPointer<AbstractView>> standardViews() const;
|
||||||
|
|
||||||
private: // variables
|
private: // variables
|
||||||
ViewManagerData *d;
|
ViewManagerData *d;
|
||||||
|
@@ -169,15 +169,27 @@ void ViewManager::switchStateEditorViewToSavedState()
|
|||||||
QList<QPointer<AbstractView> > ViewManager::views() const
|
QList<QPointer<AbstractView> > ViewManager::views() const
|
||||||
{
|
{
|
||||||
auto list = d->additionalViews;
|
auto list = d->additionalViews;
|
||||||
list.append({
|
list.append(standardViews());
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<QPointer<AbstractView> > ViewManager::standardViews() const
|
||||||
|
{
|
||||||
|
QList<QPointer<AbstractView>> list = {
|
||||||
&d->edit3DView,
|
&d->edit3DView,
|
||||||
&d->formEditorView,
|
&d->formEditorView,
|
||||||
&d->textEditorView,
|
&d->textEditorView,
|
||||||
&d->itemLibraryView,
|
&d->itemLibraryView,
|
||||||
&d->navigatorView,
|
&d->navigatorView,
|
||||||
&d->propertyEditorView,
|
&d->propertyEditorView,
|
||||||
&d->statesEditorView
|
&d->statesEditorView,
|
||||||
});
|
&d->designerActionManagerView
|
||||||
|
};
|
||||||
|
|
||||||
|
if (QmlDesignerPlugin::instance()->settings().value(
|
||||||
|
DesignerSettingsKey::ENABLE_DEBUGVIEW).toBool())
|
||||||
|
list.append(&d->debugView);
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,16 +238,7 @@ void ViewManager::detachAdditionalViews()
|
|||||||
|
|
||||||
void ViewManager::detachStandardViews()
|
void ViewManager::detachStandardViews()
|
||||||
{
|
{
|
||||||
|
for (auto view : standardViews()) {
|
||||||
for (auto view : std::vector<AbstractView *>({ &d->designerActionManagerView,
|
|
||||||
&d->edit3DView,
|
|
||||||
&d->formEditorView,
|
|
||||||
&d->textEditorView,
|
|
||||||
&d->navigatorView,
|
|
||||||
&d->itemLibraryView,
|
|
||||||
&d->statesEditorView,
|
|
||||||
&d->propertyEditorView,
|
|
||||||
&d->debugView})) {
|
|
||||||
if (view->isAttached())
|
if (view->isAttached())
|
||||||
currentModel()->detachView(view);
|
currentModel()->detachView(view);
|
||||||
}
|
}
|
||||||
@@ -277,16 +280,7 @@ void ViewManager::attachViewsExceptRewriterAndComponetView()
|
|||||||
int last = time.elapsed();
|
int last = time.elapsed();
|
||||||
int currentTime = 0;
|
int currentTime = 0;
|
||||||
if (!d->disableStandardViews) {
|
if (!d->disableStandardViews) {
|
||||||
for (auto view : std::vector<AbstractView *>({&d->designerActionManagerView,
|
for (auto view : standardViews()) {
|
||||||
&d->edit3DView,
|
|
||||||
&d->formEditorView,
|
|
||||||
&d->textEditorView,
|
|
||||||
&d->navigatorView,
|
|
||||||
&d->itemLibraryView,
|
|
||||||
&d->statesEditorView,
|
|
||||||
&d->propertyEditorView})) {
|
|
||||||
|
|
||||||
|
|
||||||
currentModel()->attachView(view);
|
currentModel()->attachView(view);
|
||||||
currentTime = time.elapsed();
|
currentTime = time.elapsed();
|
||||||
qCInfo(viewBenchmark) << view->widgetInfo().uniqueId << currentTime - last;
|
qCInfo(viewBenchmark) << view->widgetInfo().uniqueId << currentTime - last;
|
||||||
|
Reference in New Issue
Block a user