PDA

View Full Version : Non client area painting with Qt



rajendrant
21st July 2013, 23:02
Dear Qt Developers/Experts

My goal is to draw tabbar in titlebar (only in Windows) similar to firefox/chrome.
I am using some DWM apis to achieve that as mentioned in http://msdn.microsoft.com/en-us/library/windows/desktop/bb688195%28v=vs.85%29.aspx
Basically I make the entire area as nonclientarea and tabbar is drawn at the top automatically.

I know these DWM apis only work with Windows Aero enabled, and I am fine with tabbar not shown in titlebar with DWM disabled.

I am facing two issues.
1. When the application is maximized, part of the left, top window portion gets clipped. See the attached image.
2. If I enable 'Auto hide taskbar' property in Windows, I would expect the taskbar to popup when mouse is moved down near the taskbar with application maximized. That is not happening as well.

I have attached a sample project that creates the issue.
Can somebody help with this.
Any suggestions are welcome.

I can perfectly solve issue (1) with setContentsMargins() if I know the exact amount of pixels that are being clipped.

Thanks
Rajendran

rajendrant
31st July 2013, 04:35
Dear All,

I managed to fix aforementioned issues (at least in Qt4.8.5) and attaching working project.

9382

Our project QuTTY (http://code.google.com/p/qutty/) also uses this technique to provide tabs in titlebar similar to Google Chrome.

However, Qt5.1.0 has some issues with left, bottom sides of the mainwindow geometry getting reduced.

Thanks
Rajendran

Ivan Rodríguez
17th February 2014, 21:04
Hi Rajendran,

It is a bit old, but I have a question. Is it possible to get this DWM API working without Aero enabled? The documentation says nothing about it.

Thanks.

Ivan RodrÃ*guez.