Disable resizing on a QDialog
-
Hi,
I'm trying to disable resizing on a QDialog containing a progress bar with the following code:
@
QDialog *dialog=new QDialog(some_parent_widget, Qt::Dialog | Qt::CustomizeWindowHint);QVBoxLayout *layout=new QVBoxLayout;
layout->addWidget(new QProgressBar);
dialog->setLayout(layout);dialog->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
dialog->setFixedSize(some_size);
@As a result, the dialog is displayed with the fixed size, but the cursor takes a resizing shape when hovering the border (I would like to disable this), and height can be modified (not width).
I'm developing with Qt5.1 on Windows 7.
-
AFAIK this isn't possible unless you hide the window frame (FramelessWindowHint), but i think that's not what you want.
-
it's old but I had the same problem.
setting minimum and maximum size to the same values did the trick for me