Design mode on a form of a MainWindow (derived from QMainWindow) does not allow one (in any way I can see) to add a tool button to a tool bar that has been added to the main window.
If I try drag and drop from the widgets panel, I get a "Not allowed" symbol (on Linux, behavior similar on Mac) – I can’t drop the tool button on to the tool bar (I took a screenshot, but it is not informative because the "Not allowed" cursor symbol is not shown in the screenshot).
I have a pretty good idea of how I could add a QToolButton programmatically (unless I misunderstand how QToolBar is supposed to work), but I would prefer that I understand how to use design mode properly.
Thanks for any help.
For adding one tool button to toolBar you should :
- Create one Action like this (Go to Action Editor Tab and select New Button) :
- This Action is your tool button so Create Name and Icon and …
- Drag that Action and then Drop it in ToolBar like this
Answered By – Parisa.H.R
Answer Checked By – Gilberto Lyons (BugsFixing Admin)