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 :: python lambda 
Python :: twitter api v2 python tweepy 
Python :: flask get data from html form 
Python :: writerows to existing csv python 
Python :: pd.dataframe initial columns 
Python :: python recursion save value 
Python :: how to get the ip address of laptop with python 
Python :: Python datetime to string using strftime() 
Python :: print out a name in python 
Python :: make zipfile from directory py 
Python :: takes 1 positional argument but 2 were given python 
Python :: can list comprehenios contain else 
Python :: multiple bar graph in python 
Python :: open word from python 
Python :: how to delete all instances of a model in django 
Python :: python show charracter code 
Python :: zero crossing rate python 
Python :: python 
Python :: python subprocess exception handling 
Python :: python - subset dataframe based on unique value of a clumn 
Python :: python if not null or empty 
Python :: django now template tag 
Python :: label change in tkinter 
Python :: index of a string index dataframe 
Python :: how to count null values in pandas and return as percentage 
Python :: position in array python 
Python :: django prefetch_related vs select_related 
Python :: python file hashlib 
Python :: minmaxscaler python 
Python :: python sort the values in a dictionary 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =