I have a plugin with QDockWidget and QActions. When I first load (or reload) the plugin, the actions' size is set according to current settings.
However, when QGIS is closed and open, the actions are smaller. The size of my actions is "one step behind" QGIS settings unless the smallest icon size is set.
Here is a part of my code where dock widget is initialized and showed/hidden.
def initGui(self):
self.dockWidget = dockwidget.DockWidget(self.iface)
self.iface.addDockWidget(Qt.TopDockWidgetArea, self.dockWidget)
def unload(self):
self.iface.removeDockWidget(self.dockWidget)
def run(self):
if not self.dockWidget.isVisible():
self.dockWidget.show()
else:
self.dockWidget.hide()
Is there a way to keep the actions' size according to QGIS settings?
The only idea I came up with is to keep track of the dock widget's current area and initialize the dock widget every time QGIS starts but that is not satisfying.