Results 1 to 8 of 8

Thread: Custom Window Title Buttons / Colors

  1. #1
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    28
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Question Custom Window Title Buttons / Colors

    Hello everyone,

    I've got a question or well let's say im interesting in modifing my Qt Window. (such things as close button, maximize etc.)

    I know , Qt has a lot of WindowStates/Flags but that's not what I am looking for. For example Google Chrome, they modify their whole window especially the title bar.

    I don't know but I think the title bar is not drawn by Qt. It's a job for the underlying system (Windows, Unix etc.) isn't it?

    So my question, do I have any possibilities to change the Window Title bar (with Qt)? Or could someone give me a hint how to do it?

    (Example: Chrome with the color, Skype with another button and so on.)

    Regards,

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Custom Window Title Buttons / Colors

    You cant do anything with the title bar coz qt does not draw it. What you can do is that use FrameLessWindowHint (search for it in assistant) and then draw your own title bar. There are lot of examples on the net for that. There is even one in assistant which shows you how to implement mouse move events for a frameless window

  3. The following user says thank you to nish for this useful post:

    Sven (27th September 2010)

  4. #3
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    28
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Custom Window Title Buttons / Colors

    Ok thanks, but how to implement those Vista / 7 Buttons - or Windows XP minimize, maximize and "x" ?

    Do you think I've got the chance to draw those with the Windows API instead of drawing everything myself?

  5. #4
    Join Date
    Feb 2009
    Posts
    20

    Default Re: Custom Window Title Buttons / Colors

    Quote Originally Posted by MrDeath View Post
    There is even one in assistant which shows you how to implement mouse move events for a frameless window
    What example do you mean?

  6. #5
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    28
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Custom Window Title Buttons / Colors


  7. #6
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Custom Window Title Buttons / Colors

    Quote Originally Posted by zack View Post
    What example do you mean?
    this one .. qt-src-dir/examples/widgets/analogclock, and many others.

  8. #7
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Custom Window Title Buttons / Colors

    Quote Originally Posted by Sven View Post
    Ok thanks, but how to implement those Vista / 7 Buttons - or Windows XP minimize, maximize and "x" ?

    Do you think I've got the chance to draw those with the Windows API instead of drawing everything myself?
    I guess you can get those icons through window api, but you have to draw them urself onto your widget. Better approach would be to have the icons as png(or any format u like) as an resource file. this way you dont have to worry about windows api and your application will have the same look on all platforms.

  9. #8
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    28
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Custom Window Title Buttons / Colors

    But thats not what I want. On Unix , i use the default Unix style but on Windows I want to use their Buttons (without having them as a PNG because of the hovering effects and so on).

    Well I'll take a look into Windows WindowManager. Maybe there are some information about using these standard buttons and how to modify them. ;-)

Similar Threads

  1. Replies: 5
    Last Post: 22nd October 2010, 16:34
  2. how to remove the window title bar?
    By tsuibin in forum Qt Programming
    Replies: 1
    Last Post: 3rd April 2009, 04:17
  3. Remove window title
    By marcel in forum Qt Programming
    Replies: 2
    Last Post: 10th April 2007, 06:06
  4. Main window with custom buttons ?
    By probine in forum Qt Programming
    Replies: 1
    Last Post: 22nd November 2006, 07:32
  5. window title bar
    By moowy in forum Qt Programming
    Replies: 4
    Last Post: 21st September 2006, 17:56

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.