0

if I try to resize my QMainWindow vertically, it quickly goes down the screen until it's no longer visible, but the size will never change, no matter if I enlarge or reduce it. I basically just show it and place several Buttons/VLayouts etc. in it, but never specify any kind of size policy.

main.cpp:

int __cdecl main(int argc, char *argv[]) {
    QApplication app(argc, argv);
    QApplication::setQuitOnLastWindowClosed(true);
    ...
    mainWindow = new MainWindow();
    mainWindow->showMaximized();
    ...
    return QApplication::exec();
}

mainWindow.hpp:

class MainWindow : public QMainWindow {
    Q_OBJECT
...
}

I thought that maybe a QWidget inside the window with a fixed size policy prevents the MainWindow from resizing, but it displays perfectly on my second screen which has a different resolution.

Using:

  • QT5.14.2 (Components: Core, Widgets, Test, PrintSupport)
  • build with mingw73_64
  • C++17
  • CMake 3.16.2

Additional Libraries:

  • Boost 1.72
  • GigaBASE (Database)

Hope someone can help, thank you in advance.

knolperlap
  • 26
  • 5
  • So on your second screen you can resize the window, but on the first not ? Did I undestand correctly? – Cristi Jun 05 '20 at 18:01
  • No, what I wanted to say is that on the second screen, in windowed fullscreen mode, the window has a different size than on the first one, so I don't understand why I can't resize it. – knolperlap Jun 08 '20 at 08:49

0 Answers0