本文整理汇总了Python中PySide.QtGui.QAction.setStatusTip方法的典型用法代码示例。如果您正苦于以下问题:Python QAction.setStatusTip方法的具体用法?Python QAction.setStatusTip怎么用?Python QAction.setStatusTip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QAction
的用法示例。
在下文中一共展示了QAction.setStatusTip方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: updateFileMenu
# 需要导入模块: from PySide.QtGui import QAction [as 别名]
# 或者: from PySide.QtGui.QAction import setStatusTip [as 别名]
def updateFileMenu(self):
"""
Updates the file menu dynamically, so that recent files can be shown.
"""
self.menuFile.clear()
# self.menuFile.addAction(self.actionNew) # disable for now
self.menuFile.addAction(self.actionOpen)
self.menuFile.addAction(self.actionSave)
self.menuFile.addAction(self.actionSave_as)
self.menuFile.addAction(self.actionClose_Model)
recentFiles = []
for filename in self.recentFiles:
if QFile.exists(filename):
recentFiles.append(filename)
if len(self.recentFiles) > 0:
self.menuFile.addSeparator()
for i, filename in enumerate(recentFiles):
action = QAction("&%d %s" % (i + 1, QFileInfo(filename).fileName()), self)
action.setData(filename)
action.setStatusTip("Opens recent file %s" % QFileInfo(filename).fileName())
action.setShortcut(QKeySequence(Qt.CTRL | (Qt.Key_1 + i)))
action.triggered.connect(self.load_model)
self.menuFile.addAction(action)
self.menuFile.addSeparator()
self.menuFile.addAction(self.actionQuit)
示例2: on_show_debug_menu
# 需要导入模块: from PySide.QtGui import QAction [as 别名]
# 或者: from PySide.QtGui.QAction import setStatusTip [as 别名]
def on_show_debug_menu(self):
self.debug_menu.clear()
if self.is_master_cmd or self.power_user:
power_user_mode = QAction('Power User Mode', self)
power_user_mode.setCheckable(True)
power_user_mode.setChecked(MTTSettings.value('powerUser'))
power_user_mode.triggered.connect(self.__on_toggle_power_user)
self.debug_menu.addAction(power_user_mode)
self.is_master_cmd = False
self.debug_menu.addSeparator()
open_pref_folder_action = QAction('Open Preferences Folder', self)
open_pref_folder_action.setStatusTip('Open MTT preference folder')
open_pref_folder_action.triggered.connect(self.on_open_preference_folder)
self.debug_menu.addAction(open_pref_folder_action)
self.debug_menu.addSeparator()
database_dump_csv = QAction('Dump Database as CSV', self)
database_dump_csv.triggered.connect(self.view.model.database_dump_csv)
self.debug_menu.addAction(database_dump_csv)
database_dump_sql = QAction('Dump Database as SQL', self)
database_dump_sql.triggered.connect(self.view.model.database_dump_sql)
self.debug_menu.addAction(database_dump_sql)
self.debug_menu.addSeparator()
support_info = QMenu(self)
support_info.setTitle('Supported Node Type')
support_info.aboutToShow.connect(self.on_show_supported_type)
self.debug_menu.addMenu(support_info)
示例3: addExitButton
# 需要导入模块: from PySide.QtGui import QAction [as 别名]
# 或者: from PySide.QtGui.QAction import setStatusTip [as 别名]
def addExitButton(self):
""" Adds the Exit Button to the ToolBar """
exitAction = QAction(self.getQIcon('exit.png'), 'Exit the Application', self)
exitAction.setShortcut('Ctrl+Q')
exitAction.setStatusTip("Exit the Application.")
exitAction.triggered.connect(QtCore.QCoreApplication.instance().quit)
self.addAction(exitAction)
示例4: addNewTransactionButton
# 需要导入模块: from PySide.QtGui import QAction [as 别名]
# 或者: from PySide.QtGui.QAction import setStatusTip [as 别名]
def addNewTransactionButton(self):
""" Adds the New Transaction Button to the ToolBar """
newIcon = self.getQIcon('money.png')
newTransactionAction = QAction(newIcon, 'New Transaction', self)
newTransactionAction.setShortcut('Ctrl+N')
newTransactionAction.setStatusTip("Create a New Transaction.")
newTransactionAction.triggered.connect(self.newTransaction)
self.addAction(newTransactionAction)
示例5: add_action
# 需要导入模块: from PySide.QtGui import QAction [as 别名]
# 或者: from PySide.QtGui.QAction import setStatusTip [as 别名]
def add_action(lbl, tip, cmd, checkable=False, checked=False):
a = QAction(lbl, self)
a.setStatusTip(tip)
a.triggered.connect(cmd)
if checkable:
a.setCheckable(True)
a.setChecked(checked)
return a
示例6: buildExistingTransferSection
# 需要导入模块: from PySide.QtGui import QAction [as 别名]
# 或者: from PySide.QtGui.QAction import setStatusTip [as 别名]
def buildExistingTransferSection(self):
""" Build existing Transfer Section """
if self.toolbar.transaction.account is self.table_view.account:
self.transferLabel = QLabel("Transferred {0}: {1}".format(self.getTransferDirection(), self.toolbar.transaction.transferAccount.name), self.toolbar)
else:
self.transferLabel = QLabel("Transferred {0}: {1}".format(self.getTransferDirection(), self.toolbar.transaction.account.name), self.toolbar)
self.toolbar.addWidget(self.transferLabel)
eraseIcon = self.toolbar.getQIcon('erase.png')
removeTransferAction = QAction(eraseIcon, 'Remove Transfer', self.toolbar)
removeTransferAction.setStatusTip("Remove Transfer.")
removeTransferAction.triggered.connect(self.removeTransfer)
self.toolbar.addAction(removeTransferAction)
示例7: init_ui
# 需要导入模块: from PySide.QtGui import QAction [as 别名]
# 或者: from PySide.QtGui.QAction import setStatusTip [as 别名]
def init_ui(self):
# geometry is x offset, y offset, x width, y width
self.setGeometry(150, 150, 640, 300)
self.setWindowTitle(self.title)
menu_bar = self.menuBar()
file_menu = menu_bar.addMenu('&File')
exitAction = QAction('E&xit', self)
exitAction.setStatusTip('Exit the application.')
exitAction.triggered.connect(self.handle_exit)
file_menu.addAction(exitAction)
main_layout_container = QWidget()
main_layout = QBoxLayout(QBoxLayout.TopToBottom)
image_layout = QBoxLayout(QBoxLayout.LeftToRight)
image_layout.addStretch(1)
self.image1 = QLabel()
self.image1.setAlignment(Qt.AlignCenter)
image_layout.addWidget(self.image1)
image_layout.addWidget(QLabel("vs."))
self.image2 = QLabel()
self.image2.setAlignment(Qt.AlignCenter)
image_layout.addWidget(self.image2)
image_layout.addStretch(1)
main_layout.addLayout(image_layout)
main_layout.addStretch(1)
button_layout = QBoxLayout(QBoxLayout.LeftToRight)
button_layout.addStretch(1)
self.yes_button = QPushButton("Yes")
button_layout.addWidget(self.yes_button)
self.yes_button.clicked.connect(self.handle_yes_pressed)
self.no_button = QPushButton("No")
button_layout.addWidget(self.no_button)
self.no_button.clicked.connect(self.handle_no_pressed)
button_layout.addStretch(1)
main_layout.addLayout(button_layout)
main_layout_container.setLayout(main_layout)
self.image1_filepath = ""
self.image2_filepath = ""
self.load_more_images()
self.setCentralWidget(main_layout_container)
示例8: _createAction
# 需要导入模块: from PySide.QtGui import QAction [as 别名]
# 或者: from PySide.QtGui.QAction import setStatusTip [as 别名]
def _createAction(self, text, slot=None, shortcut=None, icon=None, tip=None, checkable=False, signal="triggered"):
action = QAction(text, self)
if icon is not None:
action.setIcon(QIcon(":/{0}.png".format(icon)))
if shortcut is not None:
action.setShortcut(shortcut)
if tip is not None:
action.setToolTip(tip)
action.setStatusTip(tip)
if slot is not None:
getattr(action, signal).connect(slot)
if checkable:
action.setCheckable(True)
return action
示例9: _createAction
# 需要导入模块: from PySide.QtGui import QAction [as 别名]
# 或者: from PySide.QtGui.QAction import setStatusTip [as 别名]
def _createAction(self, name, slot, shortcut=None, statusTip=None):
action = QAction(name, self)
action.triggered.connect(slot)
if shortcut is not None:
action.setShortcut(shortcut)
if statusTip is not None:
action.setStatusTip(statusTip)
key = _stripEllipsis(name)
self._actions[key] = action
return action
示例10: createactions
# 需要导入模块: from PySide.QtGui import QAction [as 别名]
# 或者: from PySide.QtGui.QAction import setStatusTip [as 别名]
def createactions(self, text, slot=None, shortcut="None", icon=None, tip=None, checkable=False,
signal="triggered()"):
action = QAction(text, self)
if icon is not None:
action.setIcon(QIcon(icon))
if shortcut is not None:
action.setShortcut(shortcut)
if tip is not None:
action.setToolTip(tip)
action.setStatusTip(tip)
if slot is not None:
self.connect(action, SIGNAL(signal), slot)
if checkable:
action.setCheckable(True)
return action
示例11: __init__
# 需要导入模块: from PySide.QtGui import QAction [as 别名]
# 或者: from PySide.QtGui.QAction import setStatusTip [as 别名]
def __init__(self, parent=None):
"""Create Qt widgets, connect event handlers."""
super(App, self).__init__(parent)
self.windowTitle = 'DMD | '
self.fileName = ''
self.setWindowTitle(self.windowTitle + 'Unsaved File')
exitAction = QAction('Exit', self)
exitAction.setShortcut('Ctrl+Q')
exitAction.setStatusTip('Exit application')
exitAction.triggered.connect(self.close)
openAction = QAction('Open', self)
openAction.setShortcut('Ctrl+O')
openAction.setStatusTip('Open Markdown File')
openAction.triggered.connect(self.openFile)
newAction = QAction('New', self)
newAction.setShortcut('Ctrl+N')
newAction.setStatusTip('New Markdown File')
newAction.triggered.connect(self.newFile)
saveAction = QAction('Save', self)
saveAction.setShortcut('Ctrl+S')
saveAction.setStatusTip('Save File')
saveAction.triggered.connect(self.saveFile)
self.statusBar()
menubar = self.menuBar()
fileMenu = menubar.addMenu('&File')
fileMenu.addAction(newAction)
fileMenu.addAction(openAction)
fileMenu.addAction(saveAction)
fileMenu.addAction(exitAction)
self.setGeometry(300, 300, 1024, 768)
self.show()
self.txtInput = QTextEdit()
self.txtInput.setTabStopWidth(20)
self.webPreview = QWebView()
self.webPreview.setHtml('Start typing...', baseUrl=QUrl('preview'))
self.txtInput.textChanged.connect(self.loadPreview)
splitter = QSplitter()
splitter.addWidget(self.txtInput)
splitter.addWidget(self.webPreview)
self.setCentralWidget(splitter)
示例12: __init__
# 需要导入模块: from PySide.QtGui import QAction [as 别名]
# 或者: from PySide.QtGui.QAction import setStatusTip [as 别名]
def __init__(self,fileName=None):
""" Constructor Function
"""
# QWidget.__init__(self)
# self.setWindowTitle("Icon Sample")
# self.setGeometry(300, 300, 200, 150)
QMainWindow.__init__(self)
self.setWindowTitle("Icon Sample")
self.setGeometry(300, 300, 200, 150)
QToolTip.setFont(QFont("Decorative", 8, QFont.Bold))
self.setToolTip('Our Main Window')
self.icon='C:\Users\Hamed\Documents\soheil sites image\imageedit__9411602959.gif'
self.textEdit = QTextEdit()
self.setCentralWidget(self.textEdit)
self.fileName = None
self.filters = "Text files (*.txt)"
openFile = QAction(QIcon('open.png'), 'Open', self)
openFile.setShortcut('Ctrl+O')
openFile.setStatusTip('Open new File')
openFile.triggered.connect(self.showDialog)
menubar = self.menuBar()
# fileMenu = menubar.addMenu('&File')
# fileMenu.addAction(openFile)
self.setGeometry(300, 300, 350, 300)
self.setWindowTitle('Example - File Dialog')
# self.myNameLE = QLineEdit(self)
# self.myAgeLE = QLineEdit(self)
# self.myChoiceLE = QLineEdit(self)
self.statusLabel = QLabel('Showing Progress')
self.progressBar = QProgressBar()
self.progressBar.setMinimum(0)
self.progressBar.setMaximum(100)
##################@@@@@@@@@@@@@@2
self.threads = []
self.addWorker(MyWorkerThread(1))
self.addWorker(MyWorkerThread(2))
#######################@@@@@@@@@@@@@
self.show()
示例13: _parseactions
# 需要导入模块: from PySide.QtGui import QAction [as 别名]
# 或者: from PySide.QtGui.QAction import setStatusTip [as 别名]
def _parseactions(self, actions):
actionlist = []
for act in actions:
atts = actions[act]
if act == "Separator":
newaction = "Separator"
else:
try:
newaction = QAction(QtGui.QIcon(atts["icon"]), atts["text"], self)
except:
newaction = QAction(atts["text"], self)
try:
newaction.setShortcut(atts["shortcut"])
except:
pass
try:
newaction.setStatusTip(atts["statustip"])
except:
pass
actionlist.append((atts["pos"], newaction, act))
actionlist = self._sortbyposition(actionlist)
return actionlist
示例14: __init__
# 需要导入模块: from PySide.QtGui import QAction [as 别名]
# 或者: from PySide.QtGui.QAction import setStatusTip [as 别名]
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
# self.setObjectName("MainWindow")
self.resize(731, 475)
centralwidget = QWidget(self)
# centralwidget.setObjectName("centralwidget")
gridLayout = QGridLayout(centralwidget)
# gridLayout.setObjectName("gridLayout")
# textEdit needs to be a class variable.
self.textEdit = QTextEdit(centralwidget)
# self.textEdit.setObjectName("textEdit")
gridLayout.addWidget(self.textEdit, 0, 0, 1, 1)
self.setCentralWidget(centralwidget)
menubar = QMenuBar(self)
menubar.setGeometry(QRect(0, 0, 731, 29))
# menubar.setObjectName("menubar")
menu_File = QMenu(menubar)
# menu_File.setObjectName("menu_File")
self.setMenuBar(menubar)
statusbar = QStatusBar(self)
# statusbar.setObjectName("statusbar")
self.setStatusBar(statusbar)
actionShow_GPL = QAction(self)
# actionShow_GPL.setObjectName("actionShow_GPL")
actionShow_GPL.triggered.connect(self.showGPL)
action_About = QAction(self)
# action_About.setObjectName("action_About")
action_About.triggered.connect(self.about)
iconToolBar = self.addToolBar("iconBar.png")
#------------------------------------------------------
# Add icons to appear in tool bar - step 1
actionShow_GPL.setIcon(QIcon(":/showgpl.png"))
action_About.setIcon(QIcon(":/about.png"))
action_Close = QAction(self)
action_Close.setCheckable(False)
action_Close.setObjectName("action_Close")
action_Close.setIcon(QIcon(":/quit.png"))
#------------------------------------------------------
# Show a tip on the Status Bar - step 2
actionShow_GPL.setStatusTip("Show GPL Licence")
action_About.setStatusTip("Pop up the About dialog.")
action_Close.setStatusTip("Close the program.")
#------------------------------------------------------
menu_File.addAction(actionShow_GPL)
menu_File.addAction(action_About)
menu_File.addAction(action_Close)
menubar.addAction(menu_File.menuAction())
iconToolBar.addAction(actionShow_GPL)
iconToolBar.addAction(action_About)
iconToolBar.addAction(action_Close)
action_Close.triggered.connect(self.close)
示例15: _initUI
# 需要导入模块: from PySide.QtGui import QAction [as 别名]
# 或者: from PySide.QtGui.QAction import setStatusTip [as 别名]
def _initUI(self,parent):
"Adds the menu items into the menu bar"
#File Menu
#add action
_addAction = QAction("Add Snippet", parent)
_addAction.setShortcut("Ctrl+N")
_addAction.setStatusTip('Add new Snippet')
_addAction.triggered.connect(self._addSnippet)
#edit action
_editAction = QAction("Edit Snippet", parent)
_editAction.setShortcut("Ctrl+O")
_editAction.setStatusTip('Edit Snippet')
_editAction.triggered.connect(self._editSnippet)
#exit action
_exitAction = QAction("&Exit", parent)
_exitAction.setShortcut("Ctrl+Q")
_exitAction.setStatusTip('Exit application')
_exitAction.triggered.connect(parent.closeApp)
# Adding to file menu
_fileMenu = self.addMenu('&File')
_fileMenu.addAction(_addAction)
_fileMenu.addAction(_editAction)
_fileMenu.addSeparator()
_fileMenu.addAction(_exitAction)
#Edit Menu
#copy action
_copyAction = QAction("&Copy", parent)
_copyAction.setShortcut("Ctrl+C")
_copyAction.setStatusTip('Copy text')
_editMenu = self.addMenu('&Edit')
_editMenu.addAction(_copyAction)
#Tools
_toolsMenu = self.addMenu('&Tools')