qtquick: Fix crash when dereferencing incomplete stack controler
The stack controller CTOR was still in the stack (pun intended), then dereferenced by tabbar. Instead, call Stack_qtquick::init() to intitialize the the TabBar. At this point the Stack controller is already usable.
This commit is contained in:
@@ -26,7 +26,6 @@ Stack_qtquick::Stack_qtquick(Controllers::Stack *controller,
|
||||
Controllers::Frame *parent)
|
||||
: View_qtquick(controller, Type::Stack, Views::asQQuickItem(parent))
|
||||
, m_dockWidgetModel(new DockWidgetModel(this))
|
||||
, m_tabBar(new Controllers::TabBar(controller))
|
||||
, m_stack(controller)
|
||||
{
|
||||
connect(m_dockWidgetModel, &DockWidgetModel::countChanged, this,
|
||||
@@ -40,6 +39,17 @@ Stack_qtquick::Stack_qtquick(Controllers::Stack *controller,
|
||||
Q_EMIT countChanged(); });
|
||||
}
|
||||
|
||||
void Stack_qtquick::init()
|
||||
{
|
||||
m_tabBar = new Controllers::TabBar(m_stack);
|
||||
Q_EMIT tabBarChanged();
|
||||
}
|
||||
|
||||
Controllers::Stack *Stack_qtquick::stack() const
|
||||
{
|
||||
return m_stack;
|
||||
}
|
||||
|
||||
void Stack_qtquick::setDocumentMode(bool)
|
||||
{
|
||||
qDebug() << "Not implemented";
|
||||
|
||||
Reference in New Issue
Block a user