Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

qmenu

import sys
from PyQt5 import QtCore, QtWidgets


class Window(QtWidgets.QWidget):
    def __init__(self):
        super(Window, self).__init__()

        layout = QtWidgets.QGridLayout(self)
        menubar = QtWidgets.QMenuBar()
        filemenu = menubar.addMenu('MENU')
        filemenu.triggered.connect(self.actionClicked)
        filemenu.addAction('Option #1')
        filemenu.addAction('Option #2')
        layout.addWidget(menubar)

    @QtCore.pyqtSlot(QtWidgets.QAction)
    def actionClicked(self, action):
        print('Action: ', action.text())


if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    window = Window()
    window.setGeometry(600, 100, 300, 100)
    window.show()
    sys.exit(app.exec_())
Comment

PREVIOUS NEXT
Code Example
Python :: python regex exclude letters 
Python :: list average python recursion 
Python :: genisim 4.0 words 
Python :: create multiple marks python for python 
Python :: Examples of correct code for this rule with global declaration: 
Python :: how to make a yes or no question in python 
Python :: python relative seek 
Python :: problème barbier semaphore python 
Python :: integration test python 
Python :: Flask_SQLAlchemy is claiming my value is not boolean 
Python :: SQLAlchemy ordering by count on a many to many relationship 
Python :: singke line expresions python 
Python :: imprimir variables en python 
Python :: python json string indices must be integersAdd Answer 
Python :: import all csv as individual dataframes python 
Python :: ring open another file 
Python :: hacer un programa en python ingresar números enteros obtenga el segundo valor máximo 
Python :: gfxdraw circle weight 
Python :: how to write stuff in python 
Python :: python loc id in list 
Python :: instaed of: newlist = [] for word in wordlist: newlist.append(word.upper()) 
Python :: Find dataframe column values containing a certain string 
Python :: how to bubble search in python stack overflow 
Python :: Quiver Simple Demo 
Python :: pandas mean and sum 
Python :: maximum number of charectors allowed for a string variable in python 
Python :: loop only to the 6th element python 
Python :: vs code notes extension 
Python :: django edit model without loading from db 
Python :: how to insert an array as a parameter in python 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =