PDA

View Full Version : QStyle overpainting QDialogBox



seux
30th August 2011, 14:38
Hello,
I am on my way to create my own Style. I got it to overpaint Buttons, Checkboxes, etc..., but I don't know how to overpaint the QDialogBox. For the buttons i did it this way:
In the drawPrimitiv function

switch(element)
{
case PE_PanelButtonComand:
{
//Overpainting the button
}
}

But there is nothing for the windows itself, i tried PE_FrameWindow, but its never been called.
How can i overpaint the QDialogBox in the Style class?

wysota
31st August 2011, 08:57
What do you consider "overpainting"? There is PE_Widget available.

seux
31st August 2011, 17:19
I mean the frame of the dialogbox and the red close button, etc... This is what i want to overpaint and add my own widgets to it. I tried it out with the PE_Widget, but it does not work. I even made a custom DialogBox class and used the paintEvent to draw on it, but i cannot overdraw the frame and the close button. What do i have to do to achieve this?

wysota
31st August 2011, 18:46
I mean the frame of the dialogbox and the red close button, etc...
So you mean the window decorations. This is not part of your application, you can't modify this area using QStyle. The window manager is responsible for this area.

seux
31st August 2011, 21:21
hm, okay, but is it possible to hide the frame? So that i have just the client area (or canvas or how it is called) without the window decorations?

wysota
31st August 2011, 23:21
Yes. Set Qt::FramelessWindowHint on the window.