Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

menubar pyqt

menubar = self.menuBar() # create our menubar
file = menubar.addMenu("&File") # create a file menu
open = QAction("&Open", self) # create a QAction
open.setShortcut("Ctrl+O") # set a shortcut for it
file.addAction(open) # and add it to our menu

# create another one and add it again to our menu
save = QAction("&Save",self) 
save.setShortcut("Ctrl+S")
file.addAction(save)

# and if you want to connect your QActions to your slots you can do it like:
open.triggered.connect(lambda: self.yourfunction())
Comment

PREVIOUS NEXT
Code Example
Python :: try catch in python 
Python :: reverse an array pyton 
Python :: how to remove quotes from a string in python 
Python :: python convert images to pdf 
Python :: pandas dataframe filter 
Python :: python nonlocal 
Python :: extract integer from a string in pandas 
Python :: python datetime format string 
Python :: pandas categorical to numeric 
Python :: pandas dataframe sort by column name first 10 values 
Python :: python typing effect 
Python :: python iterate list 
Python :: random.choice 
Python :: python how to make multiple box plots 
Python :: seaborn and matplotlib Setting the xlim and ylim python 
Python :: text widget get tkinter 
Python :: dataframe string find count 
Python :: python substring in string 
Python :: python factorial 
Python :: Python code for checking if a number is a prime number 
Python :: pandas dataframe column based on another column 
Python :: current date and time django template 
Python :: discord get bot profile picture 
Python :: python count values in list 
Python :: how to check if item is in the variable python 
Python :: excute a command using py in cmd 
Python :: selenium save webpage as pdf python 
Python :: matplotlib bar chart 
Python :: random int python 
Python :: how to search in django 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =