From b9525cbc4ca7d0150b83a966c5b974268b162feb Mon Sep 17 00:00:00 2001 From: Abdalla Al-Dalleh <37416278+AbdallaDalleh@users.noreply.github.com> Date: Thu, 22 Jan 2026 13:18:25 +0300 Subject: [PATCH] QEWidget.cpp: Set parent and size when loading UI file. We started using guiFile property, we noticed the following issues: - GUI is loaded but with small dimensions (100x40 or something). - GUI does not close when parent closes. I think 1st point is important, the UI file gets loaded but with weird small dimensions. As for the 2nd, I think this can be customized further by adding an option whether to close on exit or not (i.e. setting the parent widget). --- qeframeworkSup/project/widgets/QEWidget/QEWidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qeframeworkSup/project/widgets/QEWidget/QEWidget.cpp b/qeframeworkSup/project/widgets/QEWidget/QEWidget.cpp index 6f21d9e..793080a 100644 --- a/qeframeworkSup/project/widgets/QEWidget/QEWidget.cpp +++ b/qeframeworkSup/project/widgets/QEWidget/QEWidget.cpp @@ -783,13 +783,15 @@ void QEWidget::startGui( const QEActionRequests & request ) { // Build the gui // Build it in a new window. - QMainWindow* w = new QMainWindow; + QMainWindow* w = new QMainWindow( this->getQWidget() ); QEForm* gui = new QEForm( request.getArguments().first() ); + gui->setResizeContents( false ); if( gui ) { if( gui->readUiFile()) { w->setCentralWidget( gui ); + w->resize( QSize( gui->width(), gui->height() ) ); w->show(); } else