PDA

View Full Version : Begginers question



steve38
12th November 2015, 18:46
Hi Guys,

I recently started playing with QtDesigner (its fascinating) but why is it that when I preview my creation its got a totaly different theme ?
11515

Cheers
Steve

anda_skoa
12th November 2015, 19:19
You can preview in any of the available styles.
I think by default it is using the style for the platform.

Cheers,
_

Radek
13th November 2015, 06:00
You can even select the style for the UI. Therefore
(1) When building the UI in the Designer, the Designer uses a "Designer style" with all tools needed for building.
(2) When previewing the UI in the Designer, the Designer uses a "real style" selected by you (or a default on the given platform). In fact, the result you see is a "real" window or dialog which you will see when you use the UI in your code.

steve38
13th November 2015, 13:24
OK... cool... so is it possible for me to get a nice looking window with rounded edges and the light blue shading on the top like the one I thought I was designing ? :p or am I stuck with the Eastern Block Prison style one that I get in the preview.

It seems odd to me that the designer should purposely display a misrepresentation of what you are designing unless you go to preview.. isnt that a little odd ?
Isnt that a little like putting your make=up on.. and then looking in the mirror to see if its a mess or not ?

Radek
13th November 2015, 15:09
As far as the color is concerned, yes, using a style sheet. As to the corners, I am not sure in the Designer - but, AFAIK, you can do it in your code.

The Designer does not display misrepresentation. Note that the Designer needs to support moving widgets, sizing them, organizing them in layouts, copying them, making space around them and so on. It needs some well defined "style" for it, so it uses one. The preview is really a window displayed in a certain style but the preview cannot be updated (except sizing the whole UI - like a window displayed by your app).

anda_skoa
13th November 2015, 15:34
The "work area" window in designer is just a work area.

The preview depends on the style plugin being used, which is also what the application can use.

The two windows looks quite alike actually, the designer content shows some artifacts related to layouting though.

Since you mentioned "light blue shading on the top" that is the window decoration, so the previiew uses the one that the system provides.

The simulated one of the work area looks like it how the decoration would look like on a Windows 7 system I think.
The real one is the one of the preview window (and the one of the QtCreator window).

Cheers,
_

steve38
14th November 2015, 14:07
Ok thanks guys ... it just behaves differently to the way I expected... I did try to change the look of my window but the image stopped showing up... I then added a resource file and things looked ok.... but after changing to add more images to the file they stopped appearing on the preview (icon and background) they also no longer show in the resource selector even if I load a different file al together.... so I think I broke something :crying: Ill go scratch my head a little