Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 5

Qt-interest Archive, April 2007
How to Hide the title bar of the QDockWidget?


Message 1 in thread

Hi, all   I am using the QDockWidget to let it show or hide at the bottom of the MainWindow, but I don't want to show the title bar which display name on the left and the close and float button on the right, Is there a way to do this? I overwrite the paintEvent in QDockWidget, but it seems it still leaves the title bar space, I wanna my Widget to occupy the whole QDockwidget, Can it be possible? Thanks in AdvanceReimand  

Message 2 in thread

> I am using the QDockWidget to let it show or hide at the bottom of the
> MainWindow, but I don't want to show the title bar which display name on the
> left and the close and float button on the right, Is there a way to do this?
A QDockWidget without title would be about the same than a QSplitter
(without nesting), wouldn't it?

> I overwrite the paintEvent in QDockWidget, but it seems it still leaves the
> title bar space, I wanna my Widget to occupy the whole QDockwidget, Can it
> be possible?
Unfortunately, it is not possible like this because QDockWidget
reverses space for the title not only according to the used style but
also other things. See QDockWidgetPrivate::relayout() for more
details.

-- 
 [ signature omitted ] 

Message 3 in thread

hey I think you can do this easily .... rather than overriding the paint .
you can use something like SetWindowsRegion in Windows.

In QT

you can try this API.

Rect rec = QWidget->rect()
In this function you can pass the rect.  This will only show the client rect
all else will be masked.
QWidget->SetMask(rect);
hope this will help you

thanks,
~~Jits


On 4/19/07, reimand zhu <llzhu1984@xxxxxxx> wrote:
>
> Hi, all
>    I am using the QDockWidget to let it show or hide at the bottom of the
> MainWindow, but I don't want to show the title bar which display name on the
> left and the close and float button on the right, Is there a way to do this?
>
> I overwrite the paintEvent in QDockWidget, but it seems it still leaves
> the title bar space, I wanna my Widget to occupy the whole QDockwidget, Can
> it be possible?
>
> Thanks in Advance
> Reimand
>
>
>
>
> ------------------------------
> 抢注!网易隆重推出新一代免费邮箱 >> <http://www.126.com/>




-- 
 [ signature omitted ]