Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QDockWidget resize handle moves only in one direction

    General and Desktop
    2
    3
    899
    Loading More Posts
    • 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.
    • S
      SamerAfach last edited by

      I'm developing an program with plugins, so I need QDockWidget. I'm not setting any size policies or anything, and I'm having some asymmetric behavior. The following is how my window looks like:
      alt text

      What I wanna achieve: make the log view smaller (at least by hand, by dragging the slider).

      If I put my mouse on the area between the Log view and the two upper widgets, I can move only in 1 direction, which is up. Another even weirder way to demonstrate the problem is if I right-click between the dock widgets and uncheck "Log view" (where the dock widgets interface creates a menu with checkboxes automatically), and then check it again, the Log view widget appears again, but with a different size (depending on the position of the mouse), and possibly smaller. Now I take the slider again, and move it up, and then, again, I can't move it down anymore!!!

      The following is my code for creating the Widget:

      QDockWidget *MainWindow::createDockWidget(QString windowName,
                                                 QWidget *innerWidget,
                                                 Qt::DockWidgetArea area) {
        QDockWidget *dock = new QDockWidget(windowName, this);
        dock->setWidget(innerWidget);
        addDockWidget(area, dock);
        dock->setAllowedAreas(Qt::AllDockWidgetAreas);
        return dock;
      }
      

      where this is a helper function, and this is how I call it:

      modelTreeWidget = new ModelsTreeWidget;
      
      modelsDock = createDockWidget(tr("Models tree"), modelTreeWidget,
                                      Qt::LeftDockWidgetArea);
      propertiesDock = createDockWidget(tr("Properties view"), new PropertiesWidget,
                                          Qt::RightDockWidgetArea);
      auto loggerWidget = new LoggerWidget;
      logDock =
      createDockWidget(tr("Log view"), loggerWidget, Qt::BottomDockWidgetArea);
      

      I'm using Qt 5.7.1 on Debian Stretch.

      1 Reply Last reply Reply Quote 0
      • V
        VRonin last edited by

        Does the behaviour change if you set a central widget? i.e. call setCentralWidget(new QWidget(this));

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        1 Reply Last reply Reply Quote 3
        • S
          SamerAfach last edited by

          @VRonin Thank you, that works. Is this the only way to go? what if I want all the QDockWidgets to fill the screen?

          1 Reply Last reply Reply Quote 0
          • First post
            Last post