QGIS 3.0 is not backwardly compatible with QGIS 2.0, so currently my plugin (which was fine in the old version) is broken and I am trying to overhaul as required. The documentation seems to be taking a while to catch up with the software.
Would anyone be able to post some code which shows how to create a custom menu for a plugin in version 3.0?
My existing method (good in version 2.x / PyQt4) is this:
from PyQt4 import QtGui self.menu = QMenu( "&Whatever", self.iface.mainWindow().menuBar() ) actions = self.iface.mainWindow().menuBar().actions() lastAction = actions[-1] self.iface.mainWindow().menuBar().insertMenu( lastAction, self.menu ) mnuSub1 = self.menu.addMenu('Sub-menu') mnuSub1.setIcon(QIcon(icoFolder + 'img1.png')) mnuAction = mnuSub1.addAction("Do something...",self.RunSomething)