| 177 | The example application is basically a normal !PySide application, it imports !PySide, instantiates QApplication and starts the main loop. There is only one main difference in this piece of code: |
| 178 | |
| 179 | {{{ |
| 180 | from ctypes import * |
| 181 | PROJECT_FOLDER = os.environ['PYSIDE_APPLICATION_FOLDER'] |
| 182 | # 'PYSIDE_APPLICATION_FOLDER' can be configured in main.h |
| 183 | LIB_DIR = os.path.join(PROJECT_FOLDER, 'files/python/lib') |
| 184 | SHIBOKEN_SO = os.path.join(LIB_DIR, 'libshiboken.so') |
| 185 | PYSIDE_SO = os.path.join(LIB_DIR, 'libpyside.so') |
| 186 | }}} |
| 187 | |
| 188 | Due to some not yet identified bug, unless {{{libshiboken.so}}} & {{{libpyside.so}}} are manually loaded to memory like this, importing any !PySide module fails. |
| 189 | |
| 190 | '''So make sure this piece of code is somewhere in your application and is executed before import of any !PySide module takes place.''' |
| 191 | |
| 192 | Regarding the {{{PYSIDE_APPLICATION_FOLDER}}} environmental variable, it is set by the {{{main.cpp}}} wrapper and can be configured in {{{main.h}}} . |