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. Placing widget below dock area in MainWindow.

Placing widget below dock area in MainWindow.

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 3.0k Views
  • 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.
  • L Offline
    L Offline
    LiamMaru
    wrote on last edited by
    #1

    A bit of a strange one, I want a window to be structured as follows:

    !http://img863.imageshack.us/img863/1121/whatiwant.png(Image)!

    The important bit being the widget that sits below the docking are. How can I achieve this?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      There are some possibilities:

      You could create a custom status bar for that, use a non movable bottom tool bar, create a doc widget that is not undocable, ...

      Does one of this solve your problem?

      e.g.
      @
      MySpecialToolBar p = new MySpecialToolBar(this);
      p->setAllowedAreas(Qt::BottomToolBarArea);
      p->setFloatable(false);
      p->setMovable(false);
      p->setOrientation(Qt::Horizontal);
      addToolbar(Qt::BottomToolBarArea, p);
      @

      same works with DockWidgets:

      @
      MySpeciaDockWidget p = new MySpeciaDockWidget(this);
      p->setAllowedAreas (Qt::BottomDockWidgetArea);
      p->setFeatures(QDockWidget::DockWidgetVerticalTitleBar); // no move, no float, no close!
      addDockWidget(Qt::BottomDockWidgetArea, p, Qt::Horizontal);
      @

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • L Offline
        L Offline
        LiamMaru
        wrote on last edited by
        #3

        Thanks for the reply, I went with the extra dock. I did do a couple of extra things though.

        First, remove the title bar:

        @fixedDock->setTitleBarWidget(new QWidget());@

        Second, fix the height:

        @fixedDock->setFixedHeight(fixedDock->sizeHint().height());@

        Third, make the other docks not stack with this one:

        @anotherDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);@

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          Hi,

          it should also be possible, to remove the title bar with:

          @
          p->setFeatures(QDockWidget::NoDockWidgetFeatures);
          @

          instead of
          @
          p->setFeatures(QDockWidget::DockWidgetVerticalTitleBar);
          @

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply
          0
          • L Offline
            L Offline
            LiamMaru
            wrote on last edited by
            #5

            Nope, I tried that. You still get a title bar, but no close/minimise/float buttons. My method completely removes the title bar. The window, as of now, looks like this:

            !http://img218.imageshack.us/img218/1456/asofnow.png(image)!

            1 Reply Last reply
            0

            • Login

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