Re: [Interest] Suppress titlebar of dock widget?

2020-09-08 Thread Matthew Woehlke

On 08/09/2020 15.41, Sérgio Martins wrote:

On 2020-09-08 19:46, Matthew Woehlke wrote:

I have a dock widget that cannot be moved, closed or floated
(essentially, I need something that takes up the dock corner
preferentially), but I want it to *not* have a titlebar. Is there a
way to accomplish this?

Note: I am also implementing my own QStyle. My initial idea was to
tweak the QStyle to detect this widget and fiddle with the
size/metrics (I don't need exactly zero pixels; if I can make the
titlebar 1-2 pixels tall, that is good enough), but my attempt to make
the titlebar smaller/hidden that way is not working... However, I'm
not sure if I know what to change. So far I have fiddles with the
pixel metrics and subcontrol rects, but I don't see anything else I
can affect?


https://code.woboq.org/qt5/qtbase/src/widgets/widgets/qdockwidget.cpp.html#537 


It's using the height of the font, so no matter what you do, you can't.


Ah, well, answers that question anyway.; thanks.

QDockWidget::setTitleBarWidget() sounds good for you, as long as you 
never float it, as that brings other problems.


Not a problem; this particular "dock" isn't floatable either. The only 
reason I'm even using QDockWidget, really, is because I want this:


  ┌──┬┐
  │  ││
  │  ││
  │  ├┤
  │  ││
  └──┴┘

...and not this:

  ┌──┬┐
  │  ││
  │  ││
  ├──┴┤
  │   │
  └───┘

...where the bottom panel is (also) a QDockWidget. (In that case, one 
that *can* be floated or closed.) In all other respects, though, I want 
the side panel to be a fixed UI element.


--
Matthew
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Suppress titlebar of dock widget?

2020-09-08 Thread Sérgio Martins via Interest

On 2020-09-08 19:46, Matthew Woehlke wrote:

I have a dock widget that cannot be moved, closed or floated
(essentially, I need something that takes up the dock corner
preferentially), but I want it to *not* have a titlebar. Is there a
way to accomplish this?

Note: I am also implementing my own QStyle. My initial idea was to
tweak the QStyle to detect this widget and fiddle with the
size/metrics (I don't need exactly zero pixels; if I can make the
titlebar 1-2 pixels tall, that is good enough), but my attempt to make
the titlebar smaller/hidden that way is not working... However, I'm
not sure if I know what to change. So far I have fiddles with the
pixel metrics and subcontrol rects, but I don't see anything else I
can affect?


Hi Matthew,


https://code.woboq.org/qt5/qtbase/src/widgets/widgets/qdockwidget.cpp.html#537
It's using the height of the font, so no matter what you do, you can't.

QDockWidget::setTitleBarWidget() sounds good for you, as long as you 
never float it,

as that brings other problems.




Regards,
--
Sérgio Martins | sergio.mart...@kdab.com | Senior Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel: Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - The Qt, C++ and OpenGL Experts
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Suppress titlebar of dock widget?

2020-09-08 Thread Matthew Woehlke

On 08/09/2020 14.46, Matthew Woehlke wrote:
I have a dock widget that cannot be moved, closed or floated 
(essentially, I need something that takes up the dock corner 
preferentially), but I want it to *not* have a titlebar. Is there a way 
to accomplish this?


Note: I am also implementing my own QStyle. My initial idea was to tweak 
the QStyle to detect this widget and fiddle with the size/metrics (I 
don't need exactly zero pixels; if I can make the titlebar 1-2 pixels 
tall, that is good enough), but my attempt to make the titlebar 
smaller/hidden that way is not working... However, I'm not sure if I 
know what to change. So far I have fiddles with the pixel metrics and 
subcontrol rects, but I don't see anything else I can affect? It seems 
like there must be a way to control this, as I'm pretty sure I've seen 
styles with different sized titlebars!


Sigh. Should've checked SO: 
https://stackoverflow.com/questions/18918496. Apparently, the answer is 
'replace the titlebar widget'.


...but I'm still curious why I can't get fiddling with the style to have 
any effect?


--
Matthew
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Suppress titlebar of dock widget?

2020-09-08 Thread Matthew Woehlke
I have a dock widget that cannot be moved, closed or floated 
(essentially, I need something that takes up the dock corner 
preferentially), but I want it to *not* have a titlebar. Is there a way 
to accomplish this?


Note: I am also implementing my own QStyle. My initial idea was to tweak 
the QStyle to detect this widget and fiddle with the size/metrics (I 
don't need exactly zero pixels; if I can make the titlebar 1-2 pixels 
tall, that is good enough), but my attempt to make the titlebar 
smaller/hidden that way is not working... However, I'm not sure if I 
know what to change. So far I have fiddles with the pixel metrics and 
subcontrol rects, but I don't see anything else I can affect? It seems 
like there must be a way to control this, as I'm pretty sure I've seen 
styles with different sized titlebars!


--
Matthew
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest