PDA

View Full Version : Strange GUI rendering difference between winXP vs. win7



unshaven
14th August 2012, 09:35
Imagine I have a mainwindow. It has a background image with transparency on the corners, making them curved.

On that is a pictureframe, taking around 2/3 of the area, and while the mainform's background is grayish, the pictureframe's content is currently black - so I can see the edges clearly.

Just below the pictureframe is a QWidget, supposed to align horizontally with it, and touching its lower border.

Now, on WinXP (with classic style enabled, i.e. win2k look), they do align, strangely, when the QWidget is a bit smaller in width, e.g. 700px vs. 704px. How can that be explained?

Then, on Win7 (default style), they do not align, the widget is missing a few rows of pixels left and right, like normally expected.

The mainwindow and pictureframe have only a background image assignment in their stylesheets.
The widget's stylesheet: background-color: rgba(0,0,0,255);

So - what's going on there?

Lesiok
14th August 2012, 11:56
Is main window has a fixed size or has some layout manager ?

unshaven
14th August 2012, 15:48
The main window has a fixed size, yes, and all widgets on it keep the same position and size.
One big widget is invisible, usually. (it's a tab widget with "advanced options", and lies under (i.e., same position as) the pictureframe, which would be made invisible if the tab thing is enabled).

Lesiok
14th August 2012, 19:59
And this is a problem. Different styles in different ways using the surface of the window.

unshaven
16th August 2012, 09:16
well, but it doest not help if I do this at program start, with the invisible tab widget which normally lies under the visible ones:
tabthing->resize(0,0);
tabthing->move(0,0);

Should it not be out of the way then, and have no effect?
Well, it doesn't do anything.

ChrisW67
16th August 2012, 23:31
Exact behaviour will depend on the type of the picture frame and the widget beneath the picture frame. The unadorned QWidget under the picture has no visual appearance and should be invariant in size with style changes. If the "pictureframe" is a QFrame derivative then its border will be rendered differently with style, probably wider overall under Win 7 than classic.

Strikes me that the alignment can be ensured using a layout.