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->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    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.

  • Moderators

    AFAIK this isn't possible unless you hide the window frame (FramelessWindowHint), but i think that's not what you want.

  • That's the answer I feared :/. Thanks for the confirmation.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.