I tried using but when I run my program it's still resizable. I also tried different things like setting the minimumSize and maximumSize and changing the sizePolicy to fixed but the result is still the same.
I attached the file for reference.
Printable View
I tried using but when I run my program it's still resizable. I also tried different things like setting the minimumSize and maximumSize and changing the sizePolicy to fixed but the result is still the same.
I attached the file for reference.
It would help if you attached source files rather of a complete example rather than an intermediate like the ui_*h file.
There's nothing in that ui*h file that would stop the main window from resizing. Using setFixedsize() on the QMainWindow certainly works here:
Code:
#include <QApplication> #include "ui_mainwindow.h" // your file as delivered namespace Ui { class MainWindow; }; { Q_OBJECT public: ui->setupUi(this); } private: Ui::MainWindow *ui; }; int main(int argc, char *argv[]) { MainWindow w; w.show(); w.setFixedSize(463, 251); a.exec(); } #include "main.moc"
Since you have use absolute positioning and not used layouts the contents and the container are essentially independent and you forgo much control. The push buttons and edit boxes you placed with Designer are not moving with the widget that contains them as your QMainWindow is resizing it.
Thanks totally work!!!