From b62040783613568901e76a26799e130632004a7e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 5 Jan 2021 13:44:24 +0100 Subject: 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 --- examples/scriptableapplication/mainwindow.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'examples/scriptableapplication/mainwindow.cpp') 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 static const char defaultScript[] = R"( +import AppLib print("Hello, world") mainWindow.testFunction1() )"; -- cgit v1.2.3