PDA

View Full Version : Tough windowing problem.... How to prevent state change of title bar?



TheNewGuy
11th December 2009, 06:11
I am popping up a transparent webkit widget that expands across the whole screen (regardless of the size of the main app window) grabs the mouse focus and of course paints stuff on the screen where need be when the user clicks a button.

The problem is that when the transparent window pops up the windows title bar changes styles. It is the style that a window gets when it is not active. So, my question is how do I stop the main application window's title bar from changing colors when the widget window pops up?


This is how the widget is created:




setWindowModality(Qt::ApplicationModal);

// make the background opaque
QPalette qpalette = palette();
qpalette.setBrush(QPalette::Base, Qt::transparent);
page()->setPalette(qpalette);
setAttribute(Qt::WA_OpaquePaintEvent, false);
setAttribute(Qt::WA_TranslucentBackground, true);

setWindowFlags(Qt::FramelessWindowHint | Qt::SplashScreen);

page()->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);




Maybe there is a better way to do this? I could not get it to work unless the widget was a window. What the widget accomplishes is a webkit replacement for QMenu.

TheNewGuy
11th December 2009, 18:21
Anyone have any ideas? I have spent hours on this problem with no success :confused: