Since a QSpacerItem does not inherit QWidget, I can't use addWidget(). So how do I add a spacer to a toolbar?
Printable View
Since a QSpacerItem does not inherit QWidget, I can't use addWidget(). So how do I add a spacer to a toolbar?
All addSeperator() did was add this little vertical line. I was hoping to add more space and have the ability to customize the scaling and such.
Add an empty QLabel. The only downside of this I found so far is that you wont be able to move the window around on macos when clicking on that empty space made by the label.
Add a QWidget instead of a QSpacerItem, set the size policy on the spacer and add the widget to the toolbar.
Code:
// toolBar is a pointer to an existing toolbar toolBar->addWidget(spacer);