forked from qt-creator/qt-creator
FormEditorStack: Avoid using sender()
Change-Id: I35ea87d30eb3b3529d7c6b85febced75e3951dcf Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -84,8 +84,8 @@ void FormEditorStack::add(const EditorData &data)
|
|||||||
connect(data.formWindowEditor, &FormWindowEditor::destroyed,
|
connect(data.formWindowEditor, &FormWindowEditor::destroyed,
|
||||||
this, &FormEditorStack::removeFormWindowEditor);
|
this, &FormEditorStack::removeFormWindowEditor);
|
||||||
|
|
||||||
connect(data.widgetHost, &SharedTools::WidgetHost::formWindowSizeChanged,
|
connect(data.widgetHost, &SharedTools::WidgetHost::formWindowSizeChanged, this,
|
||||||
this, &FormEditorStack::formSizeChanged);
|
[this, wh = data.widgetHost](int w, int h) { formSizeChanged(wh, w, h); });
|
||||||
|
|
||||||
if (Designer::Constants::Internal::debug)
|
if (Designer::Constants::Internal::debug)
|
||||||
qDebug() << "FormEditorStack::add" << data.widgetHost << m_formEditors.size();
|
qDebug() << "FormEditorStack::add" << data.widgetHost << m_formEditors.size();
|
||||||
@@ -168,16 +168,13 @@ void FormEditorStack::updateFormWindowSelectionHandles()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormEditorStack::formSizeChanged(int w, int h)
|
void FormEditorStack::formSizeChanged(const SharedTools::WidgetHost *widgetHost, int w, int h)
|
||||||
{
|
{
|
||||||
// Handle main container resize.
|
// Handle main container resize.
|
||||||
if (Designer::Constants::Internal::debug)
|
if (Designer::Constants::Internal::debug)
|
||||||
qDebug() << Q_FUNC_INFO << w << h;
|
qDebug() << Q_FUNC_INFO << w << h;
|
||||||
if (auto wh = qobject_cast<const SharedTools::WidgetHost *>(sender())) {
|
widgetHost->formWindow()->setDirty(true);
|
||||||
wh->formWindow()->setDirty(true);
|
m_designerCore->propertyEditor()->setPropertyValue("geometry", QRect(0, 0, w, h));
|
||||||
static const QString geometry = "geometry";
|
|
||||||
m_designerCore->propertyEditor()->setPropertyValue(geometry, QRect(0,0,w,h) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedTools::WidgetHost *FormEditorStack::formWindowEditorForXmlEditor(const Core::IEditor *xmlEditor) const
|
SharedTools::WidgetHost *FormEditorStack::formWindowEditorForXmlEditor(const Core::IEditor *xmlEditor) const
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
void updateFormWindowSelectionHandles();
|
void updateFormWindowSelectionHandles();
|
||||||
void modeAboutToChange(Utils::Id mode);
|
void modeAboutToChange(Utils::Id mode);
|
||||||
void formSizeChanged(int w, int h);
|
void formSizeChanged(const SharedTools::WidgetHost *widgetHost, int w, int h);
|
||||||
|
|
||||||
inline int indexOfFormWindow(const QDesignerFormWindowInterface *) const;
|
inline int indexOfFormWindow(const QDesignerFormWindowInterface *) const;
|
||||||
inline int indexOfFormEditor(const QObject *xmlEditor) const;
|
inline int indexOfFormEditor(const QObject *xmlEditor) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user