how can I fully disable resizing a window including the resize icon when the mouse hovers the border?

Klasik picture Klasik · May 21, 2013 · Viewed 61.7k times · Source

I used: setFixedSize(size()); to stop the window from resizing, but the resize arrows still appear when the mouse is over the border of the window.

Is there a better way to disable window resizing to avoid showing the arrows when crossing the border?

Answer

Daniël Sonck picture Daniël Sonck · Feb 8, 2015

Qt has a windowFlag called Qt::MSWindowsFixedSizeDialogHint for that. Depending on what you exactly want, you want to combine this flag with Qt::Widget, Qt::Window or Qt::Dialog.

void MyDialog::MyDialog()
{
  setWindowFlags(Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);

  ...
}