Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Disable resizing on a QDialog
Forum Updated to NodeBB v4.3 + New Features

Disable resizing on a QDialog

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 13.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tilsitt
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

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

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tilsitt
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • D Offline
          D Offline
          Duesentrieb66
          wrote on last edited by
          #4

          it's old but I had the same problem.

          setting minimum and maximum size to the same values did the trick for me

          1 Reply Last reply
          3

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved