aboutsummaryrefslogtreecommitdiffstats
path: root/examples/scriptableapplication/README.txt
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-05 15:58:35 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-12 12:28:10 +0000
commit9f2a9aba3aff73e31ea15eb4a7a04b0e50f4ee4e (patch)
tree92dcb0c4f64df8a8375af2e1a9bb1170068c36b2 /examples/scriptableapplication/README.txt
parent26c046e521c38bbfc3a263782a3bb74a7c1bf937 (diff)
Move examples from submodule to pyside-setup
Move PySide2 examples that are owned by the Qt Company to a new examples directory. Done-with: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Task-number: PYSIDE-363 Change-Id: I14099764d9eef2bc35e067086121427955862e3a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'examples/scriptableapplication/README.txt')
-rw-r--r--examples/scriptableapplication/README.txt33
1 files changed, 33 insertions, 0 deletions
diff --git a/examples/scriptableapplication/README.txt b/examples/scriptableapplication/README.txt
new file mode 100644
index 000000000..28bdb44ae
--- /dev/null
+++ b/examples/scriptableapplication/README.txt
@@ -0,0 +1,33 @@
+scriptableapplication demonstrates how to make a Qt C++ application scriptable.
+
+It has a class MainWindow inheriting QMainWindow for which bindings are generated
+using PySide2's shiboken2 bindings generator.
+
+The header wrappedclasses.h is passed to shiboken2 which generates class
+wrappers and headers in a subdirectory which are linked into the application.
+
+pythonutils.cpp has some code which binds the instance of MainWindow
+to a variable 'mainWindow' in the global (__main___) namespace.
+It is then possible to run Python script snippets like
+mainWindow.testFunction1() which trigger the underlying C++ function.
+
+Virtualenv Support
+If the application is started from a terminal with an activated python virtual environment, that
+environment's packages will be used for the python module import process. In this case, make sure
+that the application was built while the virtualenv was active, so that the build system picks up
+the correct python shared library.
+
+Windows Notes
+The build config of the application (Debug or Release) should match the PySide2 build config,
+otherwise the application will not function correctly. In practice this means the only supported
+configurations are:
+1) qmake release config build of the application + PySide2 setup.py without "--debug" flag +
+ python.exe for the PySide2 build process + python36.dll for the linked in shared library +
+ release build of Qt.
+2) qmake debug config build of the application + PySide2 setup.py WITH "--debug" flag +
+ python_d.exe for the PySide2 build process + python36_d.dll for the linked in shared library +
+ debug build of Qt.
+This is necessary because all the shared libraries in question have to link to the same C++ runtime
+library (msvcrt.dll or msvcrtd.dll).
+To make the example as self-contained as possible, the shared libraries in use (pyside2.dll,
+shiboken2.dll) are hard-linked into the build folder of the application.