Layouts in Qt Creator
-
I'm trying to layout what should be quite simple but is taking way to much time and effort. I have a form with a QGridLayout using Qt Creator I'm trying to create a layout showing:
##### of #####
I have the QGridLayout on the form, I've dragged the three labels onto the grid layout and they appear as children of the layout, but on the WYSIWYG display they are all in vertical rows in a single column.
I cannot see any properties or options to specify the rows and columns.
If I use the context menu and change select layout horizontally it changes the QGridLayout to a QHBoxLayout, still can't specify column order and now the ** of ** appears at the front of the layout, so frustrating, how do I set it up the way I want it which is as shown above.
In the end I ended up using the XML editor to do exactly what I want, but seems like a bit of a hack because the WYSIWYG editor is so bad.
-
I'm trying to layout what should be quite simple but is taking way to much time and effort. I have a form with a QGridLayout using Qt Creator I'm trying to create a layout showing:
##### of #####
I have the QGridLayout on the form, I've dragged the three labels onto the grid layout and they appear as children of the layout, but on the WYSIWYG display they are all in vertical rows in a single column.
I cannot see any properties or options to specify the rows and columns.
If I use the context menu and change select layout horizontally it changes the QGridLayout to a QHBoxLayout, still can't specify column order and now the ** of ** appears at the front of the layout, so frustrating, how do I set it up the way I want it which is as shown above.
In the end I ended up using the XML editor to do exactly what I want, but seems like a bit of a hack because the WYSIWYG editor is so bad.
-
I'm trying to layout what should be quite simple but is taking way to much time and effort. I have a form with a QGridLayout using Qt Creator I'm trying to create a layout showing:
##### of #####
I have the QGridLayout on the form, I've dragged the three labels onto the grid layout and they appear as children of the layout, but on the WYSIWYG display they are all in vertical rows in a single column.
I cannot see any properties or options to specify the rows and columns.
If I use the context menu and change select layout horizontally it changes the QGridLayout to a QHBoxLayout, still can't specify column order and now the ** of ** appears at the front of the layout, so frustrating, how do I set it up the way I want it which is as shown above.
In the end I ended up using the XML editor to do exactly what I want, but seems like a bit of a hack because the WYSIWYG editor is so bad.
@SPlatten said in Layouts in Qt Creator:
because the WYSIWYG editor is so bad
It's actually not that bad. It requires a steady hand and some patience to move the widgets where they should go.
You can fill every row / column of your gridLayout by using the design mode. -
@SPlatten said in Layouts in Qt Creator:
because the WYSIWYG editor is so bad
It's actually not that bad. It requires a steady hand and some patience to move the widgets where they should go.
You can fill every row / column of your gridLayout by using the design mode. -
@Pl45m4 , its no-where near as good as it could be, I'm no fan of Microsoft but Microsofts Visual Studio was considerably easier to use and get better results from than Qt Creator and that's going back to the 1980s.
@SPlatten said in Layouts in Qt Creator:
@Pl45m4 , its no-where near as good as it could be, I'm no fan of Microsoft but Microsofts Visual Studio was considerably easier to use and get better results from than Qt Creator and that's going back to the 1980s.
I think that you are confusing Qt Creator with Qt Designer. Qt Creator also uses Designer embedded.
Qt Designer only let's you design Ui files. Qt Creator is an IDE.
Of course you can use Visual Studio for developing and Qt Designer to design Ui files (as I do). -
@SPlatten said in Layouts in Qt Creator:
@Pl45m4 , its no-where near as good as it could be, I'm no fan of Microsoft but Microsofts Visual Studio was considerably easier to use and get better results from than Qt Creator and that's going back to the 1980s.
I think that you are confusing Qt Creator with Qt Designer. Qt Creator also uses Designer embedded.
Qt Designer only let's you design Ui files. Qt Creator is an IDE.
Of course you can use Visual Studio for developing and Qt Designer to design Ui files (as I do). -
@SPlatten said in Layouts in Qt Creator:
@Pl45m4 , its no-where near as good as it could be, I'm no fan of Microsoft but Microsofts Visual Studio was considerably easier to use and get better results from than Qt Creator and that's going back to the 1980s.
I think that you are confusing Qt Creator with Qt Designer. Qt Creator also uses Designer embedded.
Qt Designer only let's you design Ui files. Qt Creator is an IDE.
Of course you can use Visual Studio for developing and Qt Designer to design Ui files (as I do).@ollarch , here is the form I'm trying to get right in designer:
What I would like to do is get all the labels on the left formatted to the same width and right aligned.Then have the figures that in the screenshot read:
1832 of 46783
Formatted so they are all left aligned to the Blocks label without all the whitespace.
I would also like the Abort pushbutton resized and aligned to the bottom right of the form.
Finally I would like the form height to have the same padding from the bottom of the Abort button as the border padding to the left and right.
I've spent a long time trying and failing to resolve this.
-
@ollarch , here is the form I'm trying to get right in designer:
What I would like to do is get all the labels on the left formatted to the same width and right aligned.Then have the figures that in the screenshot read:
1832 of 46783
Formatted so they are all left aligned to the Blocks label without all the whitespace.
I would also like the Abort pushbutton resized and aligned to the bottom right of the form.
Finally I would like the form height to have the same padding from the bottom of the Abort button as the border padding to the left and right.
I've spent a long time trying and failing to resolve this.
@SPlatten said in Layouts in Qt Creator:
Formatted so they are all left aligned to the Blocks label without all the whitespace
Then add a Horizontal Spacer at the right side of that line...
-
@SPlatten said in Layouts in Qt Creator:
Formatted so they are all left aligned to the Blocks label without all the whitespace
Then add a Horizontal Spacer at the right side of that line...
-
@ollarch , yes, you are correct. How do you use Visual Studio with the Qt palette of tools ?
I have Visual Studio 2019.
-
@jsulm , easier said than done, how? I've dragged it onto the form an it appears below the row I want.
[Edit] Done it, dragged and dropped directly onto the data where I want it.
-
@ollarch , I'm getting so frustrated with it, its not WYSIWYG at all, I've just formatted it and was happy with the design, built project and the end result is nothing like it appears in the WYSIWYG editor.
-
Because the layouts apply after building (and displaying) your widget. So there might be some rearrangement.
The WYSIWYG editor shows how it could look like.