[Interest] MDI Subwindow with border, but no title

Murphy, Sean smurphy at walbro.com
Thu Mar 10 14:56:25 CET 2016


> >>> Is there a way to remove the title bar from an MDI Subwindow, but
> retain
> >> the resizable border all the way around? I'm trying to get more screen real
> >> estate for the subwindow contents, and I don't really have any need for
> >> titles. I do however want the user to be able to resize the subwindow.
> >>> With
> >>>     QMdiSubWindow* newSub = mdiArea->addSubWindow(child);
> >>> I've tried a couple options:
> >>>     1.  newSub->setWindowFlags(Qt::CustomizeWindowHint);    // hides
> >> buttons, but still leaves larger size
> >>>     2.  newSub->setWindowFlags(Qt::Window |
> Qt::FramelessWindowHint);
> >> // hides all window borders so nothing can get resized or moved
> >>> Option 1 retains removes the title and minimize/close buttons, but
> retains
> >> the same height as if those were still there - I'm assuming to present a
> >> separate handle to move the subwindow within the MDI area?
> >>> Option 2 removes everything, making it where the user can't move or
> >> resize the sub window.
> >>> I'm ok with losing the move handle on the subwindow just to get those
> >> vertical pixels back, I'll figure out some other way to allow the user to
> move
> >> widgets around.
> >> Try setting a plain QWidget instance as the title bar widget.
> > How do I replace the title bar widget? Am I looking for a function that does
> this for me, or something else?
> > Sean
> >
> Doh! Sorry, I was confused with using dock widgets. QDockWidget has a
> method to do that.

Yep! I was frantically searching for your solution and stumbled across that function
in QDockWidget, but then was disappointed to find it doesn't exist in QWidget or
QMdiSubWindow.

So right now, I'm trying to decide if:
- I just live with it and use QMdiSubWindows
- Make my own custom QMdiSubWindow where I set Qt::FramelessWindowHint but then reimplement the resizing functionality on my own
- Switch to QGraphicsView and QGraphicsProxyWidget

What I'm trying to do is create a surface where users can add different types of preexisting widgets, resize them individually as they choose, arrange them however they choose etc. So basically a customized dashboard that they can layout however they choose.
Sean


More information about the Interest mailing list