fixes #11533: TypeError in: FreeCADGui.getMainWindow().windowStateChanged

This commit is contained in:
wmayer
2023-11-27 15:27:18 +01:00
committed by Chris Hennes
parent fac94ba932
commit 9fb08b887d
6 changed files with 9 additions and 8 deletions

View File

@@ -226,12 +226,14 @@ void MDIView::closeEvent(QCloseEvent *e)
// because otherwise other parts don't work as they should.
QMainWindow::closeEvent(e);
}
else
else {
e->ignore();
}
}
void MDIView::windowStateChanged( MDIView* )
void MDIView::windowStateChanged(QWidget* view)
{
Q_UNUSED(view)
}
void MDIView::print(QPrinter* printer)

View File

@@ -166,7 +166,7 @@ protected Q_SLOTS:
* whenever the window state of the active view changes.
* The default implementation does nothing.
*/
virtual void windowStateChanged(Gui::MDIView*);
virtual void windowStateChanged(QWidget*);
protected:
void closeEvent(QCloseEvent *e) override;

View File

@@ -347,7 +347,7 @@ private Q_SLOTS:
Q_SIGNALS:
void timeEvent();
void windowStateChanged(Gui::MDIView*);
void windowStateChanged(QWidget*);
void workbenchActivated(const QString&);
void mainWindowClosed();

View File

@@ -189,8 +189,7 @@ PythonToCppFunc toCppPointerCheckFuncQuantity(PyObject* obj)
{
if (PyObject_TypeCheck(obj, &(Base::QuantityPy::Type)))
return toCppPointerConvFuncQuantity;
else
return nullptr;
return nullptr;
}
void BaseQuantity_PythonToCpp_QVariant(PyObject* pyIn, void* cppOut)

View File

@@ -675,7 +675,7 @@ void View3DInventor::dump(const char* filename, bool onlyVisible)
}
}
void View3DInventor::windowStateChanged(MDIView* view)
void View3DInventor::windowStateChanged(QWidget* view)
{
bool canStartTimer = false;
if (this != view) {

View File

@@ -125,7 +125,7 @@ private:
void applySettings();
protected:
void windowStateChanged(MDIView* ) override;
void windowStateChanged(QWidget* view) override;
void dropEvent (QDropEvent * e) override;
void dragEnterEvent (QDragEnterEvent * e) override;
void keyPressEvent (QKeyEvent * e) override;