25 m_formContainer(
new QWidget),
26 m_formContainerLayout(
new QStackedLayout),
27 m_layout(
new QStackedLayout)
29 m_layout->setContentsMargins(QMargins());
30 m_layout->setSpacing(0);
31 m_layout->setStackingMode(QStackedLayout::StackAll);
36 m_formContainerLayout->setContentsMargins(QMargins());
37 m_formContainer->setObjectName(u"formContainer"_s);
38 m_formContainer->setLayout(m_formContainerLayout);
39 m_formContainerLayout->setStackingMode(QStackedLayout::StackAll);
42 m_formContainer->setAutoFillBackground(
true);
60 if (index < 0 || index >= cnt) {
61 qDebug(
"FormWindowWidgetStack::setCurrentTool(): invalid index: %d", index);
70 m_tools.at(cur)->deactivated();
73 m_layout->setCurrentIndex(index);
75 for (
int i = 0; i < cnt; i++)
76 m_tools.at(i)->editor()->setVisible(i == 0 || i == index);
78 QDesignerFormWindowToolInterface *tool = m_tools.at(index);
81 emit currentToolChanged(index);
128 const int previousCount = m_formContainerLayout->count();
129 QWidget *previousMainContainer = previousCount
130 ? m_formContainerLayout->itemAt(0)->widget() :
nullptr;
131 if (previousMainContainer == w)
135 delete m_formContainerLayout->takeAt(0);
137 m_formContainerLayout->addWidget(w);