Placing widget below dock area in MainWindow.



  • 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?



  • 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);
    @



  • 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);@



  • Hi,

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

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

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



  • 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)!


Log in to reply
 

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