[Interest] MDI Subwindow with border, but no title

André Somers andre at familiesomers.nl
Thu Mar 10 14:33:40 CET 2016



Op 10/03/2016 om 14:25 schreef Murphy, Sean:
>>> 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.

André




More information about the Interest mailing list