qt 无框dockwidget_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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值