diff options
author | Eike Ziller <eike.ziller@qt.io> | 2018-09-12 12:30:29 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2018-09-13 06:30:05 +0000 |
commit | 6452612845d7edebbef26a0d2b483c129ab3a073 (patch) | |
tree | d04ec885d18599a60ba82bad59dd81eb2ffebe06 | |
parent | b80eafbd0a60658c7418c3a3537d4ac4f565d112 (diff) |
Make About Python Extensions a nice Qt Creator action
And fix its position on macOS where it should be in the application
menu.
Change-Id: I7d9bcfc8f5a7faa5cd9f5aa0927f43769be5ce51
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r-- | python/extensionmanager/main.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/python/extensionmanager/main.py b/python/extensionmanager/main.py index 6f22f0a..048423b 100644 --- a/python/extensionmanager/main.py +++ b/python/extensionmanager/main.py @@ -41,6 +41,8 @@ # Entry point of the Python extension from PythonExtension import QtCreator +from PySide2.QtCore import * +from PySide2.QtWidgets import * from list import * # Actions @@ -48,5 +50,11 @@ def showExtensionList(): dialog = ListView(QtCreator.Core.ICore.dialogParent()) dialog.exec_() +pythonExtensionsAction = QAction("About Python Extensions...") +pythonExtensionsAction.setMenuRole(QAction.ApplicationSpecificRole) +pythonExtensionsCommand = QtCreator.Core.ActionManager.registerAction(pythonExtensionsAction, + "PythonExtensions.About") +QObject.connect(pythonExtensionsAction, SIGNAL("triggered()"), showExtensionList) + helpMenu = QtCreator.Core.ActionManager.actionContainer("QtCreator.Menu.Help") -helpMenu.menu().addAction("About Python Extensions...", showExtensionList) +helpMenu.addAction(pythonExtensionsCommand, "QtCreator.Group.Help.About") |