import sys
from PyQt5 import QtGui, QtCore, QtWidgets

class Window(QtWidgets.QMainWindow):


    def __init__(self):

        super(Window, self).__init__()
        self.setGeometry(50, 50, 400, 200)

        closeAction = QtWidgets.QAction("Is truncated if no shortcut", self)
        closeAction.setShortcut("Ctrl+Q")
        closeAction.triggered.connect(self.close_application)

        mainMenu = self.menuBar()
        fileMenu = mainMenu.addMenu('&File')
        fileMenu.addAction(closeAction)
        
        self.home()


    def home(self):
        btn = QtWidgets.QPushButton("Quit", self)
        btn.clicked.connect(self.close_application)
        btn.resize(btn.minimumSizeHint())
        btn.move(0,75)

        #Comment this line to prevent menu truncating on the first access
        btn.setGraphicsEffect(QtWidgets.QGraphicsDropShadowEffect(self))
        
        self.show()

    def close_application(self):
        sys.exit()


def run():
    app = QtWidgets.QApplication(sys.argv)
    GUI = Window()
    sys.exit(app.exec_())


run()