PDA

View Full Version : How to set the BORDER COLOR of QDialog?



ashukla
13th November 2007, 11:38
Hi All!
How to set the BORDER COLOR of QDialog.
When I use palette property of this it changes only the background; but I want to change the BORDER COLOR also .
What I do for this!

wysota
13th November 2007, 11:40
If by border colour you mean the window decoration frame, they you can't do that in a simple way - it is not part of the application, but a part of the window manager (like KDE or GNOME).

ashukla
13th November 2007, 11:45
If by border colour you mean the window decoration frame, they you can't do that in a simple way - it is not part of the application, but a part of the window manager (like KDE or GNOME).
Dear Sir!
How a way It can be implement in Qt4?
Please give any suggestion.

wysota
13th November 2007, 11:56
You can get rid of the frame by using QWidget::setMask() or by removing all the decorations by setting the FramelessWindowHint before showing the window. Either way this will remove the frame, not change its colour.

ashukla
13th November 2007, 12:07
You can get rid of the frame by using QWidget::setMask() or by removing all the decorations by setting the FramelessWindowHint before showing the window. Either way this will remove the frame, not change its colour.
Dear Sir!
That means frames colour cann't be changed in Qt4.

wysota
13th November 2007, 12:12
That's what I said in the beginning :)

pherthyl
13th November 2007, 16:09
You can't influence the frame colour using any toolkit. This is not Qt specific. The only way to fake it is to make your window frameless, then draw the titlebar and frame manually. Some windows apps tend to do this. That's usually a bad idea though, since users won't like your non-standard app, and you have to reimplement things like window movement and minimize/maximize/close buttons yourself. Lots of work for a minor cosmetic issue.