qdockwidget

Paint/Draw on top of docked widgets in QDodckWidget

别说谁变了你拦得住时间么 提交于 2019-11-29 04:48:11
I have a class in Qt that inherits QDockWidget. And that class contains another widget. Is there any possibility to define a function in my QDockWidget inherited class that draws stuff on top of the contained widget? Like the painting to be independent of the contained widget but to be linked to the inherited class. Thank you Sure it's possible. It is fairly simple to do, in fact. You need to place a child widget that sits on top of everything else in your QDockWidget . To do it so, it must be the last child widget you add to your dockwidget. That widget must not to draw its background, and it

Hide label text for Qt tabs without setting text to empty string

随声附和 提交于 2019-11-28 13:51:26
I need a QTabWidget with icons only: How can I hide the label text of a tab in Qt? I cannot set the text to an empty string ( "" ), as I am using docked widgets ( QDockWidget ) and the label text is set automatically (and I need it if the widget is floating). But in tabbed mode I just want to display the icons (of the tabs). Possible approaches: Font size to 0? I need to create my own bar class and override the paint event as here Anything easier / cleaner? --- Edit --- Ok, the "set window title to empty string, and reset it the original text" approach works. I am using the topLevelChanged

Paint/Draw on top of docked widgets in QDodckWidget

一个人想着一个人 提交于 2019-11-27 18:43:13
问题 I have a class in Qt that inherits QDockWidget. And that class contains another widget. Is there any possibility to define a function in my QDockWidget inherited class that draws stuff on top of the contained widget? Like the painting to be independent of the contained widget but to be linked to the inherited class. Thank you 回答1: Sure it's possible. It is fairly simple to do, in fact. You need to place a child widget that sits on top of everything else in your QDockWidget . To do it so, it

Hide label text for Qt tabs without setting text to empty string

二次信任 提交于 2019-11-27 07:58:13
问题 I need a QTabWidget with icons only: How can I hide the label text of a tab in Qt? I cannot set the text to an empty string ( "" ), as I am using docked widgets ( QDockWidget ) and the label text is set automatically (and I need it if the widget is floating). But in tabbed mode I just want to display the icons (of the tabs). Possible approaches: Font size to 0? I need to create my own bar class and override the paint event as here Anything easier / cleaner? --- Edit --- Ok, the "set window