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
Re: overriding the minimise,maximise buttons
Implement your own style and override standardPixmap().
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
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
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..
Re: overriding the minimise,maximise buttons
Re: overriding the minimise,maximise buttons
hi jpn,
thanx for replying...i was though wondering if the following would work
Code:
{
QPixmap maximiseImage
(":/images/woodbackground.png");
QPixmap minimiseImage
(":/images/woodbutton.png");
QPixmap closeImage
(":/images/woodbackground.png");
QPixmap contextHelpImage
(":/images/woodbutton.png");
switch(standardpixmap){
case SP_TitleBarMinButton:
return minimiseImage;
case SP_TitleBarMaxButton:
return maximiseImage;
case SP_TitleBarCloseButton:
return closeImage;
case SP_TitleBarContextHelpButton:
return contextHelpImage;
}
}
if standardpixmap() works .... this should solve my problem....please give me ur suggestions.
Thanx for ur time.
Cheers,
Amulya