qtquick: Use a simple Item instead of a StackLayout
StackLayout doesn't allow to reorder children. Instead, just stack them in an arbitrary order and use visibility to hide the non-current ones.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "kddockwidgets/controllers/Stack.h"
|
||||
#include "kddockwidgets/controllers/Group.h"
|
||||
#include "kddockwidgets/controllers/DockWidget_p.h"
|
||||
#include "kddockwidgets/controllers/TabBar.h"
|
||||
|
||||
#include <QDebug>
|
||||
@@ -119,8 +120,15 @@ Controllers::DockWidget *DockWidgetModel::currentDockWidget() const
|
||||
|
||||
void DockWidgetModel::setCurrentDockWidget(Controllers::DockWidget *dw)
|
||||
{
|
||||
if (m_currentDockWidget)
|
||||
m_currentDockWidget->setVisible(false);
|
||||
|
||||
m_currentDockWidget = dw;
|
||||
setCurrentIndex(indexOf(dw));
|
||||
if (m_currentDockWidget) {
|
||||
QScopedValueRollback<bool> guard(m_currentDockWidget->d->m_isSettingCurrent, true);
|
||||
m_currentDockWidget->setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
QHash<int, QByteArray> DockWidgetModel::roleNames() const
|
||||
|
||||
Reference in New Issue
Block a user