Qt Creator WYSIWYG isn't giving a true representation
-
This is part of the form whilst editing in Qt Creator:
This is the same form when running as application on desktop:
In both cases I've screen printed and cropped the area. Why is the final presentation in the compiled application when running on the desktop so different from the view in Qt Creator?
Also notice the controls used in Qt Creator are not quite the same as those when running in the application, note that the rectangles for the buttons and combo are sharp when running in the application and very slightly rounded when running in Qt Creator.
I'm using Qt 4.4.1, Based on Qt 5.9.2 (MSVC 2015, 32 bit).
-
This is part of the form whilst editing in Qt Creator:
This is the same form when running as application on desktop:
In both cases I've screen printed and cropped the area. Why is the final presentation in the compiled application when running on the desktop so different from the view in Qt Creator?
Also notice the controls used in Qt Creator are not quite the same as those when running in the application, note that the rectangles for the buttons and combo are sharp when running in the application and very slightly rounded when running in Qt Creator.
I'm using Qt 4.4.1, Based on Qt 5.9.2 (MSVC 2015, 32 bit).
@SPlatten The running application uses the default platform theme to look like an app on that platform should. In designer the platform theme is not set I guess. So, as long as your app looks like it should when running I would not bother.
-
@SPlatten The running application uses the default platform theme to look like an app on that platform should. In designer the platform theme is not set I guess. So, as long as your app looks like it should when running I would not bother.
@jsulm , thank you, but the point is I want to design the application in Qt to look the same as it will when running, presently in Qt Creator everything looks find, but when running as you can see in the screen shots it does not.
I'm more concerned about the labels being resize and not fitting. How can I set-up Qt Creator to match what will be in the final application when running?
-
@jsulm , thank you, but the point is I want to design the application in Qt to look the same as it will when running, presently in Qt Creator everything looks find, but when running as you can see in the screen shots it does not.
I'm more concerned about the labels being resize and not fitting. How can I set-up Qt Creator to match what will be in the final application when running?
@SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:
I'm more concerned about the labels being resize and not fitting
Sounds more like layout issue than theme. What happens if you resize the window/widget in designer?
Also, does your app look like any other app on the same system? -
@SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:
I'm more concerned about the labels being resize and not fitting
Sounds more like layout issue than theme. What happens if you resize the window/widget in designer?
Also, does your app look like any other app on the same system?@jsulm , whilst viewing in designer the form fits perfectly and everything looks great. The look of the controls do look the same as other native applications, however the point I'm trying to make is that forms in Qt Creator shouldn't look different in design to how they will when compiled.
Qt Creator should present the forms in the way they will look when running on the host, which currently is very different. I would understand if I was viewing the same application on a different OS, but its the same host, not a different OS and not a different system.
-
@jsulm , thank you, but the point is I want to design the application in Qt to look the same as it will when running, presently in Qt Creator everything looks find, but when running as you can see in the screen shots it does not.
I'm more concerned about the labels being resize and not fitting. How can I set-up Qt Creator to match what will be in the final application when running?
@SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:
How can I set-up Qt Creator to match what will be in the final application when running?
Layouts apply first when you run your app. So, what you see in QtCreator's Design mode may look different from what your app / widgets really look on runtime.
-
@jsulm , whilst viewing in designer the form fits perfectly and everything looks great. The look of the controls do look the same as other native applications, however the point I'm trying to make is that forms in Qt Creator shouldn't look different in design to how they will when compiled.
Qt Creator should present the forms in the way they will look when running on the host, which currently is very different. I would understand if I was viewing the same application on a different OS, but its the same host, not a different OS and not a different system.
@SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:
whilst viewing in designer the form fits perfectly and everything looks great
That's why I asked what happens if you resize the form in designer? Does everything still fit?
It would make sense if QtDesigner would use the platform theme by default, but this is something for a change request on Qt bug-tracker.
-
@SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:
whilst viewing in designer the form fits perfectly and everything looks great
That's why I asked what happens if you resize the form in designer? Does everything still fit?
It would make sense if QtDesigner would use the platform theme by default, but this is something for a change request on Qt bug-tracker.
-
@SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:
How can I set-up Qt Creator to match what will be in the final application when running?
Layouts apply first when you run your app. So, what you see in QtCreator's Design mode may look different from what your app / widgets really look on runtime.
-
@jsulm, Given the age and maturity of Qt Creator I would expect this to be the default behaviour.
-
@SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:
How can I set-up Qt Creator to match what will be in the final application when running?
Layouts apply first when you run your app. So, what you see in QtCreator's Design mode may look different from what your app / widgets really look on runtime.
@Pl45m4 said in Qt Creator WYSIWYG isn't giving a true representation:
Layouts apply first when you run your app
They also take effect in designer (try to resize the form with properly set layouts).
-
@Pl45m4 said in Qt Creator WYSIWYG isn't giving a true representation:
Layouts apply first when you run your app
They also take effect in designer (try to resize the form with properly set layouts).
@jsulm said in Qt Creator WYSIWYG isn't giving a true representation:
They also take effect in designer (try to resize the form with properly set layouts).
But nevertheless the behavior / look is or feels a bit different in QtDesigner (from my experience)
-
@Pl45m4 , why? When I use an WYSIWYG editor I expect the output to be exactly as I design, unless I resize it.
-
What layouts do you have here and how are your sizeHints and stretches configured?
-
@Pl45m4, the main layout is a QGridLayout, however the controls that I'm having a problem with are not in the layout they children of the centralWidget.
@SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:
however the controls that I'm having a problem with are not in the layout they children of the centralWidget.
That's why I asked (two times) what happens if you resize the form in designer, but you still did not answer...
-
@SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:
however the controls that I'm having a problem with are not in the layout they children of the centralWidget.
That's why I asked (two times) what happens if you resize the form in designer, but you still did not answer...
-
@Pl45m4, the main layout is a QGridLayout, however the controls that I'm having a problem with are not in the layout they children of the centralWidget.
@SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:
are not in the layout they children of the centralWidget.
So your "Select Trainee" label is floating around? :)
Then you don't have to wonder why other widgets cover it. -
@SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:
are not in the layout they children of the centralWidget.
So your "Select Trainee" label is floating around? :)
Then you don't have to wonder why other widgets cover it.@Pl45m4 , On this form there are four buttons to the left of the label, these are all of a specific size and position, when viewing in designer everything looks great and nothing is wrong.
When I launch the application I am not resizing or moving anything, it initial state looks very different from how it did in designer.
No other widgets are covering it, the font size and size of the label is different.
-
@Pl45m4 , On this form there are four buttons to the left of the label, these are all of a specific size and position, when viewing in designer everything looks great and nothing is wrong.
When I launch the application I am not resizing or moving anything, it initial state looks very different from how it did in designer.
No other widgets are covering it, the font size and size of the label is different.
@SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:
No other widgets are covering it
I thought the button on the left is covering your text...
the font size and size of the label is different.
Because the size of your label is not expanding with its content, because no layout will stretch your label :)
You could try to set a minimum size in QtDesigner that fits your content.