Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-01-05 13:44:24 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-01-06 08:51:28 +0100
commitb62040783613568901e76a26799e130632004a7e (patch)
treeedb38100c2e21f7b92cc49f6cd8874a381342d33 /examples/scriptableapplication/mainwindow.cpp
parent50a30e50ba5edd2cdeefe3118e0a0f7e79e3732f (diff)
scriptable application: Actually make the generated module available
A call to PyImport_AppendInittab() before Py_Initialize() is required to be able to import the module. Previously, the example would only add the instance of the mainwindow under the "__main__" module. Pick-to: 6.0 Task-number: PYSIDE-841 Change-Id: Ib87ddd9fa9e4dbdcf413abe1d9e6273811fc414c Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'examples/scriptableapplication/mainwindow.cpp')
-rw-r--r--examples/scriptableapplication/mainwindow.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/scriptableapplication/mainwindow.cpp b/examples/scriptableapplication/mainwindow.cpp
index 315ea227e..15c8b59f0 100644
--- a/examples/scriptableapplication/mainwindow.cpp
+++ b/examples/scriptableapplication/mainwindow.cpp
@@ -67,6 +67,7 @@
#include <QtCore/QTextStream>
static const char defaultScript[] = R"(
+import AppLib
print("Hello, world")
mainWindow.testFunction1()
)";