0

in my class that inherits QMainWindow, I have a resize method that resizes the window and then makes it unresizable to user input:

this->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
this->resize(this->width(), this->height() + newSize);
this->setFixedSize(this->size());

It works perfectly on Linux, but on Windows it leaves the window resizable to user input. I'm not sure how that's possible, since it's identical code and the last call IS setFixedSize, which should disable resizing.

ulak blade
  • 2,515
  • 5
  • 37
  • 81

1 Answers1

3

There are several questions about related problems on Stackoverflow already:

The solution might be to use the Qt::MSWindowsFixedSizeDialogHint QWindowFlag, or to set the parent layout (the main widget layout) to non-resizable, as suggested in this answer:

window->layout()->setSizeConstraint( QLayout::SetFixedSize );
Community
  • 1
  • 1
rubenvb
  • 74,642
  • 33
  • 187
  • 332