Results 1 to 7 of 7

Thread: overriding the minimise,maximise buttons

  1. #1
    Join Date
    Mar 2006
    Posts
    19
    Thanks
    1

    Default overriding the minimise,maximise buttons

    hi all,

    Could anyone please tell me if we r able to override the minimise,maximise and close buttons with our own images....i believe its possible...but couldnt find any way to do it....any help would be highly appreciated.

    Thanks for ur time

    Cheers,
    Amulya

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: overriding the minimise,maximise buttons

    Implement your own style and override standardPixmap().

  3. #3
    Join Date
    Mar 2006
    Posts
    19
    Thanks
    1

    Default Re: overriding the minimise,maximise buttons

    hi jpn,

    thanx for a fast reply...although i couldnt find a particular function using which i could directly target the minimise,maximise and close buttons...i do hope u could help me on that.

    Thanx

    Cheers,
    Amulya

  4. #4
    Join Date
    Mar 2006
    Posts
    19
    Thanks
    1

    Default Re: overriding the minimise,maximise buttons

    hi jpn,

    i think i phrased my reply wrongly..i wanted to ask how should i include my images or where should i provide them...like..in StandardPixmap function...the StandardPixmap could be either minimise,maximise or close button...that i understand..but which styleoption should i use....if StyleOptionTitleBar then it doesnt have any function using which i can provide the relevant image....please help me out on that..i m really confused on how to implement it

    Thanx for ur time

    Cheers,
    Amulya

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: overriding the minimise,maximise buttons

    I believe I will have to eat my words.. Seems you can't customize the title bar with styles, since the title bar is out of Qt's scope. You may give hints which buttons you want to appear, but for the way you want it to be customized, you may need to hide the original title bar (Qt::FramelessWindowHint) and draw your own customized title bar by yourself. There is a whole lot of code needed to handle movement and resizing, though..

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: overriding the minimise,maximise buttons


  7. #7
    Join Date
    Mar 2006
    Posts
    19
    Thanks
    1

    Default Re: overriding the minimise,maximise buttons

    hi jpn,

    thanx for replying...i was though wondering if the following would work
    Qt Code:
    1. QPixmap standardPixmap ( StandardPixmap standardPixmap, const QStyleOption * option = 0, const QWidget * widget = 0 ) const
    2. {
    3. QPixmap maximiseImage(":/images/woodbackground.png");
    4. QPixmap minimiseImage(":/images/woodbutton.png");
    5. QPixmap closeImage(":/images/woodbackground.png");
    6. QPixmap contextHelpImage(":/images/woodbutton.png");
    7.  
    8. switch(standardpixmap){
    9. case SP_TitleBarMinButton:
    10. return minimiseImage;
    11. case SP_TitleBarMaxButton:
    12. return maximiseImage;
    13. case SP_TitleBarCloseButton:
    14. return closeImage;
    15. case SP_TitleBarContextHelpButton:
    16. return contextHelpImage;
    17. }
    18. }
    To copy to clipboard, switch view to plain text mode 

    if standardpixmap() works .... this should solve my problem....please give me ur suggestions.

    Thanx for ur time.

    Cheers,
    Amulya

Similar Threads

  1. how to corss compile for windows in Linux
    By safknw in forum Qt Programming
    Replies: 24
    Last Post: 13th May 2006, 05:23

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.