Unsolved Qt Creator WYSIWYG isn't giving a true representation
-
@Pl45m4 , why? When I use an WYSIWYG editor I expect the output to be exactly as I design, unless I resize it.
-
@SPlatten Since I'm not a QtDesigner developer I can't comment on the reasons for that, you can ask on the Qt mailing list.
-
@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)
-
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...
-
@jsulm , nothing happens if I resize in the designer.
-
@SPlatten So, this is indeed a problem with layouts (or lack of layouts) and not themes...
-
@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.
-
@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. -
@Pl45m4 , thank you, I've dropped in a Horizontal Layout and added the top row of controls to that, the application is better, although the presentation in designer is still not the same and whilst it's perfect in designer, the application still has a label that isn't displaying all characters.
-
@SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:
the application still has a label that isn't displaying all characters.
Weird. Shouldn't be the case, if done right.
-
@Pl45m4 , in fact every thing I've tried still results in the label showing everything except the first letter "S".
-
I believe there's still something wrong. Show your layout please (the layout / widget setup and the result you get)
-
@SPlatten
I think it is layout issue.
In QT Creator You see it
But while compiling it may show some or none of thingsTry applying horizontal layout label and QComboBox as discussed by @Pl45m4
Then I am sure It will work
It may not work if the window size is small Try resizing itWhy you can't expect the output from QT Creator
The height and width in QT Creator just for there unless layout is applied to it?
If the design in QT Creator fills the screen properly Then would you expect it fill to all screens in the same behaviour "NO"
So It's specific to that size only So I guess layouts are
EASY
RESPONSIVE
ATTRACTIVEI hope it helps
-
This is now resolved, I redid the main window ui, the top line buttons and widgets are now in a horizontal layout with the main window content in a grid layout. As a WYSIWYG editor Qt Creator is rubbish because the presentation of what you see is not what you get.
-
@SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:
As a WYSIWYG editor Qt Creator is rubbish because the presentation of what you see is not what you get.
I don't see how this should work - first you've styles which slightly modifies the items and then you can set the sizes and others by code - so what do you expect that this should work out?
That's why you have to use layouts - they arrange the widgets the way you want without killing the layout when another style is used or similar. -
@SPlatten said in Qt Creator WYSIWYG isn't giving a true representation:
As a WYSIWYG editor Qt Creator is rubbish
I think the mistake you were doing was that you were designing your UI manually (positions and sizes of the widgets) for a specific theme. This is a very bad idea in my opinion because your UI is going to break as soon as the theme changes.
Lets assume QtDesigner would use the system theme, you are on Windows 10 and design your UI manually, everything is fine. One day Microsoft changes the theme (this will for sure happen one day) - your UI breaks, you have to adjust the UI and rebuild your app for the new Windows version. And there is one more thing to consider: if you're working on a cross platform app then your UI will only behave properly on the platform were you created it...I use QtDesigner a lot and don't see how it is rubbish as long as you use layouts. So, instead of blaming the tool use it properly.