I have been trying to implement a menu bar in my program for a few days now and i cant seem to get one running. I would like someone to look at my code and give me a template to follow to making a menu bar.
class MainWindow(QMainWindow):
def __init__(self, databaseFilePath, userFilePath):
super(MainWindow,self).__init__()
self.moviesFilePath = moviesFilePath
self.currentUserFilePath = currentUserFilePath
self.createWindow()
def changeFilePath(self):
self.currentUserFilePath = functions_classes.changeFP()
functions_classes.storeFP(self.currentUserFilePath, 1)
def createWindow(self):
self.setWindowTitle('Movies')
#Menu Bar
fileMenuBar = QMenuBar().addMenu('File')
The method changeFilePath is what I would like to be called when a menu option called 'Change user database location' is called from the menu bar File. I have read that actions are the key to this but when every i have tried to implement them they haven't worked.