in my GUI program I have a QToolBar at the bottom of my mainwindow which contains a number of QAction buttons for opening various dialogs.
Now, I have adjusted the size (i.e. width) of icons of the QToolBar through the QTCreator interface size policy. The size of icons are set manually in such a way that they occupy the entire width of the QToolBar.
Now, due to some required functionality of my program, I need to disable / hide one QAction button (i.e. the Icon). But when I hide that;
if(myconditions = true) //when my conditions to hide the button are met
{
ui->myaction->setVisible(false)
}
The rest of the QAction icons shift accordingly and a blank space (with the width same to the hidden icon) is left in the toolbar.
Can I adjust the size (i.e. width) of icons of the QToolBar through coding so that they occupy the entire space even if one or some gets hidden ? I couldnt find such options in the QTCreator GUI - icon size options.
From the documentation it seems it can be solved using iconSize
but I dont know how to use it in code.