[Qt-interest] Customize title bar and window

Ben Axelrod baxelrod at coroware.com
Fri Jul 10 17:17:06 CEST 2009


Thanks again Oliver,

I had not thought of using Qt::FramelessWindowHint and recreating the title bar and window control buttons.  I think that is probably what I will have to do.  Although I am not looking forward to recreating all this default functionality...  It's too bad there isn't a simple example that demonstrates this framework.  (I mean recreating the default behavior.  I know about the window flags example.)  Although, maybe this is by choice so people conform to the native styles like you said.

-Ben

-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Oliver.Knoll at comit.ch
Sent: Friday, July 10, 2009 4:56 AM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] Customize title bar and window

Andreas Pakulat wrote on Thursday, July 09, 2009 9:23 PM:

> On 09.07.09 08:35:05, Ben Axelrod wrote:
>> Is there a way to customize the look and feel of the title bar,
>> minimize, maximize, and close buttons, window frame, and resize
>> handle?
>
> Not with Qt. Qt only works inside the window, not on the window frame.
> Thats done by the window manager.

However, there seems to be a workaround. I know at least one application which does provide custom Close, Maximise and Minimize buttons: "Nokia PC Suite", used for sync'ing phones etc. - and it happens to be written in Qt :)

Off course it is closed source, so we can only assume how they did it. I assume they have disabled the window decoration altogether

   http://doc.qtsoftware.com/4.5/qt.html#WindowType-enum
  (Is it the Qt::FramelessWindowHint?)

and paint their own title bar, close buttons, resize corner (the dotted thing in the right bottom corner of the window) etc., so it looks like a Windows Vista app, even on Windows XP (and how I *hate* that! ;)

The english Wikipedia entry contains an outdated screenshot, but you get the idea (there you also see that the close buttons are "rounded" versions of the XP theme):

  http://en.wikipedia.org/wiki/Nokia_PC_Suite

But in the end of the day you should ask yourself whether it is really worth the effort to "customize" the look of your app (so that it looks completely different than what users are used to see on their OS/Window Manager) and which does not respect the "Window theme" and colours, and then have users (such as me ;) ranting about it - and hey, I am not even a Mac user ;)


Cheers, Oliver

p.s. Hey Trolls, could anyone of you go over and knock at the next office door, and tell the "PC Suite" guys "Hello" and that I like their app, but I would like it to look like any other Windows XP app? Thanks ;)
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list