QT 隐藏qdockwidget标题栏 偏方
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了QT 隐藏qdockwidget标题栏 偏方相关的知识,希望对你有一定的参考价值。
QT 隐藏qdockwidget标题栏 偏方 的确没有正确的方法,不过这个非常凑效
I‘m using Qt v4.3.2, and had the same problem and discovered that calling setTitleBarWidget(0) is NOT sufficient to remove the title bar and free up the client window space when the widget is DOCKED. This is because the class reverts to the internal default layout of reserving space for a title bar when the member is NULL(0).
However, the following simple trick will work:
// to hide the title bar completely must replace the default widget with a generic one
QWidget* titleWidget = new QWidget(this); /* where this a QMainWindow object */
dock->setTitleBarWidget( titleWidget );
My situation is simple thought since I never need to worry about undocking or moving the DocWidget during run-time; it is controlled by global app settings at startup and only needs to hold a static bitmap image for 原
原回答:product branding.
I thought I should answer this thread question for completeness; since I was struggling with the same problem since i‘m learning Qt and had to figure this one out on my own.
以上是关于QT 隐藏qdockwidget标题栏 偏方的主要内容,如果未能解决你的问题,请参考以下文章