aboutsummaryrefslogtreecommitdiffstats
path: root/examples/projects/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/projects/__init__.py')
-rw-r--r--examples/projects/__init__.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/projects/__init__.py b/examples/projects/__init__.py
index 29947e7..ec0cc08 100644
--- a/examples/projects/__init__.py
+++ b/examples/projects/__init__.py
@@ -42,9 +42,12 @@
# project. It also includes a dependency on a plugin
# that can be disabled.
+import examples_common
import view
from PythonExtension import QtCreator
+from PySide2.QtCore import QObject, SIGNAL
+from PySide2.QtWidgets import QAction
# When importing optional bindings, we can warn the user in case things go south
try:
@@ -61,5 +64,8 @@ def showProjectPath():
else:
view.error("Please open a project")
-helpMenu = QtCreator.Core.ActionManager.actionContainer("QtCreator.Menu.Window")
-helpMenu.menu().addAction("Show Project Directory", showProjectPath)
+action = QAction("Show Project Directory")
+command = QtCreator.Core.ActionManager.registerAction(action, 'PythonExtensions.Examples.ShowProjectDirectory')
+QObject.connect(action, SIGNAL('triggered()'), showProjectPath)
+
+examples_common.addExampleItem(command)