当前位置: 首页>>代码示例>>Python>>正文


Python QAction.setWhatsThis方法代码示例

本文整理汇总了Python中PySide.QtGui.QAction.setWhatsThis方法的典型用法代码示例。如果您正苦于以下问题:Python QAction.setWhatsThis方法的具体用法?Python QAction.setWhatsThis怎么用?Python QAction.setWhatsThis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PySide.QtGui.QAction的用法示例。


在下文中一共展示了QAction.setWhatsThis方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: createAction

# 需要导入模块: from PySide.QtGui import QAction [as 别名]
# 或者: from PySide.QtGui.QAction import setWhatsThis [as 别名]
def createAction(self, icon, toolTip, statusTip, scripted=False):
    """
    TOWRITE

    :param `icon`: TOWRITE
    :type `icon`: QString
    :param `toolTip`: TOWRITE
    :type `toolTip`: QString
    :param `statusTip`: TOWRITE
    :type `statusTip`: QString
    :param `scripted`: TOWRITE
    :type `scripted`: bool
    :rtype: `QAction`_

    .. TODO:: send the global Icon, Image, Commands Dirs in to be used.

    """
    connect = self.connect  # NOT local optimization, but for ease of the code looking similar to the C++ whash
    mdiArea = self.mdiArea  # ditto

    ACTION = QAction(
        QIcon(self.gIconDir + os.sep + self.getSettingsGeneralIconTheme() + "/" + icon + ".png"), toolTip, self
    )  # QAction *  # TODO: Qt4.7 wont load icons without an extension...
    ACTION.setStatusTip(statusTip)
    ACTION.setObjectName(icon)
    # TODO: Set What's This Context Help to statusTip for now so there is some infos there.
    # Make custom whats this context help popup with more descriptive help than just
    # the status bar/tip one liner(short but not real long) with a hyperlink in the custom popup
    # at the bottom to open full help file description. Ex: like wxPython AGW's SuperToolTip.
    ACTION.setWhatsThis(statusTip)
    # TODO: Finish All Commands ... <.<

    if icon == "donothing":
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("doNothing()"))
    elif icon == "new":
        ACTION.setShortcut(QKeySequence.New)
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("newFile()"))
    elif icon == "open":
        ACTION.setShortcut(QKeySequence.Open)
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("openFile()"))
    elif icon == "save":
        ACTION.setShortcut(QKeySequence.Save)
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("savefile()"))
    elif icon == "saveas":
        ACTION.setShortcut(QKeySequence.SaveAs)
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("saveasfile()"))
    elif icon == "print":
        ACTION.setShortcut(QKeySequence.Print)
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("print_()"))
    elif icon == "designdetails":
        ACTION.setShortcut(QKeySequence("Ctrl+D"))
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("designDetails()"))
    elif icon == "exit":
        ACTION.setShortcut(QKeySequence("Ctrl+Q"))
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("exit()"))

    elif icon == "cut":
        ACTION.setShortcut(QKeySequence.Cut)
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("cut()"))
    elif icon == "copy":
        ACTION.setShortcut(QKeySequence.Copy)
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("copy()"))
    elif icon == "paste":
        ACTION.setShortcut(QKeySequence.Paste)
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("paste()"))

    elif icon == "windowcascade":
        connect(ACTION, SIGNAL("triggered()"), mdiArea, SLOT("cascade()"))
    elif icon == "windowtile":
        connect(ACTION, SIGNAL("triggered()"), mdiArea, SLOT("tile()"))
    elif icon == "windowclose":
        ACTION.setShortcut(QKeySequence.Close)
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("onCloseWindow()"))
    elif icon == "windowcloseall":
        connect(ACTION, SIGNAL("triggered()"), mdiArea, SLOT("closeAllSubWindows()"))
    elif icon == "windownext":
        ACTION.setShortcut(QKeySequence.NextChild)
        connect(ACTION, SIGNAL("triggered()"), mdiArea, SLOT("activateNextSubWindow()"))
    elif icon == "windowprevious":
        ACTION.setShortcut(QKeySequence.PreviousChild)
        connect(ACTION, SIGNAL("triggered()"), mdiArea, SLOT("activatePreviousSubWindow()"))

    elif icon == "help":
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("help()"))
    elif icon == "changelog":
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("changelog()"))
    elif icon == "tipoftheday":
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("tipOfTheDay()"))
    elif icon == "about":
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("about()"))
    elif icon == "whatsthis":
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("whatsThisContextHelp()"))

    elif icon == "icon16":
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("icon16()"))
    elif icon == "icon24":
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("icon24()"))
    elif icon == "icon32":
        connect(ACTION, SIGNAL("triggered()"), self, SLOT("icon32()"))
    elif icon == "icon48":
#.........这里部分代码省略.........
开发者ID:stevegt,项目名称:Embroidermodder,代码行数:103,代码来源:mainwindow_actions.py


注:本文中的PySide.QtGui.QAction.setWhatsThis方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。