diff --git a/.clang-format b/.clang-format deleted file mode 100644 index c8a92dc59..000000000 --- a/.clang-format +++ /dev/null @@ -1,156 +0,0 @@ -Language: Cpp -IndentWidth: 2 -UseTab: Never -ColumnLimit: 120 -SortIncludes: false -AccessModifierOffset: -2 -ReflowComments: false -ConstructorInitializerIndentWidth: 2 -ContinuationIndentWidth: 2 -AllowShortFunctionsOnASingleLine: Inline -BreakBeforeBraces: Custom -BraceWrapping: - AfterExternBlock: true - AfterClass: true - AfterFunction: true - AfterNamespace: false - AfterEnum: false - AfterCaseLabel: true - AfterControlStatement: MultiLine - AfterStruct: false - AfterUnion: false - BeforeLambdaBody: false - BeforeElse: false - BeforeCatch: false - BeforeWhile: false - IndentBraces: false - SplitEmptyFunction: true - SplitEmptyRecord: false - SplitEmptyNamespace: true -PPIndentWidth: 2 -FixNamespaceComments: false -IndentPPDirectives: BeforeHash -SpaceBeforeParens: Custom -SpaceBeforeParensOptions: - AfterControlStatements: true - AfterForeachMacros: true - AfterFunctionDefinitionName: false - AfterFunctionDeclarationName: false - AfterIfMacros: true - AfterOverloadedOperator: false - AfterRequiresInClause: false - AfterRequiresInExpression: false - BeforeNonEmptyParentheses: false -SpaceAfterCStyleCast: false -SpaceAfterLogicalNot: false -SpaceAfterTemplateKeyword: false -SpaceAroundPointerQualifiers: Default -SpaceBeforeAssignmentOperators: true -SpaceBeforeCaseColon: false -SpaceBeforeCpp11BracedList: true -SpaceBeforeCtorInitializerColon: true -SpaceBeforeInheritanceColon: true -SpaceBeforeRangeBasedForLoopColon: true -SpaceBeforeSquareBrackets: false -SpaceInEmptyBlock: false -SpaceInEmptyParentheses: false -SpacesBeforeTrailingComments: 1 -SpacesInAngles: Never -SpacesInConditionalStatement: false -SpacesInContainerLiterals: true -SpacesInCStyleCastParentheses: false -SpacesInLineCommentPrefix: - Minimum: 1 - Maximum: -1 -IndentCaseBlocks: false -IndentCaseLabels: false -AlignAfterOpenBracket: DontAlign -BreakConstructorInitializers: BeforeComma -AlwaysBreakTemplateDeclarations: true -NamespaceIndentation: None -AlignArrayOfStructures: None -AlignConsecutiveAssignments: - Enabled: false - AcrossEmptyLines: false - AcrossComments: false - AlignCompound: false - PadOperators: false -AlignConsecutiveBitFields: - Enabled: false - AcrossEmptyLines: false - AcrossComments: false - AlignCompound: false - PadOperators: false -AlignConsecutiveDeclarations: - Enabled: false - AcrossEmptyLines: false - AcrossComments: false - AlignCompound: false - PadOperators: false -AlignConsecutiveMacros: - Enabled: false - AcrossEmptyLines: true - AcrossComments: false - AlignCompound: false - PadOperators: false -AlignEscapedNewlines: DontAlign -AlignOperands: Align -AlignTrailingComments: true -AllowAllArgumentsOnNextLine: false -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortBlocksOnASingleLine: Empty -AllowShortCaseLabelsOnASingleLine: false -AllowShortEnumsOnASingleLine: true -AllowShortIfStatementsOnASingleLine: Never -AllowShortLambdasOnASingleLine: All -AllowShortLoopsOnASingleLine: false -AlwaysBreakAfterDefinitionReturnType: None -AlwaysBreakAfterReturnType: None -AlwaysBreakBeforeMultilineStrings: false -BinPackArguments: true -BinPackParameters: true -BitFieldColonSpacing: After -BreakBeforeBinaryOperators: NonAssignment -BreakBeforeConceptDeclarations: Always -BreakBeforeTernaryOperators: true -BreakInheritanceList: BeforeColon -BreakStringLiterals: true -CompactNamespaces: false -Cpp11BracedListStyle: true -PointerAlignment: Left -QualifierAlignment: Leave -ReferenceAlignment: Pointer -DerivePointerAlignment: false -DisableFormat: false -EmptyLineAfterAccessModifier: Leave -MaxEmptyLinesToKeep: 1 -EmptyLineBeforeAccessModifier: LogicalBlock -ExperimentalAutoDetectBinPacking: false -ForEachMacros: - - foreach - - Q_FOREACH -StatementAttributeLikeMacros: - - Q_EMIT -StatementMacros: - - Q_UNUSED - - QT_REQUIRE_VERSION - - Q_OBJECT - - PyObject_HEAD -IndentAccessModifiers: false -IndentExternBlock: AfterExternBlock -IndentGotoLabels: true -IndentRequiresClause: true -IndentWrappedFunctionNames: false -InsertBraces: false -InsertTrailingCommas: None -KeepEmptyLinesAtTheStartOfBlocks: true -LambdaBodyIndentation: OuterScope -PackConstructorInitializers: BinPack -RemoveBracesLLVM: false -RequiresClausePosition: OwnLine -SeparateDefinitionBlocks: Leave -ShortNamespaceLines: 1 -SortUsingDeclarations: false -SpacesInParentheses: false -SpacesInSquareBrackets: false -Standard: Latest diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 7a968a8de..000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: -- package-ecosystem: github-actions - directory: "/" - schedule: - interval: monthly diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index d6ebf189e..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,428 +0,0 @@ -name: Build - -on: - push: - branches: - - main - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -defaults: - run: - shell: bash - -jobs: - ubuntu: - strategy: - fail-fast: false - matrix: - container_version: - - '22.04' - - '24.04' - runs-on: ubuntu-latest - container: ubuntu:${{ matrix.container_version }} - steps: - - name: Install Qt - run: | - apt-get update - DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes \ - build-essential \ - python3 \ - python3-dev \ - libpython3-dev \ - qtbase5-dev \ - qtbase5-private-dev \ - qt5-qmake \ - qtbase5-dev-tools \ - qttools5-dev \ - qtdeclarative5-dev \ - libqt5svg5* \ - libqt5xmlpatterns5* \ - libqt5multimedia5* \ - libqt5multimediawidgets5* \ - libqt5qml5* \ - libqt5quickwidgets5* \ - qtmultimedia5-dev - apt-get clean - - - name: Checkout PythonQt - uses: actions/checkout@v6 - - - name: Ccache - uses: hendrikmuhs/ccache-action@v1.2.22 - with: - key: ${{ runner.os }}-ubuntu-${{ matrix.container_version }} - evict-old-files: 'job' - - - name: Build PythonQt (generator_only) - run: | - export QT_SELECT=qt5 - echo ======= SYSTEM INFO ======== - uname -a; gcc --version | grep "gcc"; qmake --version - echo ============================ - qmake -r PythonQt.pro CONFIG+=ccache CONFIG+=release CONFIG+=force_debug_info \ - CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \ - CONFIG+=generator_only - make -j $(nproc) - - - name: Generate Wrappers - run: | - # workaround to allow to find the Qt include dirs for installed standard qt packages - mkdir /usr/include/qt5; ln -s /usr/include/x86_64-linux-gnu/qt5 /usr/include/qt5/include - export QTDIR=/usr/include/qt5 - UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \ - ./generator/pythonqt_generator \ - --output-directory=. - - - name: Build PythonQt (exclude_generator) - run: | - export QT_SELECT=qt5 - echo ======= SYSTEM INFO ======== - uname -a; gcc --version | grep "gcc"; python3 --version; qmake --version - echo ============================ - qmake -r PythonQt.pro CONFIG+=ccache CONFIG+=release CONFIG+=force_debug_info \ - CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \ - CONFIG+=exclude_generator \ - PYTHON_VERSION=$(python3 --version | cut -d " " -f 2 | cut -d "." -f1,2) \ - PYTHON_DIR=$(which python3 | xargs dirname | xargs dirname) - make -j $(nproc) - PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \ - UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \ - make check TESTARGS="-platform offscreen" - - - name: Run memory tests with sanitizers - run: | - QT_VERSION_FULL=$(qmake -query QT_VERSION) - if [[ "$QT_VERSION_FULL" == 5.12* ]]; then - echo "leak:QPlatformIntegrationFactory::create" >> $PWD/lsan.supp - export LSAN_OPTIONS="suppressions=$PWD/lsan.supp" - fi - PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \ - UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=1:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \ - PYTHONQT_RUN_ONLY_MEMORY_TESTS=1 \ - make check TESTARGS="-platform minimal" - - - name: Run cleanup tests with sanitizers - run: | - # CPython 3.12 only: suppress its known interned-unicode leak that - # shows up as allocations via PyUnicode_New (python/cpython#113190). - # Fixed in 3.13 (python/cpython#113601), so we scope this to 3.12. - PYVER=$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))') - if [[ "$PYVER" == "3.12" ]]; then - echo "leak:PyUnicode_New" >> $PWD/lsan.supp - export LSAN_OPTIONS="suppressions=$PWD/lsan.supp" - fi - PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \ - UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=1:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \ - PYTHONQT_RUN_ONLY_CLEANUP_TESTS=1 \ - PYTHONQT_DISABLE_ASYNCIO=1 \ - make check TESTARGS="-platform minimal" - - - name: Upload Wrappers - uses: actions/upload-artifact@v7 - with: - name: wrappers_ubuntu_${{ matrix.container_version }} - path: generated_cpp - if-no-files-found: error - - oldschool: - strategy: - fail-fast: false - matrix: - container_os: ['rockylinux'] - container_os_version: ['9'] - configuration: ['debug', 'release'] - runs-on: ubuntu-latest - container: '${{ matrix.container_os }}:${{ matrix.container_os_version }}' - steps: - - name: Install Qt - run: | - yum update -y - yum groupinstall "Development Tools" -y - yum install -y \ - which \ - python-devel \ - qt5-qtbase-* \ - qt5-qttools* \ - qt5-qtsvg \ - qt5-qtxmlpatterns \ - qt5-qtmultimedia \ - qt5-qt3d \ - qt5-*-devel - - - name: Checkout PythonQt - uses: actions/checkout@v6 - - - name: Build PythonQt (generator_only) - run: | - export QT_SELECT=qt5 - echo ======= SYSTEM INFO ======== - uname -a; gcc --version | grep "gcc"; qmake-qt5 --version - echo ============================ - qmake-qt5 -r PythonQt.pro CONFIG+=${{ matrix.configuration }} \ - CONFIG+=generator_only - make -j $(nproc) - - - name: Generate Wrappers - run: | - export QTDIR=/usr/include/qt5 - # Specify "/usr/include" so that header "bits/wordsize.h" included from "qconfig.h" is found. - # See https://git.rockylinux.org/staging/rpms/qt5-qtbase/-/blob/r8/SOURCES/qconfig-multilib.h - ./generator/pythonqt_generator \ - --include-paths=/usr/include \ - --output-directory=. - - - name: Build PythonQt (exclude_generator) - run: | - export QT_SELECT=qt5 - echo ======= SYSTEM INFO ======== - which python 2>/dev/null && export PYTHON_VERSION_SUFFIX= || export PYTHON_VERSION_SUFFIX=3 - uname -a; gcc --version | grep "gcc"; python${PYTHON_VERSION_SUFFIX} --version; qmake-qt5 --version - echo ============================ - export PYTHON_VERSION_SHORT=`python${PYTHON_VERSION_SUFFIX} --version | cut -d " " -f 2 | cut -d "." -f1,2` - if [[ `echo ${PYTHON_VERSION_SHORT} | wc -w` = 0 ]]; then export PYTHON_VERSION_SHORT=2.7; fi - export PYTHON_DIR=`which python${PYTHON_VERSION_SUFFIX} | xargs dirname | xargs dirname` - echo PYTHON_VERSION_SHORT=${PYTHON_VERSION_SHORT} - echo PYTHON_DIR=${PYTHON_DIR} - qmake-qt5 -r PythonQt.pro CONFIG+=${{ matrix.configuration }} \ - CONFIG+=exclude_generator \ - "PYTHON_VERSION=${PYTHON_VERSION_SHORT}" "PYTHON_DIR=${PYTHON_DIR}" - make -j $(nproc) && \ - PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \ - make check TESTARGS="-platform offscreen" - - - name: Upload Wrappers - uses: actions/upload-artifact@v7 - with: - name: wrappers_${{ matrix.container_os }}-${{ matrix.container_os_version }}_${{ matrix.configuration }} - path: generated_cpp - if-no-files-found: error - - macOS: - strategy: - fail-fast: false - matrix: - macos-version: ['latest'] - python-version: ['3.9'] - qt-version: ['5.9.*'] - configuration: ['release','debug'] - include: - - macos-version: 'latest' - python-version: '3.11' - qt-version: '5.12.*' - configuration: 'debug' - runs-on: macos-${{ matrix.macos-version }} - steps: - - name: Install Qt - uses: jurplel/install-qt-action@v4 - with: - version: ${{ matrix.qt-version }} - host: 'mac' - target: 'desktop' - arch: 'clang_64' - modules: 'qtscript' - archives: 'qtmultimedia qtmacextras qtbase qttools' - - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: '${{ matrix.python-version }}' - - - name: Checkout PythonQt - uses: actions/checkout@v6 - - - name: Ccache - uses: hendrikmuhs/ccache-action@v1.2.22 - with: - key: ${{ runner.os }}-${{ matrix.qt-version }} - evict-old-files: 'job' - - - name: Detect exact versions - id : versions - run : | - set -eu - PYTHON_VERSION_FULL=$(python --version 2>&1 | cut -f 2 -d ' ') - PYTHON_VERSION_SHORT=$(cut -f 1,2 -d . <<< $PYTHON_VERSION_FULL) - QT_VERSION_FULL=$($QT_ROOT_DIR/bin/qmake -query QT_VERSION) - QT_VERSION_SHORT=$(cut -f 1,2 -d . <<< $QT_VERSION_FULL) - MACOS_VERSION_FULL=$(sw_vers -productVersion) - MACOS_VERSION_SHORT=$(cut -f 1,2 -d . <<< $MACOS_VERSION_FULL) - - echo "PYTHON_VERSION_FULL=$PYTHON_VERSION_FULL" | tee -a $GITHUB_OUTPUT - echo "PYTHON_VERSION_SHORT=$PYTHON_VERSION_SHORT" | tee -a $GITHUB_OUTPUT - echo "QT_VERSION_FULL=$QT_VERSION_FULL" | tee -a $GITHUB_OUTPUT - echo "QT_VERSION_SHORT=$QT_VERSION_SHORT" | tee -a $GITHUB_OUTPUT - echo "MACOS_VERSION_FULL=$MACOS_VERSION_FULL" | tee -a $GITHUB_OUTPUT - echo "MACOS_VERSION_SHORT=$MACOS_VERSION_SHORT" | tee -a $GITHUB_OUTPUT - - - name: Build PythonQt (generator_only) - run: | - set -ue - echo ======= SYSTEM INFO ======== - uname -a; gcc --version | head -n 1; qmake --version - echo ============================ - qmake CONFIG+=ccache CONFIG+=${{ matrix.configuration }} CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \ - CONFIG+=generator_only \ - -r PythonQt.pro - make -j $(nproc) - - - name: Generate Wrappers - run: | - UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \ - ./generator/pythonqt_generator \ - --output-directory=. - - - name: Build PythonQt (exclude_generator) - run: | - set -ue - echo ======= SYSTEM INFO ======== - uname -a; gcc --version | head -n 1; python --version; qmake --version - echo ============================ - PYTHON_VERSION_MAJOR=$(cut -d . -f1 <<< ${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}) - for i in "python${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}-embed" "python${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}" \ - "python${PYTHON_VERSION_MAJOR}-embed" "python${PYTHON_VERSION_MAJOR}" - do if pkg-config --exists "$i"; then PYTHON_PKGCONFIG_NAME="$i"; break; fi; done - qmake CONFIG+=ccache CONFIG+=${{ matrix.configuration }} CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \ - CONFIG+=exclude_generator \ - PYTHON_VERSION=${{ steps.versions.outputs.PYTHON_VERSION_SHORT }} \ - PYTHON_DIR="$pythonLocation" \ - PKGCONFIG+=$PYTHON_PKGCONFIG_NAME \ - -r PythonQt.pro - make -j $(nproc) - PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \ - UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \ - make check TESTARGS="-platform offscreen" - - - name: Upload Wrappers - if: ${{ contains(matrix.configuration, 'release') }} - uses: actions/upload-artifact@v7 - with: - name: wrappers_macos${{ steps.versions.outputs.MACOS_VERSION_SHORT }}_qt${{ steps.versions.outputs.QT_VERSION_SHORT }} - path: generated_cpp - if-no-files-found: error - - windows: - strategy: - fail-fast: false - matrix: - qt-arch: ['win64_mingw73'] - python-version: ['3.10'] - qt-version: ['5.12.*'] - python-arch: ['x64'] - pythonqtall-config: [''] -# msvc-toolset: ['14.0'] - include: - - qt-arch: 'win64_msvc2017_64' - python-version: '3.6' - python-arch: 'x64' - qt-version: '5.11.*' -# msvc-toolset: '14.16' - - - qt-arch: 'win64_msvc2019_64' - python-version: '3.13' - python-arch: 'x64' - qt-version: '5.15.*' - pythonqtall-config: 'PythonQtCore PythonQtGui PythonQtMultimedia' - - - qt-arch: 'win32_mingw53' - python-version: '3.6' - python-arch: 'x86' - qt-version: '5.11.*' - -#Either MSVC2015 is sick or Qt5.9 is buggy :( -#Main problem is QBasicMutex with default ctor, that (by no means) is missing in dll-export of QtCore, but linker tries to find it -# - qt-arch: 'win32_msvc2015' -# python-version: '2.7' -# python-arch: 'x86' -# qt-version: '5.9.*' -# pythonqtall-config: 'PythonQtCore PythonQtGui PythonQtMultimedia' - - runs-on: windows-latest - steps: - - - name: Checkout PythonQt - uses: actions/checkout@v6 - - - name: Reset PATH - uses: egor-tensin/cleanup-path@v5 - - - name: Install MSVC++ - uses: ilammy/msvc-dev-cmd@v1 - if: ${{ contains(matrix.qt-arch, 'msvc') }} - with: - arch: amd64${{ contains(matrix.python-arch, 'x86') && '_x86' || '' }} - - - name: Install Qt - uses: jurplel/install-qt-action@v4 - with: - version: ${{ matrix.qt-version }} - host: 'windows' - target: 'desktop' - arch: ${{ matrix.qt-arch }} - modules: 'qtscript' - archives: 'qtwinextras qtmultimedia qtbase' - tools: ${{ contains(matrix.qt-arch, 'mingw') && format('tools_mingw,qt.tools.{0}0', matrix.qt-arch) || '' }} - - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: '${{ matrix.python-version }}' - architecture: ${{ matrix.python-arch }} - - - name: Detect exact versions - shell: bash - id: versions - run: | - set -eu - QT_VERSION_FULL=$("$QT_ROOT_DIR/bin/qmake" -query QT_VERSION) - QT_VERSION_SHORT=$(cut -f 1,2 -d . <<< $QT_VERSION_FULL) - PYTHON_VERSION_FULL=$(python --version 2>&1 | cut -f 2 -d ' ') - PYTHON_VERSION_SHORT=$(cut -f 1,2 -d . <<< $PYTHON_VERSION_FULL) - echo "QT_VERSION_FULL=$QT_VERSION_FULL" | tee -a $GITHUB_OUTPUT - echo "QT_VERSION_SHORT=$QT_VERSION_SHORT" | tee -a $GITHUB_OUTPUT - echo "PYTHON_VERSION_SHORT=$PYTHON_VERSION_SHORT" | tee -a $GITHUB_OUTPUT - - - name: Build PythonQt (generator_only) - shell: cmd - run: | - qmake -query - qmake CONFIG+=release CONFIG-=debug_and_release CONFIG-=debug_and_release_target ^ - CONFIG+=generator_only ^ - PythonQt.pro - mingw32-make -j 2 ^ - || set CL=/MP && nmake - - - name: Generate Wrappers - shell: cmd - run: | - set QTDIR=%QT_ROOT_DIR% - generator\pythonqt_generator ^ - --output-directory=. - - - name: Build PythonQt (exclude_generator) - shell: cmd - run: | - qmake -query - python --version - set PYTHONQTALL_CONFIG=${{ matrix.pythonqtall-config }} - qmake CONFIG+=release CONFIG-=debug_and_release CONFIG-=debug_and_release_target ^ - CONFIG+=exclude_generator ^ - "PYTHON_PATH=%pythonLocation%" ^ - "PYTHON_VERSION=${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}" ^ - PythonQt.pro - set PYTHONDEVMODE=1 - set PYTHONASYNCIODEBUG=1 - set PYTHONWARNINGS=error - mingw32-make -j 2 && mingw32-make check "TESTARGS=-platform offscreen" ^ - || set CL=/MP && nmake && nmake check "TESTARGS=-platform offscreen" - - - name: Upload Wrappers - if: (matrix.pythonqtall-config || '') == '' - uses: actions/upload-artifact@v7 - with: - name: wrappers_${{ matrix.qt-arch }}_${{ steps.versions.outputs.QT_VERSION_SHORT }} - path: generated_cpp - if-no-files-found: error diff --git a/.github/workflows/build_latest.yml b/.github/workflows/build_latest.yml deleted file mode 100644 index 864f11c31..000000000 --- a/.github/workflows/build_latest.yml +++ /dev/null @@ -1,132 +0,0 @@ -name: Check generated_cpp - -on: - push: - branches: - - main - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -defaults: - run: - shell: bash - -jobs: - build: - strategy: - fail-fast: false - matrix: - os: ['ubuntu', 'windows'] - qt-version: [ '5.12.*', '5.15.*', '6.10.*' ] - python-version: [ '3.12' ] - runs-on: ${{ matrix.os }}-latest - steps: - - - name: Install MSVC - if: ${{ matrix.os == 'windows' }} - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: amd64 - - - name: Install Qt ${{matrix.qt-version}} - uses: jurplel/install-qt-action@v4 - with: - version: ${{ matrix.qt-version }} - modules: ${{startsWith(matrix.qt-version, '6') && 'qt5compat qtscxml qtpositioning qtwebchannel qtmultimedia qtwebengine' || '' }} - arch: ${{ (matrix.os == 'ubuntu' && (startsWith(matrix.qt-version, '5') && 'gcc_64' || 'linux_gcc_64')) || startsWith(matrix.qt-version, '5.12') && 'win64_msvc2017_64' || startsWith(matrix.qt-version, '6') && 'win64_msvc2022_64' || 'win64_msvc2019_64' }} - - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: '${{ matrix.python-version }}' - - - name: Checkout PythonQt - uses: actions/checkout@v6 - - - name: Ccache - uses: hendrikmuhs/ccache-action@v1.2.22 - with: - key: ${{ runner.os }}-${{ matrix.qt-version }} - evict-old-files: 'job' - if: ${{ matrix.os == 'ubuntu' }} - - - name: Set environment - id: setenv - run: | - QT_VERSION_MAJOR=$(cut -f 1 -d . <<< "${{matrix.qt-version}}") - echo "QT_VERSION_MAJOR=$QT_VERSION_MAJOR" >> $GITHUB_ENV - QT_VERSION_SHORT=$(cut -f 1,2 -d . <<< "${{matrix.qt-version}}") - echo "QT_VERSION_SHORT=$QT_VERSION_SHORT" >> $GITHUB_OUTPUT - PYTHON_VERSION_FULL=$(python --version 2>&1 | cut -f 2 -d ' ') - PYTHON_VERSION_SHORT=$(cut -f 1,2 -d . <<< $PYTHON_VERSION_FULL) - echo "PYTHON_VERSION_SHORT=$PYTHON_VERSION_SHORT" >> $GITHUB_OUTPUT - echo "$pythonLocation/bin" >> $GITHUB_PATH - - - name: Build generator Ubuntu - shell: bash - if: ${{ matrix.os == 'ubuntu' }} - run: | - cd generator - qmake -r generator.pro CONFIG+=ccache CONFIG+=release CONFIG-=debug_and_release CONFIG+=force_debug_info \ - CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address - make -j $(nproc) - - - name: Build generator Windows - shell: cmd - if: ${{ matrix.os == 'windows' }} - run: | - cd generator - qmake CONFIG+=release CONFIG-=debug_and_release CONFIG-=debug_and_release_target generator.pro - nmake - - - name: Generate Wrappers - shell: bash - run: | - QTDIR="$QT_ROOT_DIR" \ - UBSAN_OPTIONS="halt_on_error=1" \ - ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \ - ./generator/pythonqt_generator \ - --output-directory=. - - - name: Upload Wrappers - uses: actions/upload-artifact@v7 - with: - name: wrappers_${{ matrix.os }}_${{ steps.setenv.outputs.QT_VERSION_SHORT }} - path: generated_cpp - if-no-files-found: error - - - name: Build PythonQt Ubuntu (exclude_generator) - if: ${{ matrix.os == 'ubuntu' }} - run: | - echo ======= SYSTEM INFO ======== - uname -a; gcc --version | grep "gcc"; python3 --version; qmake --version - echo ============================ - qmake -r PythonQt.pro CONFIG+=ccache CONFIG+=release CONFIG+=force_debug_info \ - CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \ - CONFIG+=exclude_generator \ - PYTHON_VERSION=$(python3 --version | cut -d " " -f 2 | cut -d "." -f1,2) \ - PYTHON_DIR=$(which python3 | xargs dirname | xargs dirname) - make -j $(nproc) - PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \ - UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \ - make check TESTARGS="-platform offscreen" - - - name: Build PythonQt Windows (exclude_generator) - shell: cmd - if: ${{ matrix.os == 'windows' }} - run: | - qmake -query - python --version - qmake CONFIG+=release CONFIG-=debug_and_release CONFIG-=debug_and_release_target ^ - CONFIG+=exclude_generator ^ - "PYTHONQTALL_CONFIG=${{ matrix.pythonqtall-config }}" ^ - "PYTHON_PATH=%pythonLocation%" ^ - "PYTHON_VERSION=${{ steps.setenv.outputs.PYTHON_VERSION_SHORT }}" ^ - PythonQt.pro - set PYTHONDEVMODE=1 - set PYTHONASYNCIODEBUG=1 - set PYTHONWARNINGS=error - nmake && nmake check "TESTARGS=-platform offscreen" diff --git a/.github/workflows/builddocs.yml b/.github/workflows/builddocs.yml deleted file mode 100644 index c7ae5c1cf..000000000 --- a/.github/workflows/builddocs.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Build and Deploy Documentation - -on: - push: - branches: - - main - -defaults: - run: - shell: bash - -jobs: - build_docs: - runs-on: ubuntu-latest - steps: - - name: Checkout main - uses: actions/checkout@v6 - - - name: Install Doxygen - run: sudo apt-get install doxygen graphviz -y - - - name: Build documentation - run: | - cd doxygen - doxygen - touch html/.nojekyll - cd .. - - - name: Deploy to GitHub Pages - uses: JamesIves/github-pages-deploy-action@v4 - with: - folder: doxygen/html diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 167bcc960..000000000 --- a/.gitignore +++ /dev/null @@ -1,116 +0,0 @@ -# Compiled Object files -*.slo -*.lo -*.o -*.obj -*.pdb -*.cbt - -# Precompiled Headers -*.gch -*.pch - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.exe -*.out -*.app - -# Qt -object_script.*.Release -object_script.*.Debug -*_plugin_import.cpp -/.qmake.cache -/.qmake.stash -*.pro.user -*.pro.user.* -*.qbs.user -*.qbs.user.* -*.moc -moc_*.cpp -moc_*.h -qrc_*.cpp -ui_*.h -*.qmlc -*.jsc -Makefile* -*build-* -*resource.rc -*.FileListAbsolute.txt - -# CMake -CMakeLists.txt.user -CMakeLists.txt.user* -CMakeCache.txt -CMakeFiles -CMakeScripts -Testing -Makefile -cmake_install.cmake -install_manifest.txt -compile_commands.json -CTestTestfile.cmake -_deps - -# QtCreator -*.autosave -*.qmlproject.user -*.qmlproject.user.* -compile_commands.json -*creator.user* - -# macOS/Windows -.DS_Store -Thumbs.db -*.lnk - -# patch/diff -*.orig -*.rej -*.patch -*.diff - -# vim -*~ - -# Visual Studio Code -.vscode/* - -*.tlog - - -# JetBrains tools -.idea/* - -# Doxygen -doxygen/html/* -doxygen.log - -# Backup files -*.bak -generated_cpp -generator/.vs -*.log -*.sln -*.vcxproj -*.filters -*.user -*.stash -*.tmp -generate.bat -generator/release - -/.vs/ -*/.vs -*/debug/* -*/release/* diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 39f8b5e42..000000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,14 +0,0 @@ -repos: - - repo: https://github.com/pre-commit/mirrors-clang-format - rev: "v22.1.3" - hooks: - - id: clang-format - - - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v6.0.0 - hooks: - - id: check-case-conflict - - id: check-merge-conflict - - id: trailing-whitespace - - id: mixed-line-ending diff --git a/.vimrc b/.vimrc deleted file mode 100644 index d5a9f893c..000000000 --- a/.vimrc +++ /dev/null @@ -1 +0,0 @@ -set expandtab diff --git a/Building.html b/Building.html new file mode 100644 index 000000000..f48a3124c --- /dev/null +++ b/Building.html @@ -0,0 +1,89 @@ + + + + + + + +PythonQt: Building + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
Building
+
+
+

PythonQt requires at least Qt 5.0 and Python 2.7.x or Python 3.6 (or higher). To compile PythonQt, you will need a python developer installation which includes Python's header files and the python2x.[lib | dll | so | dynlib]. The recommended way to build PythonQt is to use the QMake-based *.pro file. The build scripts are currently set to use Python 3.10 by default. You may need to tweak the build/python.prf file to set the correct Python includes and libs on your system.

+

+Windows

+

On Windows, the (non-source) Python Windows installer can be used. Make sure that you use the same compiler as the one that your Python distribution is built with. If you want to use another compiler, you will need to build Python yourself, using your compiler.

+

To build PythonQt, you need to set the environment variable PYTHON_PATH to point to the root dir of the python installation and PYTHON_VERSION should state the used Python version.

+

When using the prebuild Python installer, this will be:

+
+ +
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+

When using the python sources, this will be something like:

+
+ +

To build all, do the following (after setting the above variables):

+

This should build everything. If Python can not be linked or include files can not be found, you probably need to tweak build/python.prf

+

The tests and examples are located in PythonQt/lib.

+

When using a Python distribution, the debug build typically does not work because the pythonxx_d.lib/.dll are not provided. You can tweak linking of the debug build to the release Python version, but this typically requires patching pyconfig.h and removing Py_DEBUG and linker pragmas (google for it!).

+

+Linux

+

On Linux, you need to install a Python-dev package. If Python can not be linked or include files can not be found, you probably need to tweak build/python.prf

+

To build PythonQt, just do a:

+

The tests and examples are located in PythonQt/lib. You should add PythonQt/lib to your LD_LIBRARY_PATH so that the runtime linker can find the *.so files.

+

+MacOS

+

On Mac, Python is installed as a Framework, so you should not need to install it. To build PythonQt, just do a:

+

+Tests

+

There is a unit test that tests most features of PythonQt, see the tests subdirectory for details.

+
+
+ + + + diff --git a/COPYING b/COPYING deleted file mode 100644 index 67870f655..000000000 --- a/COPYING +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/Developer.html b/Developer.html new file mode 100644 index 000000000..501eeee2e --- /dev/null +++ b/Developer.html @@ -0,0 +1,302 @@ + + + + + + + +PythonQt: Developer + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
Developer
+
+
+

+Interface

+

The main interface to PythonQt is the PythonQt singleton. PythonQt needs to be initialized via PythonQt::init() once. Afterwards you communicate with the singleton via PythonQt::self(). PythonQt offers a complete Qt binding, which needs to be enabled via PythonQt_QtAll::init().

+

+Datatype Mapping

+

The following table shows the mapping between Python and Qt objects:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Qt/C++Python
boolbool
doublefloat
floatfloat
char/uchar,int/uint,short,ushort,QCharinteger
longinteger
ulong,longlong,ulonglonglong
QString (1)unicode string
QByteArray (2)QByteArray wrapper (3)
char*str
QStringListtuple of unicode strings
QVariantListtuple of objects
QVariantMapdict of objects
QVariantdepends on type (4)
QSize, QRect and all other standard Qt QVariantsvariant wrapper that supports complete API of the respective Qt classes
OwnRegisteredMetaTypeC++ wrapper, optionally with additional information/wrapping provided by registerCPPClass()
QList<AnyObject*>converts to a list of CPP wrappers
QVector<AnyObject*>converts to a list of CPP wrappers
EnumTypeEnum wrapper derived from python integer
QObject (and derived classes)QObject wrapper
C++ objectCPP wrapper, either wrapped via PythonQtCppWrapperFactory or just decorated with decorators
PyObjectPyObject (5)
+
    +
  1. QStringRef (Qt5), QStringView and QAnyStringView (Qt6) are handled like QString.
  2. +
  3. QByteArrayView (Qt6) is handled like QByteArray.
  4. +
  5. The Python 'bytes' type will automatically be converted to QByteArray where required. For converting a QByteArray to 'bytes' use the .data() method.
  6. +
  7. QVariants are mapped recursively as given above, e.g. a dictionary can contain lists of dictionaries of doubles.
  8. +
  9. PyObject is passed as direct pointer, which allows to pass/return any Python object directly to/from a Qt slot that uses PyObject* as its argument/return value.
  10. +
+

All Qt QVariant types are implemented, PythonQt supports the complete Qt API for these objects.

+

+QObject Wrapping

+

All classes derived from QObject are automatically wrapped with a python wrapper class when they become visible to the Python interpreter. This can happen via

    +
  • the PythonQt::addObject() method
  • +
  • when a Qt slot returns a QObject derived object to python
  • +
  • when a Qt signal contains a QObject and is connected to a python function
  • +
+

It is important that you call PythonQt::registerClass() for any QObject derived class that may become visible to Python, except when you add it via PythonQt::addObject(). This will register the complete parent hierachy of the registered class, so that when you register e.g. a QPushButton, QWidget will be registered as well (and all intermediate parents).

+

From Python, you can talk to the returned QObjects in a natural way by calling their slots and receiving the return values. You can also read/write all properties of the objects as if they where normal python properties.

+

In addition to this, the wrapped objects support

    +
  • className() - returns a string that represents the classname of the QObject
  • +
  • help() - shows all properties, slots, enums, decorator slots and constructors of the object, in a printable form
  • +
  • delete() - deletes the object (use with care, especially if you passed the ownership to C++)
  • +
  • connect(signal, function) - connect the signal of the given object to a python function
  • +
  • connect(signal, qobject, slot) - connect the signal of the given object to a slot of another QObject
  • +
  • disconnect(signal, function) - disconnect the signal of the given object from a python function
  • +
  • disconnect(signal, qobject, slot) - disconnect the signal of the given object from a slot of another QObject
  • +
  • children() - returns the children of the object
  • +
  • setParent(QObject) - set the parent
  • +
  • QObject* parent() - get the parent
  • +
+

The below example shows how to connect signals in Python:

+
# define a signal handler function
+ + +
+ + +
button1.connect("clicked(bool)", someFunction)
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+

And this example shows how you can define your own signals and slots:

+
class MySender(QtCore.QObject):
+
+ +
+
class MyReceiver(QtCore.QObject):
+
+
@QtCore.Slot(float)
+
def progress(self, value):
+
print(f"progress: {value}")
+
+ + + +
sender.connect("emitProgress(double)", receiver, "progress(double)")
+ +

+CPP Wrapping

+

You can create dedicated wrapper QObjects for any C++ class. This is done by deriving from PythonQtCppWrapperFactory and adding your factory via addWrapperFactory(). Whenever PythonQt encounters a CPP pointer (e.g. on a slot or signal) and it does not known it as a QObject derived class, it will create a generic CPP wrapper. So even unknown C++ objects can be passed through Python. If the wrapper factory supports the CPP class, a QObject wrapper will be created for each instance that enters Python. An alternative to a complete wrapper via the wrapper factory are decorators, see Decorator slots

+

+Meta Object/Class access

+

For each known C++ class, PythonQt provides a Python class. These classes are visible inside of the "PythonQt" python module or in subpackages if a package is given when the class is registered.

+

A Meta class supports:

+
    +
  • access to all declared enum values
  • +
  • constructors
  • +
  • static methods
  • +
  • unbound non-static methods
  • +
  • help() and className()
  • +
+

From within Python, you can import the module "PythonQt" to access these classes and the Qt namespace.

+
from PythonQt import QtCore
+
+
# namespace access:
+
print QtCore.Qt.AlignLeft
+
+
# constructors
+
a = QtCore.QSize(12,13)
+
b = QtCore.QFont()
+
+
# static method
+
QtCore.QDate.currentDate()
+
+
# enum value
+
QtCore.QFont.UltraCondensed
+
# or, alternatively
+
QtCore.QFont.Stretch.UltraCondensed
+
The main interface to the Python Qt binding, realized as a singleton.
Definition PythonQt.h:179
+

+Decorator slots

+

PythonQt introduces a new generic approach to extend any wrapped QObject or CPP object with

+
    +
  • constructors
  • +
  • destructors (for CPP objects)
  • +
  • additional slots
  • +
  • static slots (callable on both the Meta object and the instances)
  • +
+

The idea behind decorators is that we wanted to make it as easy as possible to extend wrapped objects. Since we already have an implementation for invoking any Qt Slot from Python, it looked promising to use this approach for the extension of wrapped objects as well. This avoids that the PythonQt user needs to care about how Python arguments are mapped from/to Qt when he wants to create static methods, constructors and additional member functions.

+

The basic idea about decorators is to create a QObject derived class that implements slots which take one of the above roles (e.g. constructor, destructor etc.) via a naming convention. These slots are then assigned to other classes via the naming convention.

+
    +
  • SomeClassName* new_SomeClassName(...) - defines a constructor for "SomeClassName" that returns a new object of type SomeClassName (where SomeClassName can be any CPP class, not just QObject classes)
  • +
  • void delete_SomeClassName(SomeClassName* o) - defines a destructor, which should delete the passed in object o
  • +
  • anything static_SomeClassName_someMethodName(...) - defines a static method that is callable on instances and the meta class
  • +
  • anything someMethodName(SomeClassName* o, ...) - defines a slot that will be available on SomeClassName instances (and derived instances). When such a slot is called the first argument is the pointer to the instance and the rest of the arguments can be used to make a call on the instance.
  • +
+

The below example shows all kinds of decorators in action:

+
// an example CPP object
+ +
public:
+
YourCPPObject(int arg1, float arg2) { a = arg1; b = arg2; }
+
+
float doSomething(int arg1) { return arg1*a*b; };
+
+
private:
+
+
int a;
+
float b;
+
};
+
+
// an example decorator
+
class ExampleDecorator : public QObject
+
{
+ +
+
public slots:
+
// add a constructor to QSize that takes a QPoint
+
QSize* new_QSize(const QPoint& p) { return new QSize(p.x(), p.y()); }
+
+
// add a constructor for QPushButton that takes a text and a parent widget
+
QPushButton* new_QPushButton(const QString& text, QWidget* parent=NULL) { return new QPushButton(text, parent); }
+
+
// add a constructor for a CPP object
+ +
+
// add a destructor for a CPP object
+ +
+
// add a static method to QWidget
+
QWidget* static_QWidget_mouseGrabber() { return QWidget::mouseGrabber(); }
+
+
// add an additional slot to QWidget (make move() callable, which is not declared as a slot in QWidget)
+
void move(QWidget* w, const QPoint& p) { w->move(p); }
+
+
// add an additional slot to QWidget, overloading the above move method
+
void move(QWidget* w, int x, int y) { w->move(x,y); }
+
+
// add a method to your own CPP object
+
int doSomething(YourCPPObject* obj, int arg1) { return obj->doSomething(arg1); }
+
};
+
+
...
+
+
PythonQt::self()->addDecorators(new ExampleDecorator());
+
PythonQt::self()->registerCPPClass("YourCPPObject");
+
void registerCPPClass(const char *typeName, const char *parentTypeName=nullptr, const char *package=nullptr, PythonQtQObjectCreatorFunctionCB *wrapperCreator=nullptr, PythonQtShellSetInstanceWrapperCB *shell=nullptr)
+
static PythonQt * self()
get the singleton instance
+

After you have registered an instance of the above ExampleDecorator, you can do the following from Python (all these calls are mapped to the above decorator slots):

+
from PythonQt import QtCore, QtGui, YourCPPObject
+
+
# call our new constructor of QSize
+
size = QtCore.QSize(QPoint(1,2));
+
+
# call our new QPushButton constructor
+
button = QtGui.QPushButton("sometext");
+
+
# call the move slot (overload1)
+
button.move(QPoint(0,0))
+
+
# call the move slot (overload2)
+
button.move(0,0)
+
+
# call the static method
+
grabber = QtGui.QWidget.mouseWrapper();
+
+
# create a CPP object via constructor
+ +
+
# call the wrapped method on CPP object
+
print yourCpp.doSomething(1);
+
+
# destructor will be called:
+ +

+Ownership management

+

In PythonQt, each wrapped C++ object is either owned by Python or C++. When an object is created via a Python constructor, it is owned by Python by default. When an object is returned from a C++ API (e.g. a slot), it is owned by C++ by default. Since the Qt API contains various APIs that pass the ownership from/to other C++ objects, PythonQt needs to keep track of such API calls. This is archieved by annotating arguments and return values in wrapper slots with magic templates:

+ +

These annotation templates work for since C++ pointer types. In addition to that, they work for QList<AnyObject*>, to pass the ownership for each object in the list.

+

Examples:

+
+ + + + diff --git a/Download.html b/Download.html new file mode 100644 index 000000000..35e269826 --- /dev/null +++ b/Download.html @@ -0,0 +1,55 @@ + + + + + + + +PythonQt: Download + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
Download
+
+
+

PythonQt is hosted on GitHub.

+

You can download the source code or alternatively you can get the latest version from the git repository.

+
Note
We do not offer prebuilt binaries, since there are so many possible combinations of platforms (Windows/Linux/MacOs), architectures (32/64 bit) and Qt / Python versions.
+
+
+ + + + diff --git a/Examples.html b/Examples.html new file mode 100644 index 000000000..7f4562837 --- /dev/null +++ b/Examples.html @@ -0,0 +1,87 @@ + + + + + + + +PythonQt: Examples + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
Examples
+
+
+

Examples are available in the examples directory. The PyScriptingConsole implements a simple interactive scripting console that shows how to script a simple application. The PyLauncher application can be used to run arbitrary PythonQt scripts given on the commandline.

+

The following shows a simple example on how to integrate PythonQt into your Qt application:

+
#include "PythonQt.h"
+
#include <QApplication>
+
...
+
+
int main(int argc, char *argv[])
+
{
+
+ +
+
// init PythonQt and Python itself
+ +
+
// get a smart pointer to the __main__ module of the Python interpreter
+ +
+
// add a QObject as variable of name "example" to the namespace of the __main__ module
+ +
context.addObject("example", &example);
+
+
// do something
+
context.evalScript("print example");
+
context.evalScript("def multiply(a,b):\n return a*b;\n");
+ +
args << 42 << 47;
+
QVariant result = context.call("multiply", args);
+
...
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+ +
a smart pointer that stores a PyObject pointer and that handles reference counting automatically
+
void addObject(const QString &name, QObject *object)
add the given object to the module as a variable with name (it can be removed via clearVariable)
+
static void init(int flags=IgnoreSiteModule|RedirectStdOut, const QByteArray &pythonQtModuleName=QByteArray())
+
PythonQtObjectPtr getMainModule()
get the main module of python
+
static PythonQt * self()
get the singleton instance
+
+
+ + + + diff --git a/Features.html b/Features.html new file mode 100644 index 000000000..9dc1d36fe --- /dev/null +++ b/Features.html @@ -0,0 +1,123 @@ + + + + + + + +PythonQt: Features + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
Features
+
+
+

+Built-in Features

+

The following are the built-in features of the PythonQt library:

+
    +
  • Access all slots, properties, children and registered enums of any QObject derived class from Python
  • +
  • Connecting Qt Signals to Python functions (both from within Python and from C++)
  • +
  • Easy wrapping of Python objects from C++ with smart, reference-counting PythonQtObjectPtr.
  • +
  • Convenient conversions to/from QVariant for PythonQtObjectPtr.
  • +
  • Wrapping of C++ objects (which are not derived from QObject) via PythonQtCppWrapperFactory
  • +
  • Extending C++ and QObject derived classes with additional slots, static methods and constructors (see Decorators)
  • +
  • StdOut/Err redirection to Qt signals instead of cout
  • +
  • Interface for creating your own import replacement, so that Python scripts can be e.g. signed/verified before they are executed (PythonQtImportFileInterface)
  • +
  • Mapping of plain-old-datatypes and ALL QVariant types to and from Python
  • +
  • Support for wrapping of user QVariant types which are registerd via QMetaType
  • +
  • Support for Qt namespace (with all enumerators)
  • +
  • All PythonQt wrapped objects support the dir() statement, so that you can see easily which attributes a QObject, CPP object or QVariant has
  • +
  • No preprocessing/wrapping tool needs to be started, PythonQt can script any QObject without prior knowledge about it (except for the MetaObject information from the moc)
  • +
  • Multiple inheritance for C++ objects (e.g. if a QWidget is derived from QObject and QPaintDevice, PythonQt will automatically cast a QWidget to a QPaintDevice when needed)
  • +
  • Polymorphic downcasting (if e.g. PythonQt sees a QEvent, it can downcast it depending on the type(), so the Python code e.g. sees a QPaintEvent instead of a plain QEvent)
  • +
  • Deriving C++ objects from Python and overwriting virtual method with a Python implementation (requires usage of wrapper generator or manual work!)
  • +
  • Extensible handler for Python/C++ conversion of complex types, e.g. mapping of QVector<SomeObject> to/from a Python array
  • +
  • Setting of dynamic QObject properties via setProperty(), dynamic properties can be accessed for reading and writing like normal Python attributes (but creating a new property needs to be done with setProperty(), to distinguish from normal Python attributes)
  • +
  • Support for QtCore.Signal, QtCore.Slot and QtCore.Property, including the creation of a dynamic QMetaObject.
  • +
+

+Features with wrapper generator

+

PythonQt offers the additional PythonQt_QtAll library which wraps the complete Qt API, including all C++ classes and all non-slots on QObject derived classes. This offers the following features:

+
    +
  • Complete Qt API wrapped and accessible
  • +
  • The following modules are available as submodules of the PythonQt module:
      +
    • QtCore
    • +
    • QtGui
    • +
    • QtNetwork
    • +
    • QtOpenGL (before Qt6)
    • +
    • QtSql
    • +
    • QtSvg
    • +
    • QtWebEngineWidgets
    • +
    • QtWebKit (when available)
    • +
    • QtXml
    • +
    • QtXmlPatterns (before Qt6)
    • +
    • QtMultimedia
    • +
    • QtQml
    • +
    • QtQuick
    • +
    +
  • +
  • Any Qt class that has virtual methods can be easily derived from Python and the virtual methods can be reimplemented in Python
  • +
  • Polymorphic downcasting on QEvent, QGraphicsItem, QStyleOption, ...
  • +
  • Multiple inheritance support (e.g., QGraphicsTextItem is a QObject and a QGraphicsItem, PythonQt will handle this well)
  • +
  • QtQuick support is experimental and currently it is not possible to register new qml components from Python
  • +
+

+Supported Versions

+

PythonQt supports:

    +
  • Python 2 (>= Python 2.7)
  • +
  • Python 3 (>= Python 3.6)
  • +
  • Qt 4.x (Qt 4.7 and Qt 4.8 recommended) (not in the main branch, see below)
  • +
  • Qt 5.x (Tested with Qt 5.6, 5.11, 5.12 and 5.15)
  • +
  • Qt 6.x (Tested with Qt 6.5 - 6.7) - support may not be complete, support for optional modules may be added as needed
  • +
+

The last working Qt4 version is available at svn branches/Qt4LastWorkingVersion or you can download the PythonQt 3.0 release. The current git main branch no longer supports Qt4, since we started to make use of some Qt5-only features.

+

+Comparison with PySide

+
    +
  • PythonQt is not as pythonic as PySide in many details (e.g. buffer protocol, pickling, translation support, ...) and it is mainly thought for embedding and intercommunication between Qt/Cpp and Python
  • +
  • PythonQt offers properties as Python attributes, while PySide offers them as setter/getter methods (e.g. QWidget.width is a property in PythonQt and a method in PySide, though in PySide6 in can also be made a property)
  • +
  • PythonQt currently does not support instanceof checks for Qt classes, except for the exact match and derived Python classes
  • +
  • QObject.emit to emit Qt signals from Python is not yet implemented but PythonQt allows to just emit a signal by calling it like a normal slot
  • +
  • Ownership handling of objects is not as complete as in PySide and PySide, especially in situations where the ownership is not clearly passed to C++ on the C++ API.
  • +
  • QStrings are always converted to unicode Python objects, QByteArray always stays a QByteArray and can be converted using QByteArray.data()
  • +
  • Qt methods that take an extra "bool* ok" parameter can be called passing PythonQt.BoolResult as parameter. In PySide, a tuple is returned instead.
  • +
+
+
+ + + + diff --git a/License.html b/License.html new file mode 100644 index 000000000..7648dd7f4 --- /dev/null +++ b/License.html @@ -0,0 +1,57 @@ + + + + + + + +PythonQt: License + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
License
+
+
+

PythonQt is distributed under the LGPL 2.1 license. It can be used in commercial applications when following the LGPL 2.1 obligations.

+

The build system of PythonQt makes use of a modified version of the LGPL'ed QtScript generator, located in the "generator" directory.

+

See https://code.qt.io/cgit/qt-labs/qtscriptgenerator.git for details on the original project. Thanks a lot to the QtJambi guys and the QtScript Generator project for the C++ parser and Qt typesystem files!

+

The PythonQt wrappers generated by the generator located in the "generated_cpp" directory are free to be used without any licensing restrictions.

+

The generated wrappers are pre-generated and checked-in for 5.0, 5.3, 5.4, 5.6 and 5.11, so you only need to build and run the generator when you want to build additional wrappers or you want to upgrade/downgrade to another Qt version. You may use the generator to generate C++ bindings for your own C++ classes (e.g., to make them inheritable in Python), but this is currently not documented and involves creating your own typesystem files.

+
+
+ + + + diff --git a/doxygen/PythonQt.jpg b/PythonQt.jpg similarity index 100% rename from doxygen/PythonQt.jpg rename to PythonQt.jpg diff --git a/PythonQt.pro b/PythonQt.pro deleted file mode 100644 index f78093f64..000000000 --- a/PythonQt.pro +++ /dev/null @@ -1,24 +0,0 @@ -TEMPLATE = subdirs - -# Define the full set of subdirectories, including the generator. -# This list is used as the default build target. -ALL_SUBDIRS = generator src extensions tests examples - -tests.depends += src extensions -extensions.depends += src -examples.depends += src extensions - -# The 'generator_only' config can be used to override the default. -CONFIG(generator_only) { - # If the generator_only config is set, override the SUBDIRS list - # to only include the generator. - SUBDIRS = generator -} else: CONFIG(exclude_generator) { - # If the 'generator_only' option is not present, but 'exclude_generator' is, - # then remove the generator from the default list. - SUBDIRS = $$ALL_SUBDIRS - SUBDIRS -= generator -} else { - # If neither special option is set, use the default build which includes everything. - SUBDIRS = $$ALL_SUBDIRS -} \ No newline at end of file diff --git a/PythonQtBoolResult_8h.html b/PythonQtBoolResult_8h.html new file mode 100644 index 000000000..139ad91ba --- /dev/null +++ b/PythonQtBoolResult_8h.html @@ -0,0 +1,125 @@ + + + + + + + +PythonQt: PythonQtBoolResult.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtBoolResult.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "PythonQtSystem.h"
+#include "structmember.h"
+
+

Go to the source code of this file.

+ + + + + +

+Classes

struct  PythonQtBoolResultObject
 defines a python object that stores a single bool More...
 
+ + + +

+Macros

#define PythonQtBoolResult_Check(op)   (Py_TYPE(op) == &PythonQtBoolResult_Type)
 
+ + + +

+Variables

PYTHONQT_EXPORT PyTypeObject PythonQtBoolResult_Type
 
+

Macro Definition Documentation

+ +

◆ PythonQtBoolResult_Check

+ +
+
+ + + + + + + + +
#define PythonQtBoolResult_Check( op)   (Py_TYPE(op) == &PythonQtBoolResult_Type)
+
+ +

Definition at line 51 of file PythonQtBoolResult.h.

+ +
+
+

Variable Documentation

+ +

◆ PythonQtBoolResult_Type

+ +
+
+ + + + + +
+ + + + +
PYTHONQT_EXPORT PyTypeObject PythonQtBoolResult_Type
+
+extern
+
+ +
+
+
+ + + + diff --git a/PythonQtBoolResult_8h_source.html b/PythonQtBoolResult_8h_source.html new file mode 100644 index 000000000..aa8ac778b --- /dev/null +++ b/PythonQtBoolResult_8h_source.html @@ -0,0 +1,121 @@ + + + + + + + +PythonQt: PythonQtBoolResult.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtBoolResult.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTBOOLRESULT_H
+
2#define _PYTHONQTBOOLRESULT_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
42//----------------------------------------------------------------------------------
+
43
+ +
45
+
46#include "PythonQtSystem.h"
+
47#include "structmember.h"
+
48
+ +
50
+
51#define PythonQtBoolResult_Check(op) (Py_TYPE(op) == &PythonQtBoolResult_Type)
+
52
+
+ +
55 PyObject_HEAD
+
56 bool _value;
+
57};
+
+
58
+
59#endif
+
PYTHONQT_EXPORT PyTypeObject PythonQtBoolResult_Type
+ + +
#define PYTHONQT_EXPORT
+
defines a python object that stores a single bool
+ +
+ + + + diff --git a/PythonQtClassInfo_8h.html b/PythonQtClassInfo_8h.html new file mode 100644 index 000000000..9865d57ba --- /dev/null +++ b/PythonQtClassInfo_8h.html @@ -0,0 +1,80 @@ + + + + + + + +PythonQt: PythonQtClassInfo.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtClassInfo.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "PythonQt.h"
+#include <QMetaObject>
+#include <QMetaMethod>
+#include <QHash>
+#include <QByteArray>
+#include <QList>
+
+

Go to the source code of this file.

+ + + + + + + + + + + + +

+Classes

struct  PythonQtDynamicClassInfo
 
struct  PythonQtMemberInfo
 
class  PythonQtClassInfo
 a class that stores all required information about a Qt object (and an optional associated C++ class name) More...
 
struct  PythonQtClassInfo::ParentClassInfo
 store information about parent classes More...
 
+
+ + + + diff --git a/PythonQtClassInfo_8h_source.html b/PythonQtClassInfo_8h_source.html new file mode 100644 index 000000000..948c7948b --- /dev/null +++ b/PythonQtClassInfo_8h_source.html @@ -0,0 +1,428 @@ + + + + + + + +PythonQt: PythonQtClassInfo.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtClassInfo.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTCLASSINFO_H
+
2#define _PYTHONQTCLASSINFO_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+ +
37#include "PythonQt.h"
+
38#include <QMetaObject>
+
39#include <QMetaMethod>
+
40#include <QHash>
+
41#include <QByteArray>
+
42#include <QList>
+
43
+ + +
46
+
+ +
+ +
49 {
+
50 _dynamicMetaObject = nullptr;
+
51 _classInfo = nullptr;
+
52 }
+
+ +
54
+
55 const QMetaObject* _dynamicMetaObject;
+ +
57};
+
+
58
+
+ + +
61
+
+ +
63 : _type(Invalid)
+
64 , _slot(nullptr)
+
65 , _pythonType(nullptr)
+
66 , _enumValue(nullptr)
+
67 {
+
68 }
+
+
69
+ +
71
+ +
73
+
74 PythonQtMemberInfo(const QMetaProperty& prop);
+
75
+ +
77
+
78 // TODO: this could be a union...
+ + + +
82 QMetaProperty _property;
+
83};
+
+
84
+
86
+
+ +
89{
+
90
+
91public:
+ + +
94
+
+ +
+
97 ParentClassInfo(PythonQtClassInfo* parent, int upcastingOffset = 0)
+
98 : _parent(parent)
+
99 , _upcastingOffset(upcastingOffset) {};
+
+
100
+ + +
103 };
+
+
104
+
106 void setupQObject(const QMetaObject* meta);
+
107
+
109 void setupCPPObject(const QByteArray& classname);
+
110
+
112 void setTypeSlots(int typeSlots) { _typeSlots = typeSlots; }
+
114 int typeSlots() const { return _typeSlots; }
+
115
+
117 PythonQtMemberInfo member(const char* member);
+
118
+ +
121
+ +
124
+ +
127
+ +
130
+ +
133
+ +
136
+
138 const QByteArray& className() const;
+
139
+
141 QByteArray unscopedClassName() const;
+
142
+
144 bool isQObject() { return _isQObject; }
+
145
+
147 bool isCPPWrapper() { return !_isQObject; }
+
148
+
150 const QMetaObject* metaObject() { return _meta; }
+
151
+
153 void setMetaObject(const QMetaObject* meta);
+
154
+
156 bool inherits(const char* classname);
+
157
+ +
160
+
164 void* castTo(void* ptr, const char* classname);
+
165
+
167 QString help();
+
168
+
170 QStringList propertyList();
+
171
+
173 QStringList memberList();
+
174
+
176 int metaTypeId() { return _metaTypeId; }
+
177
+ +
180
+
182 QObject* decorator();
+
183
+
185 void addParentClass(const ParentClassInfo& info) { _parentClasses.append(info); }
+
186
+
188 void setPythonQtClassWrapper(PyObject* obj) { _pythonQtClassWrapper = obj; }
+
189
+
191 PyObject* pythonQtClassWrapper() { return _pythonQtClassWrapper; }
+
192
+
194 void setShellSetInstanceWrapperCB(PythonQtShellSetInstanceWrapperCB* cb) { _shellSetInstanceWrapperCB = cb; }
+
195
+
197 PythonQtShellSetInstanceWrapperCB* shellSetInstanceWrapperCB() { return _shellSetInstanceWrapperCB; }
+
198
+
200 void addPolymorphicHandler(PythonQtPolymorphicHandlerCB* cb) { _polymorphicHandlers.append(cb); }
+
201
+
203 void* castDownIfPossible(void* ptr, PythonQtClassInfo** resultClassInfo);
+
204
+
206 static PyObject* findEnumWrapper(const QByteArray& name, PythonQtClassInfo* localScope, bool* isLocalEnum = nullptr);
+
207
+ +
210
+
212 const QList<PythonQtClassInfo*>& nestedClasses() { return _nestedClasses; }
+
213
+
218 PyObject* copyObject(void* cppObject);
+
219
+ +
222
+ +
225
+ + +
230
+
233 PyObject* getPythonTypeForProperty(const QString& name);
+
234
+ +
237
+ +
243
+
246 static QByteArray escapeReservedNames(const QByteArray& name);
+
247
+
249 static void addGlobalNamespaceWrapper(PythonQtClassInfo* namespaceWrapper);
+
250
+ +
254
+
255private:
+
256 void updateRefCountingCBs();
+
257
+
258 void createEnumWrappers(const QObject* decoratorProvider);
+
259 void createEnumWrappers(const QMetaObject* meta);
+
260 PyObject* findEnumWrapper(const char* name);
+
261
+
263 void clearCachedMembers();
+
264
+
265 void* recursiveCastDownIfPossible(void* ptr, const char** resultClassName);
+
266
+
267 PythonQtSlotInfo* findDecoratorSlotsFromDecoratorProvider(const char* memberName, PythonQtSlotInfo* inputInfo,
+
268 bool& found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset);
+
269 void listDecoratorSlotsFromDecoratorProvider(QStringList& list, bool metaOnly);
+
270 PythonQtSlotInfo* recursiveFindDecoratorSlotsFromDecoratorProvider(const char* memberName,
+
271 PythonQtSlotInfo* inputInfo, bool& found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset);
+
272
+
273 void recursiveCollectClassInfos(QList<PythonQtClassInfo*>& classInfoObjects);
+
274 void recursiveCollectDecoratorObjects(QList<QObject*>& decoratorObjects);
+
275
+
276 bool lookForPropertyAndCache(const char* memberName);
+
277 bool lookForMethodAndCache(const char* memberName);
+
278 bool lookForEnumAndCache(const QMetaObject* m, const char* memberName);
+
279
+
280 PythonQtSlotInfo* findDecoratorSlots(const char* memberName, PythonQtSlotInfo* tail, bool& found,
+
281 QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset);
+
282 int findCharOffset(const char* sigStart, char someChar);
+
283
+
284 QHash<QByteArray, PythonQtMemberInfo> _cachedMembers;
+
285
+
286 PythonQtSlotInfo* _constructors;
+
287 PythonQtSlotInfo* _destructor;
+
288
+
289 PythonQtVoidPtrCB* _refCallback;
+
290 PythonQtVoidPtrCB* _unrefCallback;
+
291
+
292 QList<PythonQtSlotInfo*> _decoratorSlots;
+
293
+
294 QList<PythonQtObjectPtr> _enumWrappers;
+
295
+
296 const QMetaObject* _meta;
+
297
+
298 QByteArray _wrappedClassName;
+
299 QList<ParentClassInfo> _parentClasses;
+
300
+
301 QList<PythonQtPolymorphicHandlerCB*> _polymorphicHandlers;
+
302
+
303 QList<PythonQtClassInfo*> _nestedClasses;
+
304
+
305 QObject* _decoratorProvider;
+
306 PythonQtQObjectCreatorFunctionCB* _decoratorProviderCB;
+
307
+
308 PyObject* _pythonQtClassWrapper;
+
309
+
310 PythonQtShellSetInstanceWrapperCB* _shellSetInstanceWrapperCB;
+
311
+
312 int _metaTypeId;
+
313 int _typeSlots;
+
314
+
315 bool _isQObject;
+
316 bool _enumsCreated;
+
317 bool _richCompareDetectionDone;
+
318 bool _searchPolymorphicHandlerOnParent;
+
319 bool _searchRefCountCB;
+
320
+
321 static QList<PythonQtClassInfo*> _globalNamespaceWrappers;
+
322
+
323 static QSet<QByteArray> _reservedNames;
+
324};
+
+
325
+
326//---------------------------------------------------------------
+
327
+
328#endif
+
struct _object PyObject
+ +
#define PYTHONQT_EXPORT
+ +
void PythonQtShellSetInstanceWrapperCB(void *object, PythonQtInstanceWrapper *wrapper)
Definition PythonQt.h:78
+
void * PythonQtPolymorphicHandlerCB(const void *ptr, const char **class_name)
Definition PythonQt.h:75
+
void PythonQtVoidPtrCB(void *object)
Definition PythonQt.h:72
+
QObject * PythonQtQObjectCreatorFunctionCB()
callback to create a QObject lazily
Definition PythonQt.h:155
+
a class that stores all required information about a Qt object (and an optional associated C++ class ...
+
void setShellSetInstanceWrapperCB(PythonQtShellSetInstanceWrapperCB *cb)
set the shell set instance wrapper cb
+ +
void setReferenceCounting(PythonQtVoidPtrCB *refCB, PythonQtVoidPtrCB *unrefCB)
Sets reference counting callbacks for this class and all its subclasses.
+
const QMetaObject * metaObject()
get the meta object
+
bool supportsRichCompare()
+
void addNestedClass(PythonQtClassInfo *info)
add a nested class, so that it can be shown as outer class member
+
bool isCPPWrapper()
returns if the class is a CPP wrapper
+
bool inherits(const char *classname)
returns if this class inherits from the given classname
+
void addDecoratorSlot(PythonQtSlotInfo *info)
add a decorator slot, ownership is passed to classinfo
+
void clearNotFoundCachedMembers()
clear all members that where cached as "NotFound"
+
QStringList memberList()
get list of all members (excluding properties, which can be listed with propertyList())
+
PythonQtSlotInfo * destructor()
get access to the destructor slot
+
void setDecoratorProvider(PythonQtQObjectCreatorFunctionCB *cb)
set an additional decorator provider that offers additional decorator slots for this class
+
const QList< PythonQtClassInfo * > & nestedClasses()
get nested classes
+
int typeSlots() const
get the type capabilities
+
int metaTypeId()
get the meta type id of this class (only valid for isCPPWrapper() == true)
+
void addParentClass(const ParentClassInfo &info)
add the parent class info of a CPP object
+
QString help()
get help string for the metaobject
+ +
void addPolymorphicHandler(PythonQtPolymorphicHandlerCB *cb)
add a handler for polymorphic downcasting
+
void * castTo(void *ptr, const char *classname)
+
PyObject * getPythonTypeForProperty(const QString &name)
+
static QByteArray escapeReservedNames(const QByteArray &name)
+
bool isQObject()
returns if the QObject
+
bool inherits(PythonQtClassInfo *info)
returns if this class inherits from the given classinfo
+
PythonQtVoidPtrCB * referenceCountingRefCB()
Returns the ref counting CB, if there is any.
+
PythonQtSlotInfo * getCopyConstructor()
Get the copy constructor for this class.
+
PythonQtShellSetInstanceWrapperCB * shellSetInstanceWrapperCB()
get the shell set instance wrapper cb
+
QStringList propertyList()
get list of all properties (on QObjects only, otherwise the list is empty)
+
void setupCPPObject(const QByteArray &classname)
setup as a CPP (non-QObject), taking the classname
+
PythonQtClassInfo * getClassInfoForProperty(const QString &name)
Returns the class info for given property, if available.
+
void setDestructor(PythonQtSlotInfo *info)
set a destructor, ownership is passed to classinfo
+
PythonQtMemberInfo member(const char *member)
get the Python method definition for a given slot name (without return type and signature)
+
void addConstructor(PythonQtSlotInfo *info)
add a constructor, ownership is passed to classinfo
+
PyObject * pythonQtClassWrapper()
get the associated PythonQtClassWrapper (which handles instance creation of this type)
+
void * castDownIfPossible(void *ptr, PythonQtClassInfo **resultClassInfo)
cast the pointer down in the class hierarchy if a polymorphic handler allows to do that
+
PyObject * copyObject(void *cppObject)
+
void setMetaObject(const QMetaObject *meta)
set the meta object, this will reset the caching
+
QByteArray unscopedClassName() const
get the unscoped classname (without ParentClass::) for nested classes
+
PythonQtVoidPtrCB * referenceCountingUnrefCB()
Returns the unref counting CB, if there is any.
+
void setTypeSlots(int typeSlots)
set the type capabilities
+
PythonQtSlotInfo * constructors()
get access to the constructor slot (which may be overloaded if there are multiple constructors)
+
static void clearGlobalNamespaceWrappers()
+
void setPythonQtClassWrapper(PyObject *obj)
set the associated PythonQtClassWrapper (which handles instance creation of this type)
+
void setupQObject(const QMetaObject *meta)
setup as a QObject, taking the meta object as meta information about the QObject
+
const QByteArray & className() const
get the classname (either of the QObject or of the wrapped CPP object)
+
static void addGlobalNamespaceWrapper(PythonQtClassInfo *namespaceWrapper)
Add a wrapper that contains global enums.
+
static PyObject * findEnumWrapper(const QByteArray &name, PythonQtClassInfo *localScope, bool *isLocalEnum=nullptr)
returns if the localScope has an enum of that type name or if the enum contains a :: scope,...
+
QObject * decorator()
get the decorator qobject instance
+
a smart pointer that stores a PyObject pointer and that handles reference counting automatically
+
stores information about a slot, including a next pointer to overloaded slots
+
store information about parent classes
+
ParentClassInfo(PythonQtClassInfo *parent, int upcastingOffset=0)
+ + + + +
const QMetaObject * _dynamicMetaObject
+
PythonQtClassInfo * _classInfo
+ + + + + + + + + + + + + +
PythonQtObjectPtr _enumValue
+ +
QMetaProperty _property
+
PythonQtSlotInfo * _slot
+
PythonQtMemberInfo(const QMetaProperty &prop)
+
PythonQtMemberInfo(const PythonQtObjectPtr &enumValue)
+
PythonQtMemberInfo(PythonQtSlotInfo *info)
+
+ + + + diff --git a/PythonQtClassWrapper_8h.html b/PythonQtClassWrapper_8h.html new file mode 100644 index 000000000..0de3da86b --- /dev/null +++ b/PythonQtClassWrapper_8h.html @@ -0,0 +1,111 @@ + + + + + + + +PythonQt: PythonQtClassWrapper.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtClassWrapper.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "PythonQtSystem.h"
+#include "structmember.h"
+#include "methodobject.h"
+#include "compile.h"
+#include <QString>
+
+

Go to the source code of this file.

+ + + + +

+Classes

struct  PythonQtClassWrapper
 
+ + + + +

+Variables

PYTHONQT_EXPORT PyTypeObject PythonQtClassWrapper_Type
 the type of the PythonQt class wrapper objects
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2006-05
+ +

Definition in file PythonQtClassWrapper.h.

+

Variable Documentation

+ +

◆ PythonQtClassWrapper_Type

+ +
+
+ + + + + +
+ + + + +
PYTHONQT_EXPORT PyTypeObject PythonQtClassWrapper_Type
+
+extern
+
+ +

the type of the PythonQt class wrapper objects

+ +
+
+
+ + + + diff --git a/PythonQtClassWrapper_8h_source.html b/PythonQtClassWrapper_8h_source.html new file mode 100644 index 000000000..77d27251e --- /dev/null +++ b/PythonQtClassWrapper_8h_source.html @@ -0,0 +1,140 @@ + + + + + + + +PythonQt: PythonQtClassWrapper.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtClassWrapper.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTCLASSWRAPPER_H
+
2#define _PYTHONQTCLASSWRAPPER_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ +
46
+
47#include "PythonQtSystem.h"
+
48
+
49#include "structmember.h"
+
50#include "methodobject.h"
+
51#include "compile.h"
+
52#include <QString>
+
53
+ +
55
+ +
58
+ +
60
+
61//---------------------------------------------------------------
+ +
76
+
77//---------------------------------------------------------------
+
78
+
79#endif
+
PYTHONQT_EXPORT PyTypeObject PythonQtClassWrapper_Type
the type of the PythonQt class wrapper objects
+ + +
#define PYTHONQT_EXPORT
+
a class that stores all required information about a Qt object (and an optional associated C++ class ...
+ +
PythonQtDynamicClassInfo * _dynamicClassInfo
+ +
PythonQtClassInfo * _classInfo
the additional class information that PythonQt stores for the CPP class
+
PythonQtClassInfo * classInfo()
get the class info
+ +
+ + + + diff --git a/PythonQtConversion_8h.html b/PythonQtConversion_8h.html new file mode 100644 index 000000000..579a4c2fa --- /dev/null +++ b/PythonQtConversion_8h.html @@ -0,0 +1,1180 @@ + + + + + + + +PythonQt: PythonQtConversion.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtConversion.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "PythonQt.h"
+#include "PythonQtMisc.h"
+#include "PythonQtClassInfo.h"
+#include "PythonQtMethodInfo.h"
+#include <QList>
+#include <vector>
+
+

Go to the source code of this file.

+ + + + + +

+Classes

class  PythonQtConv
 a static class that offers methods for type conversion More...
 
+ + + + + + + + + + + + + + + +

+Macros

#define PythonQtRegisterListTemplateConverter(type, innertype)
 
#define PythonQtRegisterListTemplateConverterForKnownClass(type, innertype)
 
#define PythonQtRegisterQPairConverter(type1, type2)
 
#define PythonQtRegisterIntegerMapConverter(type, innertype)
 
#define PythonQtRegisterListTemplateQPairConverter(listtype, type1, type2)
 
#define PythonQtRegisterToolClassesTemplateConverter(innertype)
 
#define PythonQtRegisterToolClassesTemplateConverterForKnownClass(innertype)
 
+ + + + + + + +

+Typedefs

typedef PyObjectPythonQtConvertMetaTypeToPythonCB(const void *inObject, int metaTypeId)
 
typedef bool PythonQtConvertPythonToMetaTypeCB(PyObject *inObject, void *outObject, int metaTypeId, bool strict)
 
typedef QVariant PythonQtConvertPythonSequenceToQVariantListCB(PyObject *inObject)
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

template<class ListType , class T >
PyObjectPythonQtConvertListOfValueTypeToPythonList (const void *inList, int metaTypeId)
 
template<class ListType , class T >
bool PythonQtConvertPythonListToListOfValueType (PyObject *obj, void *outList, int metaTypeId, bool)
 
template<class ListType , class T >
PyObjectPythonQtConvertListOfKnownClassToPythonList (const void *inList, int metaTypeId)
 
template<class ListType , class T >
bool PythonQtConvertPythonListToListOfKnownClass (PyObject *obj, void *outList, int metaTypeId, bool)
 
template<class T1 , class T2 >
PyObjectPythonQtConvertPairToPython (const void *inPair, int metaTypeId)
 
template<class T1 , class T2 >
bool PythonQtConvertPythonToPair (PyObject *obj, void *outPair, int metaTypeId, bool)
 
template<class ListType , class T1 , class T2 >
PyObjectPythonQtConvertListOfPairToPythonList (const void *inList, int metaTypeId)
 
template<class ListType , class T1 , class T2 >
bool PythonQtConvertPythonListToListOfPair (PyObject *obj, void *outList, int metaTypeId, bool)
 
template<class MapType , class T >
PyObjectPythonQtConvertIntegerMapToPython (const void *inMap, int metaTypeId)
 
template<class MapType , class T >
bool PythonQtConvertPythonToIntegerMap (PyObject *val, void *outMap, int metaTypeId, bool)
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2006-05
+ +

Definition in file PythonQtConversion.h.

+

Macro Definition Documentation

+ +

◆ PythonQtRegisterIntegerMapConverter

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define PythonQtRegisterIntegerMapConverter( type,
 innertype 
)
+
+Value:
{ \
+
int typeId = qRegisterMetaType<type<int, innertype>>(#type "<int, " #innertype ">"); \
+
PythonQtConv::registerPythonToMetaTypeConverter(typeId, \
+ +
PythonQtConv::registerMetaTypeToPythonConverter(typeId, \
+ +
}
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
PyObject * PythonQtConvertIntegerMapToPython(const void *inMap, int metaTypeId)
+
bool PythonQtConvertPythonToIntegerMap(PyObject *val, void *outMap, int metaTypeId, bool)
+
+

Definition at line 83 of file PythonQtConversion.h.

+
84 { \
+
85 int typeId = qRegisterMetaType<type<int, innertype>>(#type "<int, " #innertype ">"); \
+
86 PythonQtConv::registerPythonToMetaTypeConverter(typeId, \
+ +
88 PythonQtConv::registerMetaTypeToPythonConverter(typeId, \
+ +
90 }
+
+
+
+ +

◆ PythonQtRegisterListTemplateConverter

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define PythonQtRegisterListTemplateConverter( type,
 innertype 
)
+
+Value:
{ \
+
int typeId = qRegisterMetaType<type<innertype>>(#type "<" #innertype ">"); \
+
PythonQtConv::registerPythonToMetaTypeConverter(typeId, \
+ +
PythonQtConv::registerMetaTypeToPythonConverter(typeId, \
+ +
}
+
PyObject * PythonQtConvertListOfValueTypeToPythonList(const void *inList, int metaTypeId)
+
bool PythonQtConvertPythonListToListOfValueType(PyObject *obj, void *outList, int metaTypeId, bool)
+
+

Definition at line 58 of file PythonQtConversion.h.

+
59 { \
+
60 int typeId = qRegisterMetaType<type<innertype>>(#type "<" #innertype ">"); \
+
61 PythonQtConv::registerPythonToMetaTypeConverter(typeId, \
+ +
63 PythonQtConv::registerMetaTypeToPythonConverter(typeId, \
+ +
65 }
+
+
+
+ +

◆ PythonQtRegisterListTemplateConverterForKnownClass

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define PythonQtRegisterListTemplateConverterForKnownClass( type,
 innertype 
)
+
+Value:
{ \
+
int typeId = qRegisterMetaType<type<innertype>>(#type "<" #innertype ">"); \
+
PythonQtConv::registerPythonToMetaTypeConverter(typeId, \
+ +
PythonQtConv::registerMetaTypeToPythonConverter(typeId, \
+ +
}
+
bool PythonQtConvertPythonListToListOfKnownClass(PyObject *obj, void *outList, int metaTypeId, bool)
+
PyObject * PythonQtConvertListOfKnownClassToPythonList(const void *inList, int metaTypeId)
+
+

Definition at line 67 of file PythonQtConversion.h.

+
68 { \
+
69 int typeId = qRegisterMetaType<type<innertype>>(#type "<" #innertype ">"); \
+
70 PythonQtConv::registerPythonToMetaTypeConverter(typeId, \
+ +
72 PythonQtConv::registerMetaTypeToPythonConverter(typeId, \
+ +
74 }
+
+
+
+ +

◆ PythonQtRegisterListTemplateQPairConverter

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define PythonQtRegisterListTemplateQPairConverter( listtype,
 type1,
 type2 
)
+
+Value:
{ \
+ +
int typeId = qRegisterMetaType<listtype<QPair<type1, type2>>>(#listtype "<QPair<" #type1 "," #type2 ">>"); \
+
PythonQtConv::registerPythonToMetaTypeConverter(typeId, \
+ +
PythonQtConv::registerMetaTypeToPythonConverter(typeId, \
+ +
}
+
bool PythonQtConvertPythonListToListOfPair(PyObject *obj, void *outList, int metaTypeId, bool)
+
PyObject * PythonQtConvertListOfPairToPythonList(const void *inList, int metaTypeId)
+
+

Definition at line 92 of file PythonQtConversion.h.

+
93 { \
+ +
95 int typeId = qRegisterMetaType<listtype<QPair<type1, type2>>>(#listtype "<QPair<" #type1 "," #type2 ">>"); \
+
96 PythonQtConv::registerPythonToMetaTypeConverter(typeId, \
+ +
98 PythonQtConv::registerMetaTypeToPythonConverter(typeId, \
+ +
100 }
+
+
+
+ +

◆ PythonQtRegisterQPairConverter

+ +
+
+ + + + + + + + + + + + + + + + + + +
#define PythonQtRegisterQPairConverter( type1,
 type2 
)
+
+Value:
{ \
+
int typeId = qRegisterMetaType<QPair<type1, type2>>("QPair<" #type1 "," #type2 ">"); \
+
PythonQtConv::registerPythonToMetaTypeConverter(typeId, PythonQtConvertPythonToPair<type1, type2>); \
+
PythonQtConv::registerMetaTypeToPythonConverter(typeId, PythonQtConvertPairToPython<type1, type2>); \
+
}
+
+

Definition at line 76 of file PythonQtConversion.h.

+
77 { \
+
78 int typeId = qRegisterMetaType<QPair<type1, type2>>("QPair<" #type1 "," #type2 ">"); \
+
79 PythonQtConv::registerPythonToMetaTypeConverter(typeId, PythonQtConvertPythonToPair<type1, type2>); \
+
80 PythonQtConv::registerMetaTypeToPythonConverter(typeId, PythonQtConvertPairToPython<type1, type2>); \
+
81 }
+
+
+
+ +

◆ PythonQtRegisterToolClassesTemplateConverter

+ +
+
+ + + + + + + + +
#define PythonQtRegisterToolClassesTemplateConverter( innertype)
+
+
+ +

◆ PythonQtRegisterToolClassesTemplateConverterForKnownClass

+ +
+
+ + + + + + + + +
#define PythonQtRegisterToolClassesTemplateConverterForKnownClass( innertype)
+
+
+

Typedef Documentation

+ +

◆ PythonQtConvertMetaTypeToPythonCB

+ +
+
+ + + + +
typedef PyObject * PythonQtConvertMetaTypeToPythonCB(const void *inObject, int metaTypeId)
+
+ +

Definition at line 54 of file PythonQtConversion.h.

+ +
+
+ +

◆ PythonQtConvertPythonSequenceToQVariantListCB

+ +
+
+ + + + +
typedef QVariant PythonQtConvertPythonSequenceToQVariantListCB(PyObject *inObject)
+
+ +

Definition at line 56 of file PythonQtConversion.h.

+ +
+
+ +

◆ PythonQtConvertPythonToMetaTypeCB

+ +
+
+ + + + +
typedef bool PythonQtConvertPythonToMetaTypeCB(PyObject *inObject, void *outObject, int metaTypeId, bool strict)
+
+ +

Definition at line 55 of file PythonQtConversion.h.

+ +
+
+

Function Documentation

+ +

◆ PythonQtConvertIntegerMapToPython()

+ +
+
+
+template<class MapType , class T >
+ + + + + + + + + + + + + + + + + + +
PyObject * PythonQtConvertIntegerMapToPython (const voidinMap,
int metaTypeId 
)
+
+ +

Definition at line 524 of file PythonQtConversion.h.

+
525{
+ +
527 static int innerType = -1;
+
528 if (innerType == -1) {
+ + + + +
533 }
+
534 if (innerType == QMetaType::UnknownType) {
+
535 std::cerr << "PythonQtConvertIntegerMapToPython: unknown inner type "
+
536 << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId) << std::endl;
+
537 }
+
538
+ +
540 typename MapType::const_iterator t = map->constBegin();
+
541 PyObject* key;
+
542 PyObject* val;
+
543 for (; t != map->constEnd(); t++) {
+
544 key = PyLong_FromLong(t.key());
+ + +
547 Py_DECREF(key);
+
548 Py_DECREF(val);
+
549 }
+
550 return result;
+
551}
+
struct _object PyObject
+
static PyObject * convertQtValueToPythonInternal(int type, const void *data)
converts the Qt parameter given in data, interpreting it as a type registered qvariant/meta type,...
+
static QByteArray getInnerTemplateTypeName(const QByteArray &typeName)
returns the inner type name of a simple template of the form SomeObject<InnerType>
+
const char * typeNameFromMetaTypeId(int metaTypeId)
Returns the type name from a meta type ID.
+
int metaTypeIdFromTypeName(const QByteArray &className)
Returns the meta type ID from a type name.
+
+

References PythonQtConv::convertQtValueToPythonInternal(), PythonQtMethodInfo::getInnerTemplateTypeName(), PythonQtUtils::metaTypeIdFromTypeName(), PythonQtConvertPairToPython(), and PythonQtUtils::typeNameFromMetaTypeId().

+ +
+
+ +

◆ PythonQtConvertListOfKnownClassToPythonList()

+ +
+
+
+template<class ListType , class T >
+ + + + + + + + + + + + + + + + + + +
PyObject * PythonQtConvertListOfKnownClassToPythonList (const voidinList,
int metaTypeId 
)
+
+ +

Definition at line 328 of file PythonQtConversion.h.

+
329{
+ + + +
333 if (innerType == nullptr) {
+
334 std::cerr << "PythonQtConvertListOfKnownClassToPythonList: unknown inner type for "
+
335 << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId) << std::endl;
+
336 }
+
337 PyObject* result = PyTuple_New(list->size());
+
338 int i = 0;
+
339 for (const T& value : *list) {
+
340 T* newObject = new T(value);
+ + +
343 wrap->_ownedByPythonQt = true;
+ +
345 i++;
+
346 }
+
347 return result;
+
348}
+
a class that stores all required information about a Qt object (and an optional associated C++ class ...
+
static QByteArray getInnerListTypeName(const QByteArray &typeName)
returns the inner type name of a simple template or the typename without appended "List".
+
PyObject * wrapPtr(void *ptr, const QByteArray &name, bool passOwnership=false)
+
PythonQtClassInfo * getClassInfo(const QMetaObject *meta)
get the class info for a meta object (if available)
+
static PythonQtPrivate * priv()
get access to internal data (should not be used on the public API, but is used by some C functions)
Definition PythonQt.h:572
+
a Python wrapper object for Qt objects and C++ objects (that are themselves wrapped by wrapper QObjec...
+
bool _ownedByPythonQt
flag that stores if the object is owned by pythonQt
+
+

References PythonQtInstanceWrapper::_ownedByPythonQt, PythonQtClassInfo::className(), PythonQtPrivate::getClassInfo(), PythonQtMethodInfo::getInnerListTypeName(), PythonQt::priv(), PythonQtUtils::typeNameFromMetaTypeId(), and PythonQtPrivate::wrapPtr().

+ +
+
+ +

◆ PythonQtConvertListOfPairToPythonList()

+ +
+
+
+template<class ListType , class T1 , class T2 >
+ + + + + + + + + + + + + + + + + + +
PyObject * PythonQtConvertListOfPairToPythonList (const voidinList,
int metaTypeId 
)
+
+ +

Definition at line 467 of file PythonQtConversion.h.

+
468{
+ +
470 static int innerType =
+ +
472 if (innerType == QMetaType::UnknownType) {
+
473 std::cerr << "PythonQtConvertListOfPairToPythonList: unknown inner type "
+
474 << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId) << std::endl;
+
475 }
+
476 PyObject* result = PyTuple_New(list->size());
+
477 int i = 0;
+
478 typedef const QPair<T1, T2> Pair;
+
479 for (Pair& value : *list) {
+ +
481 PyTuple_SET_ITEM(result, i, object);
+
482 i++;
+
483 }
+
484 return result;
+
485}
+
static int getInnerTemplateMetaType(const QByteArray &typeName)
returns the inner type id of a simple template of the form SomeObject<InnerType>
+
+

References PythonQtMethodInfo::getInnerTemplateMetaType(), PythonQtConvertPairToPython(), and PythonQtUtils::typeNameFromMetaTypeId().

+ +
+
+ +

◆ PythonQtConvertListOfValueTypeToPythonList()

+ +
+
+
+template<class ListType , class T >
+ + + + + + + + + + + + + + + + + + +
PyObject * PythonQtConvertListOfValueTypeToPythonList (const voidinList,
int metaTypeId 
)
+
+ +

Definition at line 273 of file PythonQtConversion.h.

+
274{
+ +
276 static const int innerType =
+ +
278 if (innerType == QMetaType::UnknownType) {
+
279 std::cerr << "PythonQtConvertListOfValueTypeToPythonList: unknown inner type "
+
280 << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId) << std::endl;
+
281 }
+
282 PyObject* result = PyTuple_New(list->size());
+
283 int i = 0;
+
284 for (const T& value : *list) {
+ +
286 i++;
+
287 }
+
288 return result;
+
289}
+
+

References PythonQtConv::convertQtValueToPythonInternal(), PythonQtMethodInfo::getInnerTemplateMetaType(), and PythonQtUtils::typeNameFromMetaTypeId().

+ +
+
+ +

◆ PythonQtConvertPairToPython()

+ +
+
+
+template<class T1 , class T2 >
+ + + + + + + + + + + + + + + + + + +
PyObject * PythonQtConvertPairToPython (const void * inPair,
int metaTypeId 
)
+
+ +

Definition at line 394 of file PythonQtConversion.h.

+
395{
+ +
397 static int innerType1 = -1;
+
398 static int innerType2 = -1;
+
399 if (innerType1 == -1) {
+ + + + + +
405 }
+
406 if (innerType1 == QMetaType::UnknownType || innerType2 == QMetaType::UnknownType) {
+
407 std::cerr << "PythonQtConvertPairToPython: unknown inner type " << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId)
+
408 << std::endl;
+
409 }
+ + + +
413 return result;
+
414}
+
+

References PythonQtConv::convertQtValueToPythonInternal(), PythonQtMethodInfo::getInnerTemplateTypeName(), PythonQtUtils::metaTypeIdFromTypeName(), and PythonQtUtils::typeNameFromMetaTypeId().

+ +

Referenced by PythonQtInstanceWrapper::classInfo(), PythonQtWrapper_QMetaObject::classInfo(), PythonQtWrapper_QMetaObject::classInfoCount(), PythonQtWrapper_QMetaObject::classInfoOffset(), PythonQtStdDecorators::connect(), PythonQtWrapper_QMetaObject::constructor(), PythonQtWrapper_QMetaObject::constructorCount(), PythonQtInstanceWrapper::dynamicClassInfo(), PythonQtWrapper_QMetaObject::enumerator(), PythonQtWrapper_QMetaObject::enumeratorCount(), PythonQtWrapper_QMetaObject::enumeratorOffset(), PythonQtArgumentFrame::establishPersistentPtr(), PythonQtArgumentFrame::establishPersistentViewPtr(), PythonQtWrapper_QMetaObject::getClassName(), PythonQtWrapper_QMetaObject::indexOfClassInfo(), PythonQtWrapper_QMetaObject::indexOfConstructor(), PythonQtWrapper_QMetaObject::indexOfEnumerator(), PythonQtWrapper_QMetaObject::indexOfMethod(), PythonQtWrapper_QMetaObject::indexOfProperty(), PythonQtWrapper_QMetaObject::indexOfSignal(), PythonQtWrapper_QMetaObject::indexOfSlot(), PythonQtUtils::isPythonClassType(), PythonQtWrapper_QMetaObject::method(), PythonQtWrapper_QMetaObject::methodCount(), PythonQtUtils::methodName(), PythonQtWrapper_QMetaObject::methodOffset(), PythonQtObjectPtr::operator!=(), PythonQtSafeObjectPtr::operator!=(), PythonQtObjectPtr::operator!=(), PythonQtSafeObjectPtr::operator!=(), PythonQtObjectPtr::operator=(), PythonQtSafeObjectPtr::operator=(), PythonQtSafeObjectPtr::operator=(), PythonQtObjectPtr::operator=(), PythonQtObjectPtr::operator=(), PythonQtSafeObjectPtr::operator=(), PythonQtSafeObjectPtr::operator=(), PythonQtObjectPtr::operator=(), PythonQtSafeObjectPtr::operator=(), PythonQtObjectPtr::operator==(), PythonQtSafeObjectPtr::operator==(), PythonQtObjectPtr::operator==(), PythonQtSafeObjectPtr::operator==(), PythonQtInstanceWrapper::passOwnershipToCPP(), PythonQtInstanceWrapper::passOwnershipToPython(), PythonQtWrapper_QMetaObject::property(), PythonQtWrapper_QMetaObject::propertyCount(), PythonQtWrapper_QMetaObject::propertyOffset(), PythonQtConvertIntegerMapToPython(), PythonQtConvertListOfPairToPythonList(), PythonQtConvertPythonListToListOfPair(), PythonQtConvertPythonToIntegerMap(), PythonQtMethodInfo::PythonQtMethodInfo(), PythonQtObjectPtr::PythonQtObjectPtr(), PythonQtObjectPtr::PythonQtObjectPtr(), PythonQtSafeObjectPtr::PythonQtSafeObjectPtr(), PythonQtSafeObjectPtr::PythonQtSafeObjectPtr(), PythonQtSafeObjectPtr::PythonQtSafeObjectPtr(), PythonQtSignalTarget::PythonQtSignalTarget(), PythonQtSlotInfo::PythonQtSlotInfo(), PythonQtSlotInfo::PythonQtSlotInfo(), PythonQtThreadStateSaver::restore(), PythonQtThreadStateSaver::save(), PythonQtSlotInfo::setNextInfo(), PythonQtUtils::signature(), PythonQtWrapper_QMetaObject::static_QMetaObject_checkConnectArgs(), PythonQtStdDecorators::static_QObject_connect(), PythonQtStdDecorators::static_QObject_connect(), PythonQtStdDecorators::static_QObject_disconnect(), PythonQtStdDecorators::static_QObject_disconnect(), PythonQtStdDecorators::static_Qt_qAbs(), PythonQtStdDecorators::static_Qt_qBound(), PythonQtStdDecorators::static_Qt_qCritical(), PythonQtStdDecorators::static_Qt_qDebug(), PythonQtStdDecorators::static_Qt_qFatal(), PythonQtStdDecorators::static_Qt_qFuzzyCompare(), PythonQtStdDecorators::static_Qt_qMax(), PythonQtStdDecorators::static_Qt_qMin(), PythonQtStdDecorators::static_Qt_qrand(), PythonQtStdDecorators::static_Qt_qRound(), PythonQtStdDecorators::static_Qt_qRound64(), PythonQtStdDecorators::static_Qt_qsrand(), PythonQtStdDecorators::static_Qt_qVersion(), PythonQtStdDecorators::static_Qt_qWarning(), PythonQtStdDecorators::static_Qt_SIGNAL(), PythonQtStdDecorators::static_Qt_SLOT(), PythonQtWrapper_QMetaObject::superClass(), PythonQtObjectPtr::takeObject(), PythonQtSafeObjectPtr::takeObject(), PythonQtUtils::typeName(), PythonQtUtils::typeNameFromMetaTypeId(), and PythonQtWrapper_QMetaObject::userProperty().

+ +
+
+ +

◆ PythonQtConvertPythonListToListOfKnownClass()

+ +
+
+
+template<class ListType , class T >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQtConvertPythonListToListOfKnownClass (PyObjectobj,
voidoutList,
int metaTypeId,
bool  
)
+
+ +

Definition at line 351 of file PythonQtConversion.h.

+
353{
+ + + +
357 if (innerType == nullptr) {
+
358 std::cerr << "PythonQtConvertListOfKnownClassToPythonList: unknown inner type for "
+
359 << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId) << std::endl;
+
360 }
+
361 bool result = false;
+
362 if (PySequence_Check(obj)) {
+ +
364 if (count >= 0) {
+
365 result = true;
+ +
367 for (int i = 0; i < count; i++) {
+ + + +
371 bool ok;
+
372 T* object = (T*)PythonQtConv::castWrapperTo(wrap, innerType->className(), ok);
+ +
374 if (ok) {
+
375 list->push_back(*object);
+
376 } else {
+
377 result = false;
+
378 break;
+
379 }
+
380 } else {
+ +
382 result = false;
+
383 break;
+
384 }
+
385 }
+
386 }
+
387 }
+
388 return result;
+
389}
+
PYTHONQT_EXPORT PyTypeObject PythonQtInstanceWrapper_Type
+
static void * castWrapperTo(PythonQtInstanceWrapper *wrapper, const QByteArray &className, bool &ok)
cast wrapper to given className if possible
+
+

References PythonQtConv::castWrapperTo(), PythonQtClassInfo::className(), PythonQtPrivate::getClassInfo(), PythonQtMethodInfo::getInnerListTypeName(), PythonQt::priv(), PythonQtInstanceWrapper_Type, and PythonQtUtils::typeNameFromMetaTypeId().

+ +
+
+ +

◆ PythonQtConvertPythonListToListOfPair()

+ +
+
+
+template<class ListType , class T1 , class T2 >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQtConvertPythonListToListOfPair (PyObjectobj,
voidoutList,
int metaTypeId,
bool  
)
+
+ +

Definition at line 488 of file PythonQtConversion.h.

+
490{
+ +
492 static int innerType =
+ +
494 if (innerType == QMetaType::UnknownType) {
+
495 std::cerr << "PythonQtConvertPythonListToListOfPair: unknown inner type "
+
496 << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId) << std::endl;
+
497 }
+
498 bool result = false;
+
499 if (PySequence_Check(obj)) {
+ +
501 if (count >= 0) {
+
502 result = true;
+ +
504 for (int i = 0; i < count; i++) {
+ + + + +
509 list->push_back(pair);
+
510 } else {
+ +
512 result = false;
+
513 break;
+
514 }
+
515 }
+
516 }
+
517 }
+
518 return result;
+
519}
+
+

References PythonQtMethodInfo::getInnerTemplateMetaType(), PythonQtConvertPairToPython(), and PythonQtUtils::typeNameFromMetaTypeId().

+ +
+
+ +

◆ PythonQtConvertPythonListToListOfValueType()

+ +
+
+
+template<class ListType , class T >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQtConvertPythonListToListOfValueType (PyObjectobj,
voidoutList,
int metaTypeId,
bool  
)
+
+ +

Definition at line 292 of file PythonQtConversion.h.

+
294{
+ +
296 static const int innerType =
+ +
298 if (innerType == QMetaType::UnknownType) {
+
299 std::cerr << "PythonQtConvertPythonListToListOfValueType: unknown inner type "
+
300 << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId) << std::endl;
+
301 }
+
302 bool result = false;
+
303 if (PySequence_Check(obj)) {
+ +
305 if (count >= 0) {
+
306 result = true;
+ +
308 for (int i = 0; i < count; i++) {
+ +
310 // this is quite some overhead, but it avoids having another large switch...
+ + +
313 if (v.isValid()) {
+
314 list->push_back(qvariant_cast<T>(v));
+
315 } else {
+
316 result = false;
+
317 break;
+
318 }
+
319 }
+
320 }
+
321 }
+
322 return result;
+
323}
+
static QVariant PyObjToQVariant(PyObject *val, int type=-1)
+
+

References PythonQtMethodInfo::getInnerTemplateMetaType(), PythonQtConv::PyObjToQVariant(), and PythonQtUtils::typeNameFromMetaTypeId().

+ +
+
+ +

◆ PythonQtConvertPythonToIntegerMap()

+ +
+
+
+template<class MapType , class T >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQtConvertPythonToIntegerMap (PyObjectval,
voidoutMap,
int metaTypeId,
bool  
)
+
+ +

Definition at line 554 of file PythonQtConversion.h.

+
555{
+ +
557 static int innerType = -1;
+
558 if (innerType == -1) {
+ + + + +
563 }
+
564 if (innerType == QMetaType::UnknownType) {
+
565 std::cerr << "PythonQtConvertPythonToIntegerMap: unknown inner type "
+
566 << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId) << std::endl;
+
567 }
+
568 bool result = false;
+
569 if (PyMapping_Check(val)) {
+
570 result = true;
+ +
572 if (items) {
+
573 int count = PyList_Size(items);
+ +
575 PyObject* key;
+ +
577 for (int i = 0; i < count; i++) {
+ + + +
581
+
582 bool ok;
+
583 int intKey = PythonQtConv::PyObjGetInt(key, false, ok);
+
584 // this is quite some overhead, but it avoids having another large switch...
+ +
586 if (v.isValid() && ok) {
+
587 map->insert(intKey, qvariant_cast<T>(v));
+
588 } else {
+
589 result = false;
+
590 break;
+
591 }
+
592 }
+ +
594 }
+
595 }
+
596 return result;
+
597}
+
static int PyObjGetInt(PyObject *val, bool strict, bool &ok)
get int from py object
+
+

References PythonQtMethodInfo::getInnerTemplateTypeName(), PythonQtUtils::metaTypeIdFromTypeName(), PythonQtConv::PyObjGetInt(), PythonQtConv::PyObjToQVariant(), PythonQtConvertPairToPython(), and PythonQtUtils::typeNameFromMetaTypeId().

+ +
+
+ +

◆ PythonQtConvertPythonToPair()

+ +
+
+
+template<class T1 , class T2 >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQtConvertPythonToPair (PyObjectobj,
voidoutPair,
int metaTypeId,
bool  
)
+
+ +

Definition at line 417 of file PythonQtConversion.h.

+
418{
+ +
420 static int innerType1 = -1;
+
421 static int innerType2 = -1;
+
422 if (innerType1 == -1) {
+ + + + + +
428 }
+
429 if (innerType1 == QMetaType::UnknownType || innerType2 == QMetaType::UnknownType) {
+
430 std::cerr << "PythonQtConvertPythonToPair: unknown inner type " << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId)
+
431 << std::endl;
+
432 }
+
433 bool result = false;
+
434 if (PySequence_Check(obj)) {
+ +
436 if (count == 2) {
+
437 result = true;
+ +
439
+ +
441 // this is quite some overhead, but it avoids having another large switch...
+ + +
444 if (v.isValid()) {
+
445 pair->first = qvariant_cast<T1>(v);
+
446 } else {
+
447 return false;
+
448 }
+
449
+ +
451 // this is quite some overhead, but it avoids having another large switch...
+ + +
454 if (v.isValid()) {
+
455 pair->second = qvariant_cast<T2>(v);
+
456 } else {
+
457 return false;
+
458 }
+
459 }
+
460 }
+
461 return result;
+
462}
+
+

References PythonQtMethodInfo::getInnerTemplateTypeName(), PythonQtUtils::metaTypeIdFromTypeName(), PythonQtConv::PyObjToQVariant(), and PythonQtUtils::typeNameFromMetaTypeId().

+ +
+
+
+ + + + diff --git a/PythonQtConversion_8h_source.html b/PythonQtConversion_8h_source.html new file mode 100644 index 000000000..574b8ab23 --- /dev/null +++ b/PythonQtConversion_8h_source.html @@ -0,0 +1,743 @@ + + + + + + + +PythonQt: PythonQtConversion.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtConversion.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTCONVERSION_H
+
2#define _PYTHONQTCONVERSION_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ +
46#include "PythonQt.h"
+
47#include "PythonQtMisc.h"
+
48#include "PythonQtClassInfo.h"
+
49#include "PythonQtMethodInfo.h"
+
50
+
51#include <QList>
+
52#include <vector>
+
53
+
54typedef PyObject* PythonQtConvertMetaTypeToPythonCB(const void* inObject, int metaTypeId);
+
55typedef bool PythonQtConvertPythonToMetaTypeCB(PyObject* inObject, void* outObject, int metaTypeId, bool strict);
+ +
57
+
+
58#define PythonQtRegisterListTemplateConverter(type, innertype) \
+
59 { \
+
60 int typeId = qRegisterMetaType<type<innertype>>(#type "<" #innertype ">"); \
+
61 PythonQtConv::registerPythonToMetaTypeConverter(typeId, \
+
62 PythonQtConvertPythonListToListOfValueType<type<innertype>, innertype>); \
+
63 PythonQtConv::registerMetaTypeToPythonConverter(typeId, \
+
64 PythonQtConvertListOfValueTypeToPythonList<type<innertype>, innertype>); \
+
65 }
+
+
66
+
+
67#define PythonQtRegisterListTemplateConverterForKnownClass(type, innertype) \
+
68 { \
+
69 int typeId = qRegisterMetaType<type<innertype>>(#type "<" #innertype ">"); \
+
70 PythonQtConv::registerPythonToMetaTypeConverter(typeId, \
+
71 PythonQtConvertPythonListToListOfKnownClass<type<innertype>, innertype>); \
+
72 PythonQtConv::registerMetaTypeToPythonConverter(typeId, \
+
73 PythonQtConvertListOfKnownClassToPythonList<type<innertype>, innertype>); \
+
74 }
+
+
75
+
+
76#define PythonQtRegisterQPairConverter(type1, type2) \
+
77 { \
+
78 int typeId = qRegisterMetaType<QPair<type1, type2>>("QPair<" #type1 "," #type2 ">"); \
+
79 PythonQtConv::registerPythonToMetaTypeConverter(typeId, PythonQtConvertPythonToPair<type1, type2>); \
+
80 PythonQtConv::registerMetaTypeToPythonConverter(typeId, PythonQtConvertPairToPython<type1, type2>); \
+
81 }
+
+
82
+
+
83#define PythonQtRegisterIntegerMapConverter(type, innertype) \
+
84 { \
+
85 int typeId = qRegisterMetaType<type<int, innertype>>(#type "<int, " #innertype ">"); \
+
86 PythonQtConv::registerPythonToMetaTypeConverter(typeId, \
+
87 PythonQtConvertPythonToIntegerMap<type<int, innertype>, innertype>); \
+
88 PythonQtConv::registerMetaTypeToPythonConverter(typeId, \
+
89 PythonQtConvertIntegerMapToPython<type<int, innertype>, innertype>); \
+
90 }
+
+
91
+
+
92#define PythonQtRegisterListTemplateQPairConverter(listtype, type1, type2) \
+
93 { \
+
94 qRegisterMetaType<QPair<type1, type2>>("QPair<" #type1 "," #type2 ">"); \
+
95 int typeId = qRegisterMetaType<listtype<QPair<type1, type2>>>(#listtype "<QPair<" #type1 "," #type2 ">>"); \
+
96 PythonQtConv::registerPythonToMetaTypeConverter(typeId, \
+
97 PythonQtConvertPythonListToListOfPair<listtype<QPair<type1, type2>>, type1, type2>); \
+
98 PythonQtConv::registerMetaTypeToPythonConverter(typeId, \
+
99 PythonQtConvertListOfPairToPythonList<listtype<QPair<type1, type2>>, type1, type2>); \
+
100 }
+
+
101
+
+
102#define PythonQtRegisterToolClassesTemplateConverter(innertype) \
+
103 PythonQtRegisterListTemplateConverter(QList, innertype); \
+
104 PythonQtRegisterListTemplateConverter(QVector, innertype); \
+
105 PythonQtRegisterListTemplateConverter(std::vector, innertype);
+
+
106
+
+
107#define PythonQtRegisterToolClassesTemplateConverterForKnownClass(innertype) \
+
108 PythonQtRegisterListTemplateConverterForKnownClass(QList, innertype); \
+
109 PythonQtRegisterListTemplateConverterForKnownClass(QVector, innertype); \
+
110 PythonQtRegisterListTemplateConverterForKnownClass(std::vector, innertype);
+
+
111
+
+ +
114{
+
115
+
116public:
+
117
+
119 static PyObject* GetPyBool(bool val);
+
120
+ +
123
+
126 static void* ConvertPythonToQt(const PythonQtMethodInfo::ParameterInfo& info, PyObject* obj, bool strict,
+
127 PythonQtClassInfo* classInfo, void* alreadyAllocatedCPPObject, PythonQtArgumentFrame* frame = nullptr);
+
128
+ +
131
+
133 static PyObject* QStringToPyObject(const QString& str);
+
134
+
136 static PyObject* QStringListToPyObject(const QStringList& list);
+
137
+
139 static PyObject* QStringListToPyList(const QStringList& list);
+
140
+
142 static QString PyObjGetRepresentation(PyObject* val);
+
143
+
+
145 static QString PyObjGetString(PyObject* val)
+
146 {
+
147 bool ok;
+
148 QString s = PyObjGetString(val, false, ok);
+
149 return s;
+
150 }
+
+
152 static QString PyObjGetString(PyObject* val, bool strict, bool& ok);
+
154 static QByteArray PyObjGetBytes(PyObject* val, bool strict, bool& ok);
+
156 static QByteArray PyObjGetBytesAllowString(PyObject* val, bool strict, bool& ok);
+
158 static int PyObjGetInt(PyObject* val, bool strict, bool& ok);
+
160 static qint64 PyObjGetLongLong(PyObject* val, bool strict, bool& ok);
+
162 static quint64 PyObjGetULongLong(PyObject* val, bool strict, bool& ok);
+
164 static double PyObjGetDouble(PyObject* val, bool strict, bool& ok);
+
166 static bool PyObjGetBool(PyObject* val, bool strict, bool& ok);
+
167
+
169 static QStringList PyObjToStringList(PyObject* val, bool strict, bool& ok);
+
170
+
173 static QVariant PyObjToQVariant(PyObject* val, int type = -1);
+
174
+
176 static PyObject* QVariantToPyObject(const QVariant& v);
+
177
+
178 static PyObject* QVariantHashToPyObject(const QVariantHash& m);
+
179 static PyObject* QVariantMapToPyObject(const QVariantMap& m);
+
180 static PyObject* QVariantListToPyObject(const QVariantList& l);
+
181
+
183 static QString CPPObjectToString(int type, const void* data);
+
184
+
+ +
187 {
+
188 _pythonToMetaTypeConverters.insert(metaTypeId, cb);
+
189 }
+
+
190
+
+ +
193 {
+
194 _metaTypeToPythonConverters.insert(metaTypeId, cb);
+
195 }
+
+
196
+
+ +
200 {
+
201 _pythonSequenceToQVariantListCB = cb;
+
202 }
+
+
203
+
205 static PyObject* convertQtValueToPythonInternal(int type, const void* data);
+
206
+
208 static PyObject* createCopyFromMetaType(int type, const void* object);
+
209
+
211 static void* castWrapperTo(PythonQtInstanceWrapper* wrapper, const QByteArray& className, bool& ok);
+
212
+
213 static bool convertToPythonQtObjectPtr(PyObject* obj, void* /* PythonQtObjectPtr* */ outPtr, int /*metaTypeId*/,
+
214 bool /*strict*/);
+
215 static PyObject* convertFromPythonQtObjectPtr(const void* /* PythonQtObjectPtr* */ inObject, int /*metaTypeId*/);
+
216 static bool convertToPythonQtSafeObjectPtr(PyObject* obj, void* /* PythonQtObjectPtr* */ outPtr, int /*metaTypeId*/,
+
217 bool /*strict*/);
+
218 static PyObject* convertFromPythonQtSafeObjectPtr(const void* /* PythonQtObjectPtr* */ inObject, int /*metaTypeId*/);
+
219 static bool convertToQListOfPythonQtObjectPtr(PyObject* obj, void* /* QList<PythonQtObjectPtr>* */ outList,
+
220 int /*metaTypeId*/, bool /*strict*/);
+
221 static PyObject* convertFromQListOfPythonQtObjectPtr(const void* /* QList<PythonQtObjectPtr>* */ inObject,
+
222 int /*metaTypeId*/);
+
223#if QT_VERSION < 0x060000
+
224 static PyObject* convertFromStringRef(const void* inObject, int /*metaTypeId*/);
+
225#else
+
226 static PyObject* convertFromStringView(const void* inObject, int /*metaTypeId*/);
+
227 static PyObject* convertFromAnyStringView(const void* inObject, int /*metaTypeId*/);
+
228 static PyObject* convertFromByteArrayView(const void* inObject, int /*metaTypeId*/);
+
229#endif
+
230
+
232 static QByteArray getCPPTypeName(PyObject* type);
+
233
+
235 static bool isStringType(PyTypeObject* type);
+
236
+ +
239
+
240protected:
+
241 static QHash<int, PythonQtConvertMetaTypeToPythonCB*> _metaTypeToPythonConverters;
+
242 static QHash<int, PythonQtConvertPythonToMetaTypeCB*> _pythonToMetaTypeConverters;
+ +
244
+
246 static void* handlePythonToQtAutoConversion(int typeId, PyObject* obj, void* alreadyAllocatedCPPObject,
+
247 PythonQtArgumentFrame* frame);
+
248
+ + +
253 static bool ConvertPythonListToQListOfPointerType(PyObject* obj, QList<void*>* list,
+
254 const PythonQtMethodInfo::ParameterInfo& info, bool strict);
+
255
+
257 template<typename Map>
+
258 static void pythonToMapVariant(PyObject* val, QVariant& result);
+
260 template<typename Map>
+
261 static PyObject* mapToPython(const Map& m);
+
262
+
263#if QT_VERSION < 0x060000
+
264 static int stringRefTypeId;
+
265#else
+
266 static int stringViewTypeId;
+
267 static int anyStringViewTypeId;
+
268 static int byteArrayViewTypeId;
+
269#endif
+
270};
+
+
271
+
272template<class ListType, class T>
+
+
273PyObject* PythonQtConvertListOfValueTypeToPythonList(const void* /*QList<T>* */ inList, int metaTypeId)
+
274{
+
275 ListType* list = (ListType*)inList;
+
276 static const int innerType =
+ +
278 if (innerType == QMetaType::UnknownType) {
+
279 std::cerr << "PythonQtConvertListOfValueTypeToPythonList: unknown inner type "
+
280 << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId) << std::endl;
+
281 }
+
282 PyObject* result = PyTuple_New(list->size());
+
283 int i = 0;
+
284 for (const T& value : *list) {
+
285 PyTuple_SET_ITEM(result, i, PythonQtConv::convertQtValueToPythonInternal(innerType, &value));
+
286 i++;
+
287 }
+
288 return result;
+
289}
+
+
290
+
291template<class ListType, class T>
+
+
292bool PythonQtConvertPythonListToListOfValueType(PyObject* obj, void* /*QList<T>* */ outList, int metaTypeId,
+
293 bool /*strict*/)
+
294{
+
295 ListType* list = (ListType*)outList;
+
296 static const int innerType =
+ +
298 if (innerType == QMetaType::UnknownType) {
+
299 std::cerr << "PythonQtConvertPythonListToListOfValueType: unknown inner type "
+
300 << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId) << std::endl;
+
301 }
+
302 bool result = false;
+
303 if (PySequence_Check(obj)) {
+
304 int count = PySequence_Size(obj);
+
305 if (count >= 0) {
+
306 result = true;
+
307 PyObject* value;
+
308 for (int i = 0; i < count; i++) {
+
309 value = PySequence_GetItem(obj, i);
+
310 // this is quite some overhead, but it avoids having another large switch...
+
311 QVariant v = PythonQtConv::PyObjToQVariant(value, innerType);
+
312 Py_XDECREF(value);
+
313 if (v.isValid()) {
+
314 list->push_back(qvariant_cast<T>(v));
+
315 } else {
+
316 result = false;
+
317 break;
+
318 }
+
319 }
+
320 }
+
321 }
+
322 return result;
+
323}
+
+
324
+
325//--------------------------------------------------------------------------------------------------------------------
+
326
+
327template<class ListType, class T>
+
+
328PyObject* PythonQtConvertListOfKnownClassToPythonList(const void* /*QList<T>* */ inList, int metaTypeId)
+
329{
+
330 ListType* list = (ListType*)inList;
+
331 static PythonQtClassInfo* innerType = PythonQt::priv()->getClassInfo(
+ +
333 if (innerType == nullptr) {
+
334 std::cerr << "PythonQtConvertListOfKnownClassToPythonList: unknown inner type for "
+
335 << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId) << std::endl;
+
336 }
+
337 PyObject* result = PyTuple_New(list->size());
+
338 int i = 0;
+
339 for (const T& value : *list) {
+
340 T* newObject = new T(value);
+ +
342 (PythonQtInstanceWrapper*)PythonQt::priv()->wrapPtr(newObject, innerType->className());
+
343 wrap->_ownedByPythonQt = true;
+
344 PyTuple_SET_ITEM(result, i, (PyObject*)wrap);
+
345 i++;
+
346 }
+
347 return result;
+
348}
+
+
349
+
350template<class ListType, class T>
+
+
351bool PythonQtConvertPythonListToListOfKnownClass(PyObject* obj, void* /*QList<T>* */ outList, int metaTypeId,
+
352 bool /*strict*/)
+
353{
+
354 ListType* list = (ListType*)outList;
+
355 static PythonQtClassInfo* innerType = PythonQt::priv()->getClassInfo(
+ +
357 if (innerType == nullptr) {
+
358 std::cerr << "PythonQtConvertListOfKnownClassToPythonList: unknown inner type for "
+
359 << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId) << std::endl;
+
360 }
+
361 bool result = false;
+
362 if (PySequence_Check(obj)) {
+
363 int count = PySequence_Size(obj);
+
364 if (count >= 0) {
+
365 result = true;
+
366 PyObject* value;
+
367 for (int i = 0; i < count; i++) {
+
368 value = PySequence_GetItem(obj, i);
+
369 if (PyObject_TypeCheck(value, &PythonQtInstanceWrapper_Type)) {
+ +
371 bool ok;
+
372 T* object = (T*)PythonQtConv::castWrapperTo(wrap, innerType->className(), ok);
+
373 Py_XDECREF(value);
+
374 if (ok) {
+
375 list->push_back(*object);
+
376 } else {
+
377 result = false;
+
378 break;
+
379 }
+
380 } else {
+
381 Py_XDECREF(value);
+
382 result = false;
+
383 break;
+
384 }
+
385 }
+
386 }
+
387 }
+
388 return result;
+
389}
+
+
390
+
391//--------------------------------------------------------------------------------------------------------------------
+
392
+
393template<class T1, class T2>
+
+
394PyObject* PythonQtConvertPairToPython(const void* /*QPair<T1,T2>* */ inPair, int metaTypeId)
+
395{
+
396 QPair<T1, T2>* pair = (QPair<T1, T2>*)inPair;
+
397 static int innerType1 = -1;
+
398 static int innerType2 = -1;
+
399 if (innerType1 == -1) {
+
400 QByteArray innerTypes =
+ +
402 QList<QByteArray> names = innerTypes.split(',');
+
403 innerType1 = PythonQtUtils::metaTypeIdFromTypeName(names.at(0).trimmed());
+
404 innerType2 = PythonQtUtils::metaTypeIdFromTypeName(names.at(1).trimmed());
+
405 }
+
406 if (innerType1 == QMetaType::UnknownType || innerType2 == QMetaType::UnknownType) {
+
407 std::cerr << "PythonQtConvertPairToPython: unknown inner type " << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId)
+
408 << std::endl;
+
409 }
+
410 PyObject* result = PyTuple_New(2);
+
411 PyTuple_SET_ITEM(result, 0, PythonQtConv::convertQtValueToPythonInternal(innerType1, &pair->first));
+
412 PyTuple_SET_ITEM(result, 1, PythonQtConv::convertQtValueToPythonInternal(innerType2, &pair->second));
+
413 return result;
+
414}
+
+
415
+
416template<class T1, class T2>
+
+
417bool PythonQtConvertPythonToPair(PyObject* obj, void* /*QPair<T1,T2>* */ outPair, int metaTypeId, bool /*strict*/)
+
418{
+
419 QPair<T1, T2>* pair = (QPair<T1, T2>*)outPair;
+
420 static int innerType1 = -1;
+
421 static int innerType2 = -1;
+
422 if (innerType1 == -1) {
+
423 QByteArray innerTypes =
+ +
425 QList<QByteArray> names = innerTypes.split(',');
+
426 innerType1 = PythonQtUtils::metaTypeIdFromTypeName(names.at(0).trimmed());
+
427 innerType2 = PythonQtUtils::metaTypeIdFromTypeName(names.at(1).trimmed());
+
428 }
+
429 if (innerType1 == QMetaType::UnknownType || innerType2 == QMetaType::UnknownType) {
+
430 std::cerr << "PythonQtConvertPythonToPair: unknown inner type " << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId)
+
431 << std::endl;
+
432 }
+
433 bool result = false;
+
434 if (PySequence_Check(obj)) {
+
435 int count = PySequence_Size(obj);
+
436 if (count == 2) {
+
437 result = true;
+
438 PyObject* value;
+
439
+
440 value = PySequence_GetItem(obj, 0);
+
441 // this is quite some overhead, but it avoids having another large switch...
+
442 QVariant v = PythonQtConv::PyObjToQVariant(value, innerType1);
+
443 Py_XDECREF(value);
+
444 if (v.isValid()) {
+
445 pair->first = qvariant_cast<T1>(v);
+
446 } else {
+
447 return false;
+
448 }
+
449
+
450 value = PySequence_GetItem(obj, 1);
+
451 // this is quite some overhead, but it avoids having another large switch...
+
452 v = PythonQtConv::PyObjToQVariant(value, innerType2);
+
453 Py_XDECREF(value);
+
454 if (v.isValid()) {
+
455 pair->second = qvariant_cast<T2>(v);
+
456 } else {
+
457 return false;
+
458 }
+
459 }
+
460 }
+
461 return result;
+
462}
+
+
463
+
464//--------------------------------------------------------------------------------------------------------------------
+
465
+
466template<class ListType, class T1, class T2>
+
+
467PyObject* PythonQtConvertListOfPairToPythonList(const void* /*QList<QPair<T1,T2> >* */ inList, int metaTypeId)
+
468{
+
469 ListType* list = (ListType*)inList;
+
470 static int innerType =
+ +
472 if (innerType == QMetaType::UnknownType) {
+
473 std::cerr << "PythonQtConvertListOfPairToPythonList: unknown inner type "
+
474 << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId) << std::endl;
+
475 }
+
476 PyObject* result = PyTuple_New(list->size());
+
477 int i = 0;
+
478 typedef const QPair<T1, T2> Pair;
+
479 for (Pair& value : *list) {
+ +
481 PyTuple_SET_ITEM(result, i, object);
+
482 i++;
+
483 }
+
484 return result;
+
485}
+
+
486
+
487template<class ListType, class T1, class T2>
+
+
488bool PythonQtConvertPythonListToListOfPair(PyObject* obj, void* /*QList<QPair<T1,T2> >* */ outList, int metaTypeId,
+
489 bool /*strict*/)
+
490{
+ +
492 static int innerType =
+ +
494 if (innerType == QMetaType::UnknownType) {
+
495 std::cerr << "PythonQtConvertPythonListToListOfPair: unknown inner type "
+
496 << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId) << std::endl;
+
497 }
+
498 bool result = false;
+
499 if (PySequence_Check(obj)) {
+ +
501 if (count >= 0) {
+
502 result = true;
+ +
504 for (int i = 0; i < count; i++) {
+ + + + +
509 list->push_back(pair);
+
510 } else {
+ +
512 result = false;
+
513 break;
+
514 }
+
515 }
+
516 }
+
517 }
+
518 return result;
+
519}
+
+
520
+
521//--------------------------------------------------------------------------------------------------------------------
+
522
+
523template<class MapType, class T>
+
+
524PyObject* PythonQtConvertIntegerMapToPython(const void* /*QMap<int, T>* */ inMap, int metaTypeId)
+
525{
+ +
527 static int innerType = -1;
+
528 if (innerType == -1) {
+ + + + +
533 }
+
534 if (innerType == QMetaType::UnknownType) {
+
535 std::cerr << "PythonQtConvertIntegerMapToPython: unknown inner type "
+
536 << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId) << std::endl;
+
537 }
+
538
+ +
540 typename MapType::const_iterator t = map->constBegin();
+
541 PyObject* key;
+
542 PyObject* val;
+
543 for (; t != map->constEnd(); t++) {
+
544 key = PyLong_FromLong(t.key());
+ + +
547 Py_DECREF(key);
+
548 Py_DECREF(val);
+
549 }
+
550 return result;
+
551}
+
+
552
+
553template<class MapType, class T>
+
+
554bool PythonQtConvertPythonToIntegerMap(PyObject* val, void* /*QMap<int, T>* */ outMap, int metaTypeId, bool /*strict*/)
+
555{
+ +
557 static int innerType = -1;
+
558 if (innerType == -1) {
+ + + + +
563 }
+
564 if (innerType == QMetaType::UnknownType) {
+
565 std::cerr << "PythonQtConvertPythonToIntegerMap: unknown inner type "
+
566 << PythonQtUtils::typeNameFromMetaTypeId(metaTypeId) << std::endl;
+
567 }
+
568 bool result = false;
+
569 if (PyMapping_Check(val)) {
+
570 result = true;
+ +
572 if (items) {
+
573 int count = PyList_Size(items);
+ +
575 PyObject* key;
+ +
577 for (int i = 0; i < count; i++) {
+ + + +
581
+
582 bool ok;
+
583 int intKey = PythonQtConv::PyObjGetInt(key, false, ok);
+
584 // this is quite some overhead, but it avoids having another large switch...
+ +
586 if (v.isValid() && ok) {
+
587 map->insert(intKey, qvariant_cast<T>(v));
+
588 } else {
+
589 result = false;
+
590 break;
+
591 }
+
592 }
+ +
594 }
+
595 }
+
596 return result;
+
597}
+
+
598
+
599#endif
+ +
QVariant PythonQtConvertPythonSequenceToQVariantListCB(PyObject *inObject)
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
PyObject * PythonQtConvertIntegerMapToPython(const void *inMap, int metaTypeId)
+
PyObject * PythonQtConvertMetaTypeToPythonCB(const void *inObject, int metaTypeId)
+
bool PythonQtConvertPythonToIntegerMap(PyObject *val, void *outMap, int metaTypeId, bool)
+
bool PythonQtConvertPythonListToListOfPair(PyObject *obj, void *outList, int metaTypeId, bool)
+
bool PythonQtConvertPythonToMetaTypeCB(PyObject *inObject, void *outObject, int metaTypeId, bool strict)
+
bool PythonQtConvertPythonToPair(PyObject *obj, void *outPair, int metaTypeId, bool)
+
bool PythonQtConvertPythonListToListOfKnownClass(PyObject *obj, void *outList, int metaTypeId, bool)
+
PyObject * PythonQtConvertListOfValueTypeToPythonList(const void *inList, int metaTypeId)
+
bool PythonQtConvertPythonListToListOfValueType(PyObject *obj, void *outList, int metaTypeId, bool)
+
PyObject * PythonQtConvertListOfPairToPythonList(const void *inList, int metaTypeId)
+
PyObject * PythonQtConvertListOfKnownClassToPythonList(const void *inList, int metaTypeId)
+
PYTHONQT_EXPORT PyTypeObject PythonQtInstanceWrapper_Type
+ +
struct _object PyObject
+ + +
#define PYTHONQT_EXPORT
+ +
Stores C++ arguments for a qt_metacall (which are created when converting data from Python to C++)
+
a class that stores all required information about a Qt object (and an optional associated C++ class ...
+
const QByteArray & className() const
get the classname (either of the QObject or of the wrapped CPP object)
+
a static class that offers methods for type conversion
+
static quint64 PyObjGetULongLong(PyObject *val, bool strict, bool &ok)
get int64 from py object
+
static bool convertToPythonQtObjectPtr(PyObject *obj, void *outPtr, int, bool)
+
static PyObject * QVariantHashToPyObject(const QVariantHash &m)
+
static PyObject * QVariantMapToPyObject(const QVariantMap &m)
+
static void * ConvertPythonToQt(const PythonQtMethodInfo::ParameterInfo &info, PyObject *obj, bool strict, PythonQtClassInfo *classInfo, void *alreadyAllocatedCPPObject, PythonQtArgumentFrame *frame=nullptr)
+
static bool isStringType(PyTypeObject *type)
Returns if the given object is a string (or unicode string)
+
static qint64 PyObjGetLongLong(PyObject *val, bool strict, bool &ok)
get int64 from py object
+
static QHash< int, PythonQtConvertPythonToMetaTypeCB * > _pythonToMetaTypeConverters
+
static bool convertToQListOfPythonQtObjectPtr(PyObject *obj, void *outList, int, bool)
+
static void setPythonSequenceToQVariantListCallback(PythonQtConvertPythonSequenceToQVariantListCB *cb)
+
static PyObject * mapToPython(const Map &m)
helper template function for QVariantMapToPyObject/QVariantHashToPyObject
+
static PyObject * convertFromPythonQtSafeObjectPtr(const void *inObject, int)
+
static double PyObjGetDouble(PyObject *val, bool strict, bool &ok)
get double from py object
+
static void * CreateQtReturnValue(const PythonQtMethodInfo::ParameterInfo &info, PythonQtArgumentFrame *frame)
creates a data storage for the passed parameter type and returns a void pointer to be set as arg[0] o...
+
static bool convertToPythonQtSafeObjectPtr(PyObject *obj, void *outPtr, int, bool)
+
static PyObject * QStringListToPyList(const QStringList &list)
converts QStringList to Python list
+
static QVariant PyObjToQVariant(PyObject *val, int type=-1)
+
static QByteArray getCPPTypeName(PyObject *type)
Returns the name of the equivalent CPP type (for signals and slots)
+
static bool ConvertPythonListToQListOfPointerType(PyObject *obj, QList< void * > *list, const PythonQtMethodInfo::ParameterInfo &info, bool strict)
tries to convert the python object to a QList of pointers to type objects, returns true on success
+
static int stringRefTypeId
+
static PyObject * GetPyBool(bool val)
get a ref counted True or False Python object
+
static PyObject * QStringToPyObject(const QString &str)
converts QString to Python string (unicode!)
+
static QString PyObjGetString(PyObject *val)
get string value from py object
+
static QByteArray PyObjGetBytes(PyObject *val, bool strict, bool &ok)
get bytes from py object
+
static QString CPPObjectToString(int type, const void *data)
get human readable string from CPP object (when the metatype is known)
+
static bool PyObjGetBool(PyObject *val, bool strict, bool &ok)
get bool from py object
+
static PyObject * ConvertQListOfPointerTypeToPythonList(QList< void * > *list, const PythonQtMethodInfo::ParameterInfo &info)
converts the list of pointers of given type to Python
+
static void * handlePythonToQtAutoConversion(int typeId, PyObject *obj, void *alreadyAllocatedCPPObject, PythonQtArgumentFrame *frame)
handle automatic conversion of some special types (QColor, QBrush, ...)
+
static QByteArray PyObjGetBytesAllowString(PyObject *val, bool strict, bool &ok)
get bytes from py object, also allows Python string
+
static QString PyObjGetString(PyObject *val, bool strict, bool &ok)
get string value from py object
+
static PyObject * convertFromPythonQtObjectPtr(const void *inObject, int)
+
static void pythonToMapVariant(PyObject *val, QVariant &result)
helper template method for conversion from Python to QVariantMap/Hash
+
static PyObject * QStringListToPyObject(const QStringList &list)
converts QStringList to Python tuple
+
static PyObject * convertFromStringRef(const void *inObject, int)
+
static PyObject * createCopyFromMetaType(int type, const void *object)
creates a copy of given object, using the QMetaType
+
static int PyObjGetInt(PyObject *val, bool strict, bool &ok)
get int from py object
+
static PyObject * convertQtValueToPythonInternal(int type, const void *data)
converts the Qt parameter given in data, interpreting it as a type registered qvariant/meta type,...
+
static PythonQtConvertPythonSequenceToQVariantListCB * _pythonSequenceToQVariantListCB
+
static PyObject * QVariantToPyObject(const QVariant &v)
convert QVariant from PyObject
+
static QString PyObjGetRepresentation(PyObject *val)
get string representation of py object
+
static void * castWrapperTo(PythonQtInstanceWrapper *wrapper, const QByteArray &className, bool &ok)
cast wrapper to given className if possible
+
static QHash< int, PythonQtConvertMetaTypeToPythonCB * > _metaTypeToPythonConverters
+
static PyObject * ConvertQtValueToPython(const PythonQtMethodInfo::ParameterInfo &info, const void *data)
converts the Qt parameter given in data, interpreting it as a info parameter, into a Python object,
+
static void registerPythonToMetaTypeConverter(int metaTypeId, PythonQtConvertPythonToMetaTypeCB *cb)
register a converter callback from python to cpp for given metatype
+
static PyObject * convertFromQListOfPythonQtObjectPtr(const void *inObject, int)
+
static PyObject * QVariantListToPyObject(const QVariantList &l)
+
static QStringList PyObjToStringList(PyObject *val, bool strict, bool &ok)
create a string list from python sequence
+
static void registerMetaTypeToPythonConverter(int metaTypeId, PythonQtConvertMetaTypeToPythonCB *cb)
register a converter callback from cpp to python for given metatype
+
static void registerStringViewTypes()
Register QStringView like types, that need to be handled specially.
+
static QByteArray getInnerTemplateTypeName(const QByteArray &typeName)
returns the inner type name of a simple template of the form SomeObject<InnerType>
+
static int getInnerTemplateMetaType(const QByteArray &typeName)
returns the inner type id of a simple template of the form SomeObject<InnerType>
+
static QByteArray getInnerListTypeName(const QByteArray &typeName)
returns the inner type name of a simple template or the typename without appended "List".
+
PyObject * wrapPtr(void *ptr, const QByteArray &name, bool passOwnership=false)
+
PythonQtClassInfo * getClassInfo(const QMetaObject *meta)
get the class info for a meta object (if available)
+
static PythonQtPrivate * priv()
get access to internal data (should not be used on the public API, but is used by some C functions)
Definition PythonQt.h:572
+
const char * typeNameFromMetaTypeId(int metaTypeId)
Returns the type name from a meta type ID.
+
int metaTypeIdFromTypeName(const QByteArray &className)
Returns the meta type ID from a type name.
+
a Python wrapper object for Qt objects and C++ objects (that are themselves wrapped by wrapper QObjec...
+
bool _ownedByPythonQt
flag that stores if the object is owned by pythonQt
+
stores various informations about a parameter/type name
+
+ + + + diff --git a/PythonQtCppWrapperFactory_8h.html b/PythonQtCppWrapperFactory_8h.html new file mode 100644 index 000000000..58180a3ce --- /dev/null +++ b/PythonQtCppWrapperFactory_8h.html @@ -0,0 +1,80 @@ + + + + + + + +PythonQt: PythonQtCppWrapperFactory.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtCppWrapperFactory.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "PythonQtSystem.h"
+#include <QObject>
+#include <QByteArray>
+
+

Go to the source code of this file.

+ + + + + + + +

+Classes

class  PythonQtCppWrapperFactory
 Factory interface for C++ classes that can be wrapped by QObject objects. More...
 
class  PythonQtForeignWrapperFactory
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2006-06
+ +

Definition in file PythonQtCppWrapperFactory.h.

+
+ + + + diff --git a/PythonQtCppWrapperFactory_8h_source.html b/PythonQtCppWrapperFactory_8h_source.html new file mode 100644 index 000000000..6ede564f5 --- /dev/null +++ b/PythonQtCppWrapperFactory_8h_source.html @@ -0,0 +1,146 @@ + + + + + + + +PythonQt: PythonQtCppWrapperFactory.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtCppWrapperFactory.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTCPPWRAPPERFACTORY_H
+
2#define _PYTHONQTCPPWRAPPERFACTORY_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ +
46
+
47#include "PythonQtSystem.h"
+
48#include <QObject>
+
49#include <QByteArray>
+
50
+
52
+
+ +
57{
+ +
59public:
+ + +
62
+
64 virtual QObject* create(const QByteArray& classname, void* ptr) = 0;
+
65};
+
+
66
+
+ +
70{
+ +
72public:
+ + +
75
+
78 virtual PyObject* wrap(const QByteArray& classname, void* ptr) = 0;
+
79
+
82 virtual void* unwrap(const QByteArray& classname, PyObject* object) = 0;
+
83};
+
+
84
+
85#endif
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
struct _object PyObject
+ + +
#define PYTHONQT_EXPORT
+
Factory interface for C++ classes that can be wrapped by QObject objects.
+
virtual QObject * create(const QByteArray &classname, void *ptr)=0
create a wrapper for the given object
+ + + + + +
virtual PyObject * wrap(const QByteArray &classname, void *ptr)=0
+
virtual void * unwrap(const QByteArray &classname, PyObject *object)=0
+
+ + + + diff --git a/PythonQtDoc_8h.html b/PythonQtDoc_8h.html new file mode 100644 index 000000000..5a3104f31 --- /dev/null +++ b/PythonQtDoc_8h.html @@ -0,0 +1,65 @@ + + + + + + + +PythonQt: PythonQtDoc.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+
PythonQtDoc.h File Reference
+
+
+ +

Go to the source code of this file.

+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2006-10
+ +

Definition in file PythonQtDoc.h.

+
+ + + + diff --git a/PythonQtDoc_8h_source.html b/PythonQtDoc_8h_source.html new file mode 100644 index 000000000..0604f80ee --- /dev/null +++ b/PythonQtDoc_8h_source.html @@ -0,0 +1,102 @@ + + + + + + + +PythonQt: PythonQtDoc.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtDoc.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTDOC_H
+
2 #define _PYTHONQTDOC_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+
466
+
469
+
472
+
475
+
+ + + + diff --git a/PythonQtImportFileInterface_8h.html b/PythonQtImportFileInterface_8h.html new file mode 100644 index 000000000..51427364a --- /dev/null +++ b/PythonQtImportFileInterface_8h.html @@ -0,0 +1,77 @@ + + + + + + + +PythonQt: PythonQtImportFileInterface.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtImportFileInterface.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include <QDateTime>
+#include <QString>
+#include <QByteArray>
+
+

Go to the source code of this file.

+ + + + +

+Classes

class  PythonQtImportFileInterface
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2006-05
+ +

Definition in file PythonQtImportFileInterface.h.

+
+ + + + diff --git a/PythonQtImportFileInterface_8h_source.html b/PythonQtImportFileInterface_8h_source.html new file mode 100644 index 000000000..13d8d5f6b --- /dev/null +++ b/PythonQtImportFileInterface_8h_source.html @@ -0,0 +1,141 @@ + + + + + + + +PythonQt: PythonQtImportFileInterface.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtImportFileInterface.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTIMPORTFILEINTERFACE_H
+
2#define _PYTHONQTIMPORTFILEINTERFACE_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ +
46#include <QDateTime>
+
47#include <QString>
+
48#include <QByteArray>
+
49
+
+ +
53{
+ +
55public:
+
56 // get rid of warnings
+ + +
59
+ +
62
+
65 virtual QByteArray readSourceFile(const QString& filename, bool& ok) = 0;
+
66
+
68 virtual bool exists(const QString& filename) = 0;
+
69
+
72 virtual bool isEggArchive(const QString& filename) = 0;
+
73
+ +
76
+
79 virtual bool ignoreUpdatedPythonSourceFiles() { return false; }
+
80
+
83 virtual void importedModule(const QString& /*module*/) {}
+
84};
+
+
85
+
86#endif
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+ + +
virtual QByteArray readSourceFile(const QString &filename, bool &ok)=0
+ +
virtual QByteArray readFileAsBytes(const QString &filename)=0
read the given file as byte array, without doing any linefeed translations
+ + +
virtual bool isEggArchive(const QString &filename)=0
+
virtual QDateTime lastModifiedDate(const QString &filename)=0
get the last modified data of a file
+
virtual void importedModule(const QString &)
+
virtual bool exists(const QString &filename)=0
returns if the file exists
+
+ + + + diff --git a/PythonQtImporter_8h.html b/PythonQtImporter_8h.html new file mode 100644 index 000000000..d7127ec2e --- /dev/null +++ b/PythonQtImporter_8h.html @@ -0,0 +1,87 @@ + + + + + + + +PythonQt: PythonQtImporter.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtImporter.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "compile.h"
+#include "marshal.h"
+#include "osdefs.h"
+#include "structmember.h"
+#include <ctime>
+#include <qobject.h>
+#include <qstring.h>
+
+

Go to the source code of this file.

+ + + + + + + + + + +

+Classes

struct  PythonQtImporter
 defines a python object that stores a Qt slot info More...
 
class  PythonQtImport
 implements importing of python files into PythonQt More...
 
struct  PythonQtImport::ModuleInfo
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
stk
+
Date
2004-06
+ +

Definition in file PythonQtImporter.h.

+
+ + + + diff --git a/PythonQtImporter_8h_source.html b/PythonQtImporter_8h_source.html new file mode 100644 index 000000000..bcf8754fb --- /dev/null +++ b/PythonQtImporter_8h_source.html @@ -0,0 +1,194 @@ + + + + + + + +PythonQt: PythonQtImporter.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtImporter.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTIMPORTER_
+
2#define _PYTHONQTIMPORTER_
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ +
46
+
47#include "compile.h"
+
48#include "marshal.h"
+
49#include "osdefs.h"
+
50#include "structmember.h"
+
51#include <ctime>
+
52
+
53#include <qobject.h>
+
54#include <qstring.h>
+
55
+
+ + + +
60};
+
+
61
+
63
+
+ +
66{
+
67public:
+
68
+ +
70
+ +
77
+
79 static void init();
+
80
+ +
83
+
89 static PyObject* unmarshalCode(const QString& path, const QByteArray& data, time_t mtime);
+
90
+
93 static PyObject* compileSource(const QString& path, const QByteArray& data);
+
94
+
97 static PyObject* getCodeFromData(const QString& path, int isbytecode = 0, int ispackage = 0, time_t mtime = 0);
+
98
+ +
103
+ +
106
+ +
109
+ +
112
+
116 static long getLong(unsigned char* buf);
+
117
+ +
120
+ +
123
+ +
126
+ +
129};
+
+
130
+
131#endif
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
struct _object PyObject
+ +
implements importing of python files into PythonQt
+
static PyObject * getModuleCode(PythonQtImporter *self, const char *fullname, QString &modpath, QString &cachemodpath)
+
static QString getSubName(const QString &str)
get the last name of a dot chain (first.second.last)
+
static QString getSourceFilename(const QString &cacheFile)
Returns the filename of the source file for the given cache file, e.g. test.py for test....
+
static QString getCacheFilename(const QString &sourceFile, bool isOptimizedFilename)
Returns the filename of the cache file for the given source file, e.g. test.pyc for test....
+
static time_t getMTimeOfSource(const QString &path)
get time stamp of file
+
static ModuleInfo getModuleInfo(PythonQtImporter *self, const QString &fullname)
Return if module exists and is a package or a module.
+
static QString replaceExtension(const QString &str, const QString &ext)
replace extension of file
+
static PyObject * compileSource(const QString &path, const QByteArray &data)
+
static PyObject * getCodeFromPyc(const QString &file)
gets the compiled code for the given *.py file if there is a valid pyc file, otherwise compiles the f...
+
static PyObject * getCodeFromData(const QString &path, int isbytecode=0, int ispackage=0, time_t mtime=0)
+
static PyObject * unmarshalCode(const QString &path, const QByteArray &data, time_t mtime)
+
static void writeCompiledModule(PyCodeObject *co, const QString &filename, long mtime, long sourceSize)
writes the python code to disk, marshalling and writing the time stamp
+ + + + + +
static void init()
initialize
+
static long getLong(unsigned char *buf)
+ +
QString moduleName
the module name without the package prefix
+
QString fullPath
the full path to the found file
+ + +
defines a python object that stores a Qt slot info
+
PyObject_HEAD QString * _path
+
+ + + + diff --git a/PythonQtInstanceWrapper_8h.html b/PythonQtInstanceWrapper_8h.html new file mode 100644 index 000000000..294cd264d --- /dev/null +++ b/PythonQtInstanceWrapper_8h.html @@ -0,0 +1,173 @@ + + + + + + + +PythonQt: PythonQtInstanceWrapper.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtInstanceWrapper.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "PythonQtSystem.h"
+#include "PythonQtClassWrapper.h"
+#include <QPointer>
+#include "structmember.h"
+#include "methodobject.h"
+#include "compile.h"
+
+

Go to the source code of this file.

+ + + + + +

+Classes

struct  PythonQtInstanceWrapper
 a Python wrapper object for Qt objects and C++ objects (that are themselves wrapped by wrapper QObjects) More...
 
+ + + + + +

+Functions

int PythonQtInstanceWrapper_init (PythonQtInstanceWrapper *self, PyObject *args, PyObject *kwds)
 
PyObjectPythonQtInstanceWrapper_delete (PythonQtInstanceWrapper *self)
 
+ + + +

+Variables

PYTHONQT_EXPORT PyTypeObject PythonQtInstanceWrapper_Type
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2006-05
+ +

Definition in file PythonQtInstanceWrapper.h.

+

Function Documentation

+ +

◆ PythonQtInstanceWrapper_delete()

+ +
+
+ + + + + + + + +
PyObject * PythonQtInstanceWrapper_delete (PythonQtInstanceWrapperself)
+
+ +
+
+ +

◆ PythonQtInstanceWrapper_init()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
int PythonQtInstanceWrapper_init (PythonQtInstanceWrapperself,
PyObjectargs,
PyObjectkwds 
)
+
+ +
+
+

Variable Documentation

+ +

◆ PythonQtInstanceWrapper_Type

+ +
+
+ + + + + +
+ + + + +
PYTHONQT_EXPORT PyTypeObject PythonQtInstanceWrapper_Type
+
+extern
+
+
+
+ + + + diff --git a/PythonQtInstanceWrapper_8h_source.html b/PythonQtInstanceWrapper_8h_source.html new file mode 100644 index 000000000..89dbefa35 --- /dev/null +++ b/PythonQtInstanceWrapper_8h_source.html @@ -0,0 +1,212 @@ + + + + + + + +PythonQt: PythonQtInstanceWrapper.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtInstanceWrapper.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTINSTANCEWRAPPER_H
+
2#define _PYTHONQTINSTANCEWRAPPER_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ +
46
+
47#include "PythonQtSystem.h"
+ +
49#include <QPointer>
+
50
+
51#include "structmember.h"
+
52#include "methodobject.h"
+
53#include "compile.h"
+
54
+ +
56class QObject;
+
57
+ +
59
+
60//---------------------------------------------------------------
+
+ + +
64
+
66 inline PythonQtClassInfo* classInfo() { return ((PythonQtClassWrapper*)Py_TYPE(this))->_classInfo; }
+
67
+
+ +
69 {
+
70 return ((PythonQtClassWrapper*)Py_TYPE(this))->_dynamicClassInfo;
+
71 }
+
+
72
+
+
74 void setQObject(QObject* object)
+
75 {
+
76 _obj = object;
+
77 _objPointerCopy = object;
+
78 }
+
+
79
+
+ +
82 {
+
83 // we pass the ownership to C++
+
84 _ownedByPythonQt = false;
+
85 // handle shell instance
+
86 if (_isShellInstance) {
+ +
88 // ref count the wrapper, so that the Python part of the shell instance can not go
+
89 // away until the C++ object gets deleted...
+
90 Py_INCREF((PyObject*)this);
+ +
92 }
+
93 }
+
94 }
+
+
95
+
+ +
98 {
+
99 _ownedByPythonQt = true;
+
100 // if the shell instance was owned by C++ and the ownership goes to Python,
+
101 // we need to remove the extra ref count that kept the Python part alive from the C++ side.
+ +
103 Py_DECREF((PyObject*)this);
+ +
105 }
+
106 }
+
+
107
+ + +
113
+ +
116
+
117 // TODO xxx: put booleans into int that holds flags
+
118
+ +
121
+ +
124
+ +
127
+ +
130};
+
+
131
+ +
133
+ +
135
+
136#endif
+ +
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
int PythonQtInstanceWrapper_init(PythonQtInstanceWrapper *self, PyObject *args, PyObject *kwds)
+
PyObject * PythonQtInstanceWrapper_delete(PythonQtInstanceWrapper *self)
+
PYTHONQT_EXPORT PyTypeObject PythonQtInstanceWrapper_Type
+
struct _object PyObject
+ + +
#define PYTHONQT_EXPORT
+
a class that stores all required information about a Qt object (and an optional associated C++ class ...
+ + +
a Python wrapper object for Qt objects and C++ objects (that are themselves wrapped by wrapper QObjec...
+
void * _wrappedPtr
optional C++ object Ptr that is wrapped by the above _obj
+
void passOwnershipToCPP()
Passes the ownership of the wrapped object to C++.
+
bool _shellInstanceRefCountsWrapper
stores if the shell instance (C++) owns the wrapper with its ref count
+
void setQObject(QObject *object)
set the QObject pointer
+
PyObject_HEAD PythonQtClassInfo * classInfo()
the class information, this is set even if the _obj or _wrappedPtr is NULL to support typed NULL poin...
+
bool _ownedByPythonQt
flag that stores if the object is owned by pythonQt
+
bool _useQMetaTypeDestroy
stores that the owned object should be destroyed using QMetaType::destroy()
+ +
PythonQtDynamicClassInfo * dynamicClassInfo()
+
void passOwnershipToPython()
Passes the ownership to Python.
+
bool _isShellInstance
stores if the object is a shell instance
+
QPointer< QObject > _obj
pointer to the wrapped Qt object or if _wrappedPtr is set, the Qt object that wraps the C++ Ptr
+
+ + + + diff --git a/PythonQtMethodInfo_8h.html b/PythonQtMethodInfo_8h.html new file mode 100644 index 000000000..5244d55e0 --- /dev/null +++ b/PythonQtMethodInfo_8h.html @@ -0,0 +1,109 @@ + + + + + + + +PythonQt: PythonQtMethodInfo.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtMethodInfo.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "PythonQtSystem.h"
+#include <QByteArray>
+#include <QHash>
+#include <QList>
+#include <QMetaMethod>
+
+

Go to the source code of this file.

+ + + + + + + + + + + +

+Classes

class  PythonQtMethodInfo
 stores information about a specific signal/slot/method More...
 
struct  PythonQtMethodInfo::ParameterInfo
 stores various informations about a parameter/type name More...
 
class  PythonQtSlotInfo
 stores information about a slot, including a next pointer to overloaded slots More...
 
+ + + +

+Typedefs

typedef struct _object PyObject
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2006-05
+ +

Definition in file PythonQtMethodInfo.h.

+

Typedef Documentation

+ +

◆ PyObject

+ +
+
+ + + + +
typedef struct _object PyObject
+
+ +

Definition at line 55 of file PythonQtMethodInfo.h.

+ +
+
+
+ + + + diff --git a/PythonQtMethodInfo_8h_source.html b/PythonQtMethodInfo_8h_source.html new file mode 100644 index 000000000..7ef9bd344 --- /dev/null +++ b/PythonQtMethodInfo_8h_source.html @@ -0,0 +1,345 @@ + + + + + + + +PythonQt: PythonQtMethodInfo.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtMethodInfo.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTMETHODINFO_H
+
2#define _PYTHONQTMETHODINFO_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ +
46#include "PythonQtSystem.h"
+
47
+
48#include <QByteArray>
+
49#include <QHash>
+
50#include <QList>
+
51#include <QMetaMethod>
+
52
+ +
54struct _object;
+
55typedef struct _object PyObject;
+
56
+
+ +
59{
+
60public:
+
61 enum ParameterType { Unknown = -1, Variant = -2 };
+
62
+
+ + +
66 QByteArray innerName; // if the type is a template, this stores the inner name
+
67 PyObject* enumWrapper; // if it is an enum, a pointer to the enum wrapper
+
68 int typeId; // a mixture from QMetaType and ParameterType
+
69 char pointerCount; // the number of pointer indirections
+
70 char innerNamePointerCount; // the number of pointer indirections in the inner name
+
71 bool isConst;
+ +
73 bool isQList;
+ + + +
77 };
+
+
78
+
79 PythonQtMethodInfo() { _shouldAllowThreads = true; };
+ + +
82 PythonQtMethodInfo(const QByteArray& typeName, const QList<QByteArray>& args);
+
+ +
84 {
+
85 _parameters = other._parameters;
+
86 _shouldAllowThreads = other._shouldAllowThreads;
+
87 }
+
+
88
+
91 static const PythonQtMethodInfo* getCachedMethodInfo(const QMetaMethod& method, PythonQtClassInfo* classInfo);
+
92
+
94 static const PythonQtMethodInfo* getCachedMethodInfoFromArgumentList(int numArgs, const char** args);
+
95
+ +
98
+
100 int parameterCount() const { return _parameters.size(); };
+
101
+
103 static int nameToType(const char* name);
+
104
+
106 const QList<ParameterInfo>& parameters() const { return _parameters; }
+
107
+
109 static void addParameterTypeAlias(const QByteArray& alias, const QByteArray& name);
+
110
+
112 static void fillParameterInfo(ParameterInfo& type, const QByteArray& name, PythonQtClassInfo* classInfo = nullptr);
+
113
+ +
116
+
118 static int getInnerTemplateMetaType(const QByteArray& typeName);
+
119
+ +
122
+ +
125
+
129 bool shouldAllowThreads() const { return _shouldAllowThreads; }
+
130
+
131protected:
+ +
133
+ + +
136
+ +
139
+ +
141
+ + +
144};
+
+
145
+
+ +
148{
+
149public:
+
150 enum Type { MemberSlot, InstanceDecorator, ClassDecorator };
+
151
+
+ + +
154 {
+
155 _meta = info._meta;
+
156 _parameters = info._parameters;
+
157 _shouldAllowThreads = info._shouldAllowThreads;
+
158 _slotIndex = info._slotIndex;
+
159 _next = nullptr;
+
160 _decorator = info._decorator;
+
161 _type = info._type;
+
162 _upcastingOffset = 0;
+
163 }
+
+
164
+
+
165 PythonQtSlotInfo(PythonQtClassInfo* classInfo, const QMetaMethod& meta, int slotIndex, QObject* decorator = nullptr,
+
166 Type type = MemberSlot)
+ +
168 {
+
169 const PythonQtMethodInfo* info = getCachedMethodInfo(meta, classInfo);
+
170 _meta = meta;
+
171 _parameters = info->parameters();
+
172 _shouldAllowThreads = info->shouldAllowThreads();
+
173 _slotIndex = slotIndex;
+
174 _next = nullptr;
+
175 _decorator = decorator;
+
176 _type = type;
+
177 _upcastingOffset = 0;
+
178 }
+
+
179
+
180public:
+ +
183
+ +
185
+
186 const QMetaMethod* metaMethod() const { return &_meta; }
+
187
+
188 void setUpcastingOffset(int upcastingOffset) { _upcastingOffset = upcastingOffset; }
+
189
+
190 int upcastingOffset() const { return _upcastingOffset; }
+
191
+
193 int slotIndex() const { return _slotIndex; }
+
194
+
196 PythonQtSlotInfo* nextInfo() const { return _next; }
+
197
+ +
200
+
202 bool isInstanceDecorator() const { return _decorator != nullptr && _type == InstanceDecorator; }
+
203
+
205 bool isClassDecorator() const { return _decorator != nullptr && _type == ClassDecorator; }
+
206
+
207 QObject* decorator() const { return _decorator; }
+
208
+ +
211
+ +
214
+ +
217
+ +
222
+ +
226
+
228 static void invokeQtMethod(QObject* obj, PythonQtSlotInfo* slot, void** argList);
+
229
+ +
232
+ +
235
+
236private:
+
237 int _slotIndex;
+
238 PythonQtSlotInfo* _next;
+
239 QObject* _decorator;
+
240 Type _type;
+
241 QMetaMethod _meta;
+
242 int _upcastingOffset;
+
243
+
244 static bool _globalShouldAllowThreads;
+
245};
+
+
246
+
247#endif
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
struct _object PyObject
+ + +
#define PYTHONQT_EXPORT
+
a class that stores all required information about a Qt object (and an optional associated C++ class ...
+
stores information about a specific signal/slot/method
+
static const PythonQtMethodInfo * getCachedMethodInfoFromArgumentList(int numArgs, const char **args)
get the cached method info using the passed in list of return value and arguments,...
+
static QByteArray getInnerTemplateTypeName(const QByteArray &typeName)
returns the inner type name of a simple template of the form SomeObject<InnerType>
+
static const PythonQtMethodInfo * getCachedMethodInfo(const QMetaMethod &method, PythonQtClassInfo *classInfo)
+ + +
static void addParameterTypeAlias(const QByteArray &alias, const QByteArray &name)
add an alias for a typename, e.g. QObjectList and QList<QObject*>.
+
static QHash< QByteArray, QByteArray > _parameterNameAliases
+ +
static int getInnerTemplateMetaType(const QByteArray &typeName)
returns the inner type id of a simple template of the form SomeObject<InnerType>
+
static const ParameterInfo & getParameterInfoForMetaType(int type)
returns a parameter info for the given metatype (and creates and caches one if it is not yet present)
+
const QList< ParameterInfo > & parameters() const
get the parameter infos
+
static QHash< QByteArray, int > _parameterTypeDict
+
static QByteArray getInnerListTypeName(const QByteArray &typeName)
returns the inner type name of a simple template or the typename without appended "List".
+
static void cleanupCachedMethodInfos()
cleanup the cache
+
PythonQtMethodInfo(const QByteArray &typeName, const QList< QByteArray > &args)
+
PythonQtMethodInfo(const PythonQtMethodInfo &other)
+
QList< ParameterInfo > _parameters
+
static QHash< int, ParameterInfo > _cachedParameterInfos
+
int parameterCount() const
returns the number of parameters including the return value
+ +
static int nameToType(const char *name)
returns the id for the given type (using an internal dictionary)
+
static void fillParameterInfo(ParameterInfo &type, const QByteArray &name, PythonQtClassInfo *classInfo=nullptr)
fill the parameter info for the given type name
+
static QHash< QByteArray, PythonQtMethodInfo * > _cachedSignatures
stores the cached signatures of methods to speedup mapping from Qt to Python types
+ +
bool shouldAllowThreads() const
+
PythonQtMethodInfo(const QMetaMethod &meta, PythonQtClassInfo *classInfo)
+
stores information about a slot, including a next pointer to overloaded slots
+
PythonQtSlotInfo(PythonQtClassInfo *classInfo, const QMetaMethod &meta, int slotIndex, QObject *decorator=nullptr, Type type=MemberSlot)
+
QByteArray getImplementingClassName() const
+
QStringList overloads(bool skipReturnValue=false) const
+
int slotIndex() const
get the index of the slot (needed for qt_metacall)
+
QString fullSignature(bool skipReturnValue=false, int optionalArgsIndex=-1) const
get the full signature including return type
+
static bool getGlobalShouldAllowThreads()
Returns if calling slots should release the GIL to allow Python threads while being inside of C++.
+ +
QByteArray slotName(bool removeDecorators=false) const
get the short slot name
+
PythonQtSlotInfo * nextInfo() const
get next overloaded slot (which has the same name)
+
QList< ParameterInfo > arguments() const
get the parameter infos for the arguments, without return type and instance decorator.
+
static void invokeQtMethod(QObject *obj, PythonQtSlotInfo *slot, void **argList)
Invoke the given slot on obj, save/restore thread state if needed.
+
bool isInstanceDecorator() const
returns if the slot is a decorator slot
+
void setNextInfo(PythonQtSlotInfo *next)
set the next overloaded slot
+
QByteArray signature() const
get the Qt signature of the slot
+
bool isClassDecorator() const
returns if the slot is a constructor slot
+
static void setGlobalShouldAllowThreads(bool flag)
Sets if calling slots should release the GIL to allow other Python threads while being inside of C++.
+
void setUpcastingOffset(int upcastingOffset)
+
QObject * decorator() const
+
void deleteOverloadsAndThis()
+
PythonQtSlotInfo(const PythonQtSlotInfo &info)
+
const QMetaMethod * metaMethod() const
+
int upcastingOffset() const
+
stores various informations about a parameter/type name
+ + + + + + + + + + + + +
+ + + + diff --git a/PythonQtMisc_8h.html b/PythonQtMisc_8h.html new file mode 100644 index 000000000..e68557750 --- /dev/null +++ b/PythonQtMisc_8h.html @@ -0,0 +1,399 @@ + + + + + + + +PythonQt: PythonQtMisc.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtMisc.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include <vector>
+#include <QVariant>
+
+

Go to the source code of this file.

+ + + + + +

+Classes

class  PythonQtArgumentFrame
 Stores C++ arguments for a qt_metacall (which are created when converting data from Python to C++) More...
 
+ + + + + + + + + + + + + + + +

+Macros

#define PYTHONQT_MAX_ARGS   32
 
#define PythonQtArgumentFrame_ADD_VALUE(store, type, value, ptr)
 
#define PythonQtArgumentFrame_ADD_VALUE_IF_NEEDED(alreadyAllocatedPtr, store, type, value, ptr)
 
#define PythonQtArgumentFrame_ADD_VARIANT_VALUE(store, value, ptr)
 
#define PythonQtArgumentFrame_ADD_VARIANT_VALUE_BY_ID(store, id, ptr)    PythonQtArgumentFrame_ADD_VARIANT_VALUE(store, QVariant::Type(id), ptr)
 
#define PythonQtArgumentFrame_ADD_VARIANT_VALUE_IF_NEEDED(alreadyAllocatedPtr, store, value, ptr)
 
#define PythonQtArgumentFrame_ADD_VARIANT_VALUE_BY_ID_IF_NEEDED(alreadyAllocatedPtr, store, id, ptr)    PythonQtArgumentFrame_ADD_VARIANT_VALUE_IF_NEEDED(alreadyAllocatedPtr, store, QVariant::Type(id), ptr)
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2006-05
+ +

Definition in file PythonQtMisc.h.

+

Macro Definition Documentation

+ +

◆ PYTHONQT_MAX_ARGS

+ +
+
+ + + + +
#define PYTHONQT_MAX_ARGS   32
+
+ +

Definition at line 49 of file PythonQtMisc.h.

+ +
+
+ +

◆ PythonQtArgumentFrame_ADD_VALUE

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define PythonQtArgumentFrame_ADD_VALUE( store,
 type,
 value,
 ptr 
)
+
+Value:
{ \
+
type* item = (type*)store->nextPODPtr(); \
+
*item = value; \
+
ptr = (void*)item; \
+
}
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
+

Definition at line 51 of file PythonQtMisc.h.

+
52 { \
+
53 type* item = (type*)store->nextPODPtr(); \
+
54 *item = value; \
+
55 ptr = (void*)item; \
+
56 }
+
+
+
+ +

◆ PythonQtArgumentFrame_ADD_VALUE_IF_NEEDED

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define PythonQtArgumentFrame_ADD_VALUE_IF_NEEDED( alreadyAllocatedPtr,
 store,
 type,
 value,
 ptr 
)
+
+Value:
{ \
+
type* item = (type*)(alreadyAllocatedPtr ? alreadyAllocatedPtr : store->nextPODPtr()); \
+
*item = value; \
+
ptr = (void*)item; \
+
}
+
+

Definition at line 58 of file PythonQtMisc.h.

+
59 { \
+
60 type* item = (type*)(alreadyAllocatedPtr ? alreadyAllocatedPtr : store->nextPODPtr()); \
+
61 *item = value; \
+
62 ptr = (void*)item; \
+
63 }
+
+
+
+ +

◆ PythonQtArgumentFrame_ADD_VARIANT_VALUE

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define PythonQtArgumentFrame_ADD_VARIANT_VALUE( store,
 value,
 ptr 
)
+
+Value:
{ \
+
QVariant* item = store->nextVariantPtr(); \
+
*item = value; \
+
ptr = (void*)item; \
+
}
+
+

Definition at line 65 of file PythonQtMisc.h.

+
66 { \
+
67 QVariant* item = store->nextVariantPtr(); \
+
68 *item = value; \
+
69 ptr = (void*)item; \
+
70 }
+
+
+
+ +

◆ PythonQtArgumentFrame_ADD_VARIANT_VALUE_BY_ID

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define PythonQtArgumentFrame_ADD_VARIANT_VALUE_BY_ID( store,
 id,
 ptr 
)    PythonQtArgumentFrame_ADD_VARIANT_VALUE(store, QVariant::Type(id), ptr)
+
+ +

Definition at line 79 of file PythonQtMisc.h.

+ +
+
+ +

◆ PythonQtArgumentFrame_ADD_VARIANT_VALUE_BY_ID_IF_NEEDED

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define PythonQtArgumentFrame_ADD_VARIANT_VALUE_BY_ID_IF_NEEDED( alreadyAllocatedPtr,
 store,
 id,
 ptr 
)    PythonQtArgumentFrame_ADD_VARIANT_VALUE_IF_NEEDED(alreadyAllocatedPtr, store, QVariant::Type(id), ptr)
+
+ +

Definition at line 98 of file PythonQtMisc.h.

+ +
+
+ +

◆ PythonQtArgumentFrame_ADD_VARIANT_VALUE_IF_NEEDED

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#define PythonQtArgumentFrame_ADD_VARIANT_VALUE_IF_NEEDED( alreadyAllocatedPtr,
 store,
 value,
 ptr 
)
+
+Value:
{ \
+ +
*item = value; \
+
ptr = (void*)item; \
+
}
+
+

Definition at line 84 of file PythonQtMisc.h.

+
85 { \
+ +
87 *item = value; \
+
88 ptr = (void*)item; \
+
89 }
+
+
+
+
+ + + + diff --git a/PythonQtMisc_8h_source.html b/PythonQtMisc_8h_source.html new file mode 100644 index 000000000..c70b0f694 --- /dev/null +++ b/PythonQtMisc_8h_source.html @@ -0,0 +1,241 @@ + + + + + + + +PythonQt: PythonQtMisc.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtMisc.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTMISC_H
+
2#define _PYTHONQTMISC_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ +
46#include <vector>
+
47#include <QVariant>
+
48
+
49#define PYTHONQT_MAX_ARGS 32
+
50
+
+
51#define PythonQtArgumentFrame_ADD_VALUE(store, type, value, ptr) \
+
52 { \
+
53 type* item = (type*)store->nextPODPtr(); \
+
54 *item = value; \
+
55 ptr = (void*)item; \
+
56 }
+
+
57
+
+
58#define PythonQtArgumentFrame_ADD_VALUE_IF_NEEDED(alreadyAllocatedPtr, store, type, value, ptr) \
+
59 { \
+
60 type* item = (type*)(alreadyAllocatedPtr ? alreadyAllocatedPtr : store->nextPODPtr()); \
+
61 *item = value; \
+
62 ptr = (void*)item; \
+
63 }
+
+
64
+
+
65#define PythonQtArgumentFrame_ADD_VARIANT_VALUE(store, value, ptr) \
+
66 { \
+
67 QVariant* item = store->nextVariantPtr(); \
+
68 *item = value; \
+
69 ptr = (void*)item; \
+
70 }
+
+
71
+
72#if QT_VERSION >= 0x060000
+
73
+
74 #define PythonQtArgumentFrame_ADD_VARIANT_VALUE_BY_ID(store, id, ptr) \
+
75 PythonQtArgumentFrame_ADD_VARIANT_VALUE(store, QVariant(QMetaType(id)), ptr)
+
76
+
77#else
+
78
+
+
79 #define PythonQtArgumentFrame_ADD_VARIANT_VALUE_BY_ID(store, id, ptr) \
+
80 PythonQtArgumentFrame_ADD_VARIANT_VALUE(store, QVariant::Type(id), ptr)
+
+
81
+
82#endif
+
83
+
+
84#define PythonQtArgumentFrame_ADD_VARIANT_VALUE_IF_NEEDED(alreadyAllocatedPtr, store, value, ptr) \
+
85 { \
+
86 QVariant* item = (QVariant*)(alreadyAllocatedPtr ? alreadyAllocatedPtr : store->nextVariantPtr()); \
+
87 *item = value; \
+
88 ptr = (void*)item; \
+
89 }
+
+
90
+
91#if QT_VERSION >= 0x060000
+
92
+
93 #define PythonQtArgumentFrame_ADD_VARIANT_VALUE_BY_ID_IF_NEEDED(alreadyAllocatedPtr, store, id, ptr) \
+
94 PythonQtArgumentFrame_ADD_VARIANT_VALUE_IF_NEEDED(alreadyAllocatedPtr, store, QVariant(QMetaType(id)), ptr)
+
95
+
96#else
+
97
+
+
98 #define PythonQtArgumentFrame_ADD_VARIANT_VALUE_BY_ID_IF_NEEDED(alreadyAllocatedPtr, store, id, ptr) \
+
99 PythonQtArgumentFrame_ADD_VARIANT_VALUE_IF_NEEDED(alreadyAllocatedPtr, store, QVariant::Type(id), ptr)
+
+
100
+
101#endif
+
102
+
+ +
105{
+
106
+
107public:
+ + +
112
+
114 static void cleanupFreeList();
+
115
+
117 void reset();
+
118
+ + +
123
+
124 template<typename Class>
+
+ +
126 {
+ +
128 *reinterpret_cast<Class*>(alreadyAllocatedPtr) = value;
+
129 return alreadyAllocatedPtr;
+
130 } else {
+ +
132 *item = QVariant(value);
+
133 return const_cast<void*>(item->constData());
+
134 }
+
135 }
+
+
136
+
137 template<typename Class, typename ViewClass>
+
+ +
139 {
+ + + +
143 *reinterpret_cast<ViewClass*>(alreadyAllocatedPtr) =
+
144 ViewClass(*reinterpret_cast<const Class*>(itemStore->constData()));
+
145 return alreadyAllocatedPtr;
+
146 } else {
+ +
148 *item = QVariant::fromValue(ViewClass(*reinterpret_cast<const Class*>(itemStore->constData())));
+
149 return const_cast<void*>(item->constData());
+
150 }
+
151 }
+
+
152
+
153private:
+ + +
156
+
157 std::vector<quint64> _podArgs;
+
158 std::vector<QVariant> _variantArgs;
+
159
+
160 PythonQtArgumentFrame* _freeListNext;
+
161
+
162 static PythonQtArgumentFrame* _freeListHead;
+
163};
+
+
164
+
165#endif
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+ +
Stores C++ arguments for a qt_metacall (which are created when converting data from Python to C++)
+
QVariant * nextVariantPtr()
Get next pointer to a variant.
+
quint64 * nextPODPtr()
Get next pointer to a POD.
+
void * establishPersistentPtr(void *alreadyAllocatedPtr, const Class &value)
+
static void deleteFrame(PythonQtArgumentFrame *frame)
Frees the frame (resetting it and putting it back to the freelist)
+
static PythonQtArgumentFrame * newFrame()
Create a new (empty) frame (which is typically reused from a freelist)
+
static void cleanupFreeList()
Frees all PythonQtArgumentFrame frames that are stored.
+
void reset()
Resets the pod and variant argument lists to empty lists.
+
void * establishPersistentViewPtr(void *alreadyAllocatedPtr, const Class &value)
+
+ + + + diff --git a/PythonQtObjectPtr_8h.html b/PythonQtObjectPtr_8h.html new file mode 100644 index 000000000..66c18cd92 --- /dev/null +++ b/PythonQtObjectPtr_8h.html @@ -0,0 +1,83 @@ + + + + + + + +PythonQt: PythonQtObjectPtr.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtObjectPtr.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "PythonQtSystem.h"
+#include "PythonQtThreadSupport.h"
+#include <QVariant>
+#include <QVariantList>
+#include <QVariantMap>
+
+

Go to the source code of this file.

+ + + + + + + + +

+Classes

class  PythonQtObjectPtr
 a smart pointer that stores a PyObject pointer and that handles reference counting automatically More...
 
class  PythonQtSafeObjectPtr
 a smart pointer that stores a PyObject pointer and that handles reference counting automatically More...
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2006-05
+ +

Definition in file PythonQtObjectPtr.h.

+
+ + + + diff --git a/PythonQtObjectPtr_8h_source.html b/PythonQtObjectPtr_8h_source.html new file mode 100644 index 000000000..e7fa178b7 --- /dev/null +++ b/PythonQtObjectPtr_8h_source.html @@ -0,0 +1,451 @@ + + + + + + + +PythonQt: PythonQtObjectPtr.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtObjectPtr.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTOBJECTPTR_H
+
2#define _PYTHONQTOBJECTPTR_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ +
46
+
47#include "PythonQtSystem.h"
+ +
49#include <QVariant>
+
50#include <QVariantList>
+
51#include <QVariantMap>
+
52
+ +
54
+
+ +
57{
+
58public:
+
+ +
60 : _object(nullptr)
+
61 {
+
62 }
+
+
63
+
+ +
65 : _object(nullptr)
+
66 {
+
67 setObject(p.object());
+
68 }
+
+
69
+
+ +
72 : _object(p.takeObject())
+
73 {
+
74 }
+
+
75
+ +
78
+
+ +
81 : _object(nullptr)
+
82 {
+
83 fromVariant(variant);
+
84 }
+
+
85
+ +
87
+ +
89
+ +
92
+ +
95
+ +
98
+
+ +
100 {
+
101 setObject(p.object());
+
102 return *this;
+
103 }
+
+
104
+
+ +
107 {
+
108 if (_object) {
+
109 setObject(nullptr);
+
110 }
+
111 _object = p.takeObject();
+
112 return *this;
+
113 }
+
+
114
+ +
117
+
+ +
119 {
+
120 setObject(o);
+
121 return *this;
+
122 }
+
+
123
+
+ +
125 {
+
126 fromVariant(variant);
+
127 return *this;
+
128 }
+
+
129
+
130 bool operator==(const PythonQtObjectPtr& p) const { return object() == p.object(); }
+
131
+
132 bool operator!=(const PythonQtObjectPtr& p) const { return !(*this == p); }
+
133
+
134 bool operator==(PyObject* p) const { return object() == p; }
+
135
+
136 bool operator!=(PyObject* p) const { return object() != p; }
+
137
+
138 bool isNull() const { return !object(); }
+
139
+
140 PyObject* operator->() const { return object(); }
+
141
+
142 PyObject& operator*() const { return *(object()); }
+
143
+
144 operator PyObject*() const { return object(); }
+
145
+ +
148
+
149 PyObject* object() const { return _object; }
+
150
+ +
153
+ +
157
+ +
160
+
162 void addObject(const QString& name, QObject* object);
+
163
+
165 void addVariable(const QString& name, const QVariant& v);
+
166
+
168 void removeVariable(const QString& name);
+
169
+ +
172
+ +
175 const QVariantMap& kwargs = QVariantMap());
+
176
+ +
179
+
+ +
183 {
+
184 PyObject* o = _object;
+
185 _object = nullptr;
+
186 return o;
+
187 }
+
+
188
+
189protected:
+
190
+ +
192
+
193private:
+
194 PyObject* _object;
+
195};
+
+
196
+
+ +
199{
+
200public:
+
+ +
202 : _object(nullptr)
+
203 {
+
204 }
+
+
205
+
+ +
207 : _object(nullptr)
+
208 {
+
209 setObject(p.object());
+
210 }
+
+
211
+
+ +
213 : _object(nullptr)
+
214 {
+
215 setObject(p.object());
+
216 }
+
+
217
+
+ +
220 : _object(p._object)
+
221 {
+
222 p._object = nullptr;
+
223 }
+
+
224
+
+ +
227 : _object(p.takeObject())
+
228 {
+
229 }
+
+
230
+ +
232
+ +
234
+
+ +
236 {
+
237 setObject(p.object());
+
238 return *this;
+
239 }
+
+
240
+
+ +
242 {
+
243 setObjectUnsafe(p.object());
+
244 return *this;
+
245 }
+
+
246
+
+ +
249 {
+
250 if (_object) {
+
251 setObject(nullptr);
+
252 }
+
253 _object = p._object;
+
254 p._object = nullptr;
+
255 return *this;
+
256 }
+
+
257
+
+ +
260 {
+
261 if (_object) {
+
262 setObjectUnsafe(nullptr);
+
263 }
+
264 _object = p.takeObject();
+
265 return *this;
+
266 }
+
+
267
+
+ +
269 {
+
270 setObject(o);
+
271 return *this;
+
272 }
+
+
273
+
274 bool operator==(const PythonQtSafeObjectPtr& p) const { return object() == p.object(); }
+
275
+
276 bool operator!=(const PythonQtSafeObjectPtr& p) const { return !(*this == p); }
+
277
+
278 bool operator==(PyObject* p) const { return object() == p; }
+
279
+
280 bool operator!=(PyObject* p) const { return object() != p; }
+
281
+
282 bool isNull() const { return !object(); }
+
283
+
284 PyObject* operator->() const { return object(); }
+
285
+
286 PyObject& operator*() const { return *(object()); }
+
287
+
288 operator PyObject*() const { return object(); }
+
289
+
290 PyObject* object() const { return _object; }
+
291
+
+ +
295 {
+
296 PyObject* o = _object;
+
297 _object = nullptr;
+
298 return o;
+
299 }
+
+
300
+
301protected:
+ + +
304
+
305private:
+
306 PyObject* _object;
+
307};
+
+
308
+
309// We don't want QVariant to take PythonQtObjectPtr via QVariant::fromValue, because it is unsafe when using multi-threading/GIL
+
310// A QVariant can still be obtained with PythonQtObjectPtr::toLocalVariant().
+
311//Q_DECLARE_METATYPE(PythonQtObjectPtr)
+
312
+
313// register PythonQtSafeObjectPtr to the meta type system
+ +
315
+
316#endif
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
struct _object PyObject
+ + +
#define PYTHONQT_EXPORT
+ +
a smart pointer that stores a PyObject pointer and that handles reference counting automatically
+
PyObject * operator->() const
+
QVariant call(const QVariantList &args=QVariantList(), const QVariantMap &kwargs=QVariantMap())
call the contained python object directly, returns the result converted to a QVariant
+
PythonQtObjectPtr & operator=(const PythonQtObjectPtr &p)
+
PythonQtObjectPtr(PythonQtObjectPtr &&p) noexcept
rvalue copy constructor, does not need any incref/decref.
+
void setObject(PyObject *o)
+
void addVariable(const QString &name, const QVariant &v)
add the given variable to the module
+
PythonQtObjectPtr & operator=(PyObject *o)
+
void evalFile(const QString &filename)
evaluates the given code in the context
+
PythonQtObjectPtr & operator=(const QVariant &variant)
+ +
PythonQtObjectPtr(PyObject *o)
+
PythonQtObjectPtr(const PythonQtObjectPtr &p)
+
PythonQtObjectPtr(PythonQtSafeObjectPtr &&p)
rvalue copy constructor, does not need any incref/decref.
+
PyObject & operator*() const
+
QVariant toLocalVariant()
Returns a PythonQtObjectPtr as a QVariant. Only use this when you know that the variant is only used ...
+
PythonQtObjectPtr & operator=(PythonQtObjectPtr &&p) noexcept
rvalue assignment operator that steals the reference from p
+ +
bool operator==(PyObject *p) const
+
PythonQtObjectPtr & operator=(PythonQtSafeObjectPtr &&p)
rvalue assignment operator that steals the reference from p
+ +
QVariant evalScript(const QString &script, int start=Py_file_input)
evaluates the given script code in the context of this object and returns the result value
+
void removeVariable(const QString &name)
remove the given variable
+
PythonQtObjectPtr(const QVariant &variant)
If the given variant holds a PythonQtObjectPtr, extract the value from it and hold onto the reference...
+
bool operator!=(PyObject *p) const
+
bool operator!=(const PythonQtObjectPtr &p) const
+
QVariant toVariant()
Returns a PythonQtSafeObjectPtr as a QVariant. It does not return a PythonQtObjectPtr,...
+
void addObject(const QString &name, QObject *object)
add the given object to the module as a variable with name (it can be removed via clearVariable)
+
bool fromVariant(const QVariant &variant)
If the given variant holds a PythonQtObjectPtr, extract the value from it and hold onto the reference...
+
QVariant getVariable(const QString &name)
get the variable with the name of the module, returns an invalid QVariant on error
+
PyObject * object() const
+
QVariant call(const QString &callable, const QVariantList &args=QVariantList(), const QVariantMap &kwargs=QVariantMap())
call the given python object (in the scope of the current object), returns the result converted to a ...
+
bool operator==(const PythonQtObjectPtr &p) const
+
QVariant evalCode(PyObject *pycode)
+
void setNewRef(PyObject *o)
sets the object and passes the ownership (stealing the reference, in Python slang)
+ +
a smart pointer that stores a PyObject pointer and that handles reference counting automatically
+
void setObject(PyObject *o)
+
PythonQtSafeObjectPtr & operator=(PythonQtSafeObjectPtr &&p) noexcept
rvalue assignment operator that steals the reference from p
+
PyObject * operator->() const
+
void setObjectUnsafe(PyObject *o)
+
PythonQtSafeObjectPtr(PythonQtSafeObjectPtr &&p) noexcept
rvalue copy constructor, does not need any incref/decref.
+
PythonQtSafeObjectPtr(const PythonQtSafeObjectPtr &p)
+ +
PythonQtSafeObjectPtr & operator=(const PythonQtObjectPtr &p)
+
bool operator!=(PyObject *p) const
+ + +
PythonQtSafeObjectPtr(PyObject *o)
+
PythonQtSafeObjectPtr(PythonQtObjectPtr &&p)
rvalue copy constructor, does not need any incref/decref.
+
PyObject * object() const
+
PyObject & operator*() const
+
bool operator==(PyObject *p) const
+
PythonQtSafeObjectPtr(const PythonQtObjectPtr &p)
+
PythonQtSafeObjectPtr & operator=(PythonQtObjectPtr &&p)
rvalue assignment operator that steals the reference from p
+ +
PythonQtSafeObjectPtr & operator=(PyObject *o)
+
PythonQtSafeObjectPtr & operator=(const PythonQtSafeObjectPtr &p)
+
bool operator!=(const PythonQtSafeObjectPtr &p) const
+
bool operator==(const PythonQtSafeObjectPtr &p) const
+
+ + + + diff --git a/PythonQtProperty_8h.html b/PythonQtProperty_8h.html new file mode 100644 index 000000000..5213cb00b --- /dev/null +++ b/PythonQtProperty_8h.html @@ -0,0 +1,128 @@ + + + + + + + +PythonQt: PythonQtProperty.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtProperty.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "PythonQtSystem.h"
+#include <QByteArray>
+#include <QList>
+#include <structmember.h>
+
+

Go to the source code of this file.

+ + + + + + +

+Classes

struct  PythonQtPropertyData
 
struct  PythonQtProperty
 
+ + + +

+Macros

#define PythonQtProperty_Check(op)   (Py_TYPE(op) == &PythonQtProperty_Type)
 
+ + + +

+Variables

PYTHONQT_EXPORT PyTypeObject PythonQtProperty_Type
 
+

Macro Definition Documentation

+ +

◆ PythonQtProperty_Check

+ +
+
+ + + + + + + + +
#define PythonQtProperty_Check( op)   (Py_TYPE(op) == &PythonQtProperty_Type)
+
+ +

Definition at line 44 of file PythonQtProperty.h.

+ +
+
+

Variable Documentation

+ +

◆ PythonQtProperty_Type

+ +
+
+ + + + + +
+ + + + +
PYTHONQT_EXPORT PyTypeObject PythonQtProperty_Type
+
+extern
+
+ +
+
+
+ + + + diff --git a/PythonQtProperty_8h_source.html b/PythonQtProperty_8h_source.html new file mode 100644 index 000000000..4ae012c20 --- /dev/null +++ b/PythonQtProperty_8h_source.html @@ -0,0 +1,180 @@ + + + + + + + +PythonQt: PythonQtProperty.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtProperty.h
+
+
+Go to the documentation of this file.
1#pragma once
+
2
+
3/*
+
4*
+
5* Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
6*
+
7* This library is free software; you can redistribute it and/or
+
8* modify it under the terms of the GNU Lesser General Public
+
9* License as published by the Free Software Foundation; either
+
10* version 2.1 of the License, or (at your option) any later version.
+
11*
+
12* This library is distributed in the hope that it will be useful,
+
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
+
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
15* Lesser General Public License for more details.
+
16*
+
17* Further, this software is distributed without any warranty that it is
+
18* free of the rightful claim of any third person regarding infringement
+
19* or the like. Any license provided herein, whether implied or
+
20* otherwise, applies only to this software file. Patent licenses, if
+
21* any, provided herein do not apply to combinations of this program with
+
22* other software, or any other product whatsoever.
+
23*
+
24* You should have received a copy of the GNU Lesser General Public
+
25* License along with this library; if not, write to the Free Software
+
26* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
27*
+
28* Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
29* 28359 Bremen, Germany or:
+
30*
+
31* http://www.mevis.de
+
32*
+
33*/
+
34
+ +
36#include "PythonQtSystem.h"
+
37#include <QByteArray>
+
38#include <QList>
+
39
+
40#include <structmember.h>
+
41
+ +
43
+
44#define PythonQtProperty_Check(op) (Py_TYPE(op) == &PythonQtProperty_Type)
+
45
+
+ +
+ +
48 {
+
49 fget = nullptr;
+
50 fset = nullptr;
+
51 fdel = nullptr;
+
52 freset = nullptr;
+
53 notify = nullptr;
+
54 doc = nullptr;
+
55 designable = true;
+
56 scriptable = true;
+
57 stored = true;
+
58 user = false;
+
59 constant = false;
+
60 final = false;
+
61 }
+
+
62
+ +
66
+ +
70
+ +
73
+ +
75
+ + + + + + +
82
+ + +
85 bool stored;
+
86 bool user;
+ +
88 bool final;
+
89};
+
+
90
+ +
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
struct _object PyObject
+
PYTHONQT_EXPORT PyTypeObject PythonQtProperty_Type
+ + +
#define PYTHONQT_EXPORT
+ + +
bool callSetter(PyObject *wrapper, PyObject *newValue)
+ + +
PyObject * callGetter(PyObject *wrapper)
+ + +
bool callReset(PyObject *wrapper)
Call the freset method in Python, bound to the wrapper object.
+ + + + + + + + + +
PyObject_HEAD PythonQtPropertyData * data
+
+ + + + diff --git a/PythonQtPythonInclude_8h.html b/PythonQtPythonInclude_8h.html new file mode 100644 index 000000000..a857b2af6 --- /dev/null +++ b/PythonQtPythonInclude_8h.html @@ -0,0 +1,58 @@ + + + + + + + +PythonQt: PythonQtPythonInclude.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+
PythonQtPythonInclude.h File Reference
+
+
+
#include <Python.h>
+
+

Go to the source code of this file.

+
+ + + + diff --git a/PythonQtPythonInclude_8h_source.html b/PythonQtPythonInclude_8h_source.html new file mode 100644 index 000000000..419e24518 --- /dev/null +++ b/PythonQtPythonInclude_8h_source.html @@ -0,0 +1,205 @@ + + + + + + + +PythonQt: PythonQtPythonInclude.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtPythonInclude.h
+
+
+Go to the documentation of this file.
1/*
+
2 *
+
3 * Copyright (C) 2011 MeVis Medical Solutions AG All Rights Reserved.
+
4 *
+
5 * This library is free software; you can redistribute it and/or
+
6 * modify it under the terms of the GNU Lesser General Public
+
7 * License as published by the Free Software Foundation; either
+
8 * version 2.1 of the License, or (at your option) any later version.
+
9 *
+
10 * This library is distributed in the hope that it will be useful,
+
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
13 * Lesser General Public License for more details.
+
14 *
+
15 * Further, this software is distributed without any warranty that it is
+
16 * free of the rightful claim of any third person regarding infringement
+
17 * or the like. Any license provided herein, whether implied or
+
18 * otherwise, applies only to this software file. Patent licenses, if
+
19 * any, provided herein do not apply to combinations of this program with
+
20 * other software, or any other product whatsoever.
+
21 *
+
22 * You should have received a copy of the GNU Lesser General Public
+
23 * License along with this library; if not, write to the Free Software
+
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
25 *
+
26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
27 * 28359 Bremen, Germany or:
+
28 *
+
29 * http://www.mevis.de
+
30 *
+
31 */
+
32
+
33#ifndef __PythonQtPythonInclude_h
+
34#define __PythonQtPythonInclude_h
+
35
+
36// Undefine macros that features.h defines to avoid redefinition warning
+
37#ifdef _POSIX_C_SOURCE
+
38 #undef _POSIX_C_SOURCE
+
39#endif
+
40
+
41#ifdef _XOPEN_SOURCE
+
42 #undef _XOPEN_SOURCE
+
43#endif
+
44
+
45// Undefine Qt keywords that conflict with Python headers
+
46#ifdef slots
+
47 #undef slots
+
48 #define PYTHONQT_RESTORE_KEYWORDS
+
49#endif
+
50
+
51//From https://github.com/boostorg/python/pull/253
+
52// Python.h defines a macro with hypot name, what breaks libstdc++ math header
+
53// that it tries to include afterwards.
+
54#if defined(__MINGW32__)
+
55 #include <cmath>
+
56 #include <math.h>
+
57#endif
+
58
+
59//
+
60// Use the real python debugging library if it is provided.
+
61// Otherwise use the "documented" trick involving checking for _DEBUG
+
62// and undefined that symbol while we include Python headers.
+
63// Update: this method does not fool Microsoft Visual C++ 8 anymore; two
+
64// of its header files (crtdefs.h and use_ansi.h) check if _DEBUG was set
+
65// or not, and set flags accordingly (_CRT_MANIFEST_RETAIL,
+
66// _CRT_MANIFEST_DEBUG, _CRT_MANIFEST_INCONSISTENT). The next time the
+
67// check is performed in the same compilation unit, and the flags are found,
+
68// and error is triggered. Let's prevent that by setting _CRT_NOFORCE_MANIFEST.
+
69//
+
70
+
71// If PYTHONQT_USE_RELEASE_PYTHON_FALLBACK is enabled, try to link
+
72// release Python DLL if it is available by undefining _DEBUG while
+
73// including Python.h
+
74#if defined(PYTHONQT_USE_RELEASE_PYTHON_FALLBACK) && defined(_DEBUG)
+
75 #define PYTHONQT_UNDEF_DEBUG
+
76 // Include these low level headers before undefing _DEBUG. Otherwise when doing
+
77 // a debug build against a release build of python the compiler will end up
+
78 // including these low level headers without DEBUG enabled, causing it to try
+
79 // and link release versions of this low level C api.
+
80 #include <basetsd.h>
+
81 #include <assert.h>
+
82 #include <ctype.h>
+
83 #include <errno.h>
+
84 #include <io.h>
+
85 #include <math.h>
+
86 #include <sal.h>
+
87 #include <stdarg.h>
+
88 #include <stddef.h>
+
89 #include <stdio.h>
+
90 #include <stdlib.h>
+
91 #include <string.h>
+
92 #include <sys/stat.h>
+
93 #include <time.h>
+
94 #include <wchar.h>
+
95 #undef _DEBUG
+
96 #if defined(_MSC_VER) && _MSC_VER >= 1400
+
97 #define _CRT_NOFORCE_MANIFEST 1
+
98 #define _STL_NOFORCE_MANIFEST 1
+
99 #endif
+
100#endif
+
101
+
102#include <Python.h>
+
103
+
104#ifdef PYTHONQT_UNDEF_DEBUG
+
105 #define _DEBUG
+
106#endif
+
107
+
108// By including Python.h on Linux truncate could have been defined (in unistd.h)
+
109// which would lead to compiler errors. Therefore:
+
110#ifdef truncate
+
111 #undef truncate
+
112#endif
+
113
+
114// get Qt keywords back
+
115#ifdef PYTHONQT_RESTORE_KEYWORDS
+
116 #define slots Q_SLOTS
+
117 #undef PYTHONQT_RESTORE_KEYWORDS
+
118#endif
+
119
+
120#if PY_MAJOR_VERSION < 3
+
121 #error "PythonQt requires Python >= 3.x"
+
122#endif
+
123
+
124// Optional compatibility shim for legacy wrappers generated by older PythonQt.
+
125// Enable by defining PYTHONQT_USE_PYSTRING_SHIM (deprecated).
+
126#if defined(PYTHONQT_USE_PYSTRING_SHIM)
+
127 #define PY3K
+
128 #define PyString_FromString PyUnicode_FromString
+
129#endif
+
130
+
131// Avoid clashes with libstdc++ <locale> by undefining ctype macros
+
132// that CPython may introduce on macOS when the UTF-8 ctype quirk is enabled.
+
133// (_PY_PORT_CTYPE_UTF8_ISSUE is defined by CPython’s pyport.h; we apply these
+
134// undefs only in C++ builds.)
+
135#if defined(_PY_PORT_CTYPE_UTF8_ISSUE) && defined(__cplusplus)
+
136 #undef isalnum
+
137 #undef isalpha
+
138 #undef islower
+
139 #undef isspace
+
140 #undef isupper
+
141 #undef tolower
+
142 #undef toupper
+
143#endif
+
144
+
145#endif
+
+ + + + diff --git a/PythonQtQFileImporter_8h.html b/PythonQtQFileImporter_8h.html new file mode 100644 index 000000000..1d7b03823 --- /dev/null +++ b/PythonQtQFileImporter_8h.html @@ -0,0 +1,76 @@ + + + + + + + +PythonQt: PythonQtQFileImporter.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtQFileImporter.h File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Classes

class  PythonQtQFileImporter
 default importer implementation using QFile to load python code More...
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2009-03
+ +

Definition in file PythonQtQFileImporter.h.

+
+ + + + diff --git a/PythonQtQFileImporter_8h_source.html b/PythonQtQFileImporter_8h_source.html new file mode 100644 index 000000000..c0887f919 --- /dev/null +++ b/PythonQtQFileImporter_8h_source.html @@ -0,0 +1,132 @@ + + + + + + + +PythonQt: PythonQtQFileImporter.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtQFileImporter.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTQFILEIMPORTER_H
+
2#define _PYTHONQTQFILEIMPORTER_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ + +
47
+
+ +
50{
+
51public:
+ + +
54
+ +
56
+
57 QByteArray readSourceFile(const QString& filename, bool& ok) override;
+
58
+
59 bool exists(const QString& filename) override;
+
60 bool isEggArchive(const QString& filename) override;
+
61
+ +
63};
+
+
64
+
65#endif
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+ + + +
default importer implementation using QFile to load python code
+ +
bool isEggArchive(const QString &filename) override
+
QByteArray readSourceFile(const QString &filename, bool &ok) override
+
~PythonQtQFileImporter() override
+
bool exists(const QString &filename) override
returns if the file exists
+
QDateTime lastModifiedDate(const QString &filename) override
get the last modified data of a file
+
QByteArray readFileAsBytes(const QString &filename) override
read the given file as byte array, without doing any linefeed translations
+
+ + + + diff --git a/PythonQtSignalReceiver_8h.html b/PythonQtSignalReceiver_8h.html new file mode 100644 index 000000000..d65764e95 --- /dev/null +++ b/PythonQtSignalReceiver_8h.html @@ -0,0 +1,83 @@ + + + + + + + +PythonQt: PythonQtSignalReceiver.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtSignalReceiver.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "PythonQtSystem.h"
+#include "PythonQtObjectPtr.h"
+
+

Go to the source code of this file.

+ + + + + + + + + + + +

+Classes

class  PythonQtSignalTarget
 stores information about a signal target More...
 
class  PythonQtSignalReceiverBase
 base class for signal receivers More...
 
class  PythonQtSignalReceiver
 receives all signals for one QObject More...
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2006-05
+ +

Definition in file PythonQtSignalReceiver.h.

+
+ + + + diff --git a/PythonQtSignalReceiver_8h_source.html b/PythonQtSignalReceiver_8h_source.html new file mode 100644 index 000000000..6bf1d0d8a --- /dev/null +++ b/PythonQtSignalReceiver_8h_source.html @@ -0,0 +1,224 @@ + + + + + + + +PythonQt: PythonQtSignalReceiver.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtSignalReceiver.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTSIGNALRECEIVER_H
+
2#define _PYTHONQTSIGNALRECEIVER_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ +
46
+
47#include "PythonQtSystem.h"
+
48#include "PythonQtObjectPtr.h"
+
49
+ + +
52
+
54
+
+ +
57{
+
58public:
+
+ +
60 {
+
61 _signalId = -1;
+
62 _methodInfo = nullptr;
+
63 _slotId = -1;
+
64 }
+
+
65
+
+
66 PythonQtSignalTarget(int signalId, const PythonQtMethodInfo* methodInfo, int slotId, PyObject* callable)
+
67 {
+
68 _signalId = signalId;
+
69 _slotId = slotId;
+
70 _methodInfo = methodInfo;
+
71 _callable = callable;
+
72 };
+
+
73
+ +
75
+
77 int signalId() const { return _signalId; }
+
78
+
80 int slotId() const { return _slotId; }
+
81
+
83 const PythonQtMethodInfo* methodInfo() const { return _methodInfo; }
+
84
+
86 void call(void** arguments) const;
+
87
+
89 bool isSame(int signalId, PyObject* callable) const;
+
90
+
92 static PyObject* call(PyObject* callable, const PythonQtMethodInfo* methodInfo, void** arguments,
+ +
94
+
95private:
+
96 int _signalId;
+
97 int _slotId;
+
98 const PythonQtMethodInfo* _methodInfo;
+
99 PythonQtSafeObjectPtr _callable;
+
100};
+
+
101
+
103
+
+
105class PythonQtSignalReceiverBase : public QObject
+
106{
+ +
108public:
+
+ +
110 : QObject(obj) {};
+
+
111};
+
+
112
+
114
+
+ +
117{
+
118
+
119public:
+ + +
122
+ +
125
+
127 bool removeSignalHandler(const char* signal, PyObject* callable = nullptr);
+
128
+
130 int qt_metacall(QMetaObject::Call c, int id, void** arguments) override;
+
131
+
132private:
+
134 int getSignalIndex(const char* signal);
+
135
+
136 QObject* _obj;
+
137 PythonQtClassInfo* _objClassInfo;
+
138 int _slotCount;
+
139 int _destroyedSignalCount;
+
140 // linear list may get slow on multiple targets, but I think typically we have many objects and just a few signals
+ +
142
+
143 static int _destroyedSignal1Id;
+
144 static int _destroyedSignal2Id;
+
145};
+
+
146
+
147#endif
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
struct _object PyObject
+ + + +
#define PYTHONQT_EXPORT
+
a class that stores all required information about a Qt object (and an optional associated C++ class ...
+
stores information about a specific signal/slot/method
+
a smart pointer that stores a PyObject pointer and that handles reference counting automatically
+
base class for signal receivers
+ +
receives all signals for one QObject
+
bool addSignalHandler(const char *signal, PyObject *callable)
add a signal handler
+
~PythonQtSignalReceiver() override
+
int qt_metacall(QMetaObject::Call c, int id, void **arguments) override
we implement this method to simulate a number of slots that match the ids in _targets
+
bool removeSignalHandler(const char *signal, PyObject *callable=nullptr)
remove a signal handler for given callable (or all callables on that signal if callable is NULL)
+
PythonQtSignalReceiver(QObject *obj)
+
stores information about a signal target
+
bool isSame(int signalId, PyObject *callable) const
check if it is the same signal target
+
int slotId() const
get the id that was assigned to this simulated slot
+ +
static PyObject * call(PyObject *callable, const PythonQtMethodInfo *methodInfo, void **arguments, bool skipFirstArgumentOfMethodInfo=false)
call the given callable with arguments described by PythonQtMethodInfo, returns a new reference as re...
+
void call(void **arguments) const
call the python callable with the given arguments (as defined in methodInfo)
+
const PythonQtMethodInfo * methodInfo() const
get the signals parameter info
+
int signalId() const
get the id of the original signal
+ +
PythonQtSignalTarget(int signalId, const PythonQtMethodInfo *methodInfo, int slotId, PyObject *callable)
+
+ + + + diff --git a/PythonQtSignal_8h.html b/PythonQtSignal_8h.html new file mode 100644 index 000000000..2bb03c577 --- /dev/null +++ b/PythonQtSignal_8h.html @@ -0,0 +1,176 @@ + + + + + + + +PythonQt: PythonQtSignal.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtSignal.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "PythonQtSystem.h"
+#include "structmember.h"
+
+

Go to the source code of this file.

+ + + + + + + +

+Classes

struct  PythonQtDynamicSignalInfo
 
struct  PythonQtSignalFunctionObject
 defines a python object that stores a Qt signal info More...
 
+ + + +

+Macros

#define PythonQtSignalFunction_Check(op)   (Py_TYPE(op) == &PythonQtSignalFunction_Type)
 
+ + + +

+Functions

PyObjectPythonQtSignalFunction_New (PythonQtSlotInfo *, PyObject *, PyObject *)
 
+ + + +

+Variables

PYTHONQT_EXPORT PyTypeObject PythonQtSignalFunction_Type
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2006-05
+ +

Definition in file PythonQtSignal.h.

+

Macro Definition Documentation

+ +

◆ PythonQtSignalFunction_Check

+ +
+
+ + + + + + + + +
#define PythonQtSignalFunction_Check( op)   (Py_TYPE(op) == &PythonQtSignalFunction_Type)
+
+ +

Definition at line 54 of file PythonQtSignal.h.

+ +
+
+

Function Documentation

+ +

◆ PythonQtSignalFunction_New()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
PyObject * PythonQtSignalFunction_New (PythonQtSlotInfo,
PyObject,
PyObject 
)
+
+ +
+
+

Variable Documentation

+ +

◆ PythonQtSignalFunction_Type

+ +
+
+ + + + + +
+ + + + +
PYTHONQT_EXPORT PyTypeObject PythonQtSignalFunction_Type
+
+extern
+
+ +
+
+
+ + + + diff --git a/PythonQtSignal_8h_source.html b/PythonQtSignal_8h_source.html new file mode 100644 index 000000000..13ca6b8e4 --- /dev/null +++ b/PythonQtSignal_8h_source.html @@ -0,0 +1,145 @@ + + + + + + + +PythonQt: PythonQtSignal.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtSignal.h
+
+
+Go to the documentation of this file.
1#ifndef _PythonQtSignal_H
+
2#define _PythonQtSignal_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ +
46
+
47#include "PythonQtSystem.h"
+
48#include "structmember.h"
+
49
+ +
51
+ +
53
+
54#define PythonQtSignalFunction_Check(op) (Py_TYPE(op) == &PythonQtSignalFunction_Type)
+
55
+ +
57
+ +
62
+
+ + +
66 PythonQtSlotInfo* m_ml; /* Description of the C function to call */
+
67 PyObject* m_self; /* Passed as 'self' arg to the C func, can be NULL */
+
68 PyObject* m_module; /* The __module__ attribute, can be anything */
+ +
70};
+
+
71
+
72#endif
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
struct _object PyObject
+ +
PyObject * PythonQtSignalFunction_New(PythonQtSlotInfo *, PyObject *, PyObject *)
+
PYTHONQT_EXPORT PyTypeObject PythonQtSignalFunction_Type
+ +
#define PYTHONQT_EXPORT
+
stores information about a slot, including a next pointer to overloaded slots
+ + +
QList< QByteArray > signatures
+
defines a python object that stores a Qt signal info
+
PyObject_HEAD PythonQtSlotInfo * m_ml
+ +
PythonQtDynamicSignalInfo * _dynamicInfo
+ +
+ + + + diff --git a/PythonQtSlotDecorator_8h.html b/PythonQtSlotDecorator_8h.html new file mode 100644 index 000000000..63dfc0d13 --- /dev/null +++ b/PythonQtSlotDecorator_8h.html @@ -0,0 +1,126 @@ + + + + + + + +PythonQt: PythonQtSlotDecorator.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtSlotDecorator.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "PythonQtSystem.h"
+#include <QByteArray>
+#include <QList>
+#include <structmember.h>
+
+

Go to the source code of this file.

+ + + + +

+Classes

struct  PythonQtSlotDecorator
 
+ + + +

+Macros

#define PythonQtSlotDecorator_Check(op)   (Py_TYPE(op) == &PythonQtSlotDecorator_Type)
 
+ + + +

+Variables

PYTHONQT_EXPORT PyTypeObject PythonQtSlotDecorator_Type
 
+

Macro Definition Documentation

+ +

◆ PythonQtSlotDecorator_Check

+ +
+
+ + + + + + + + +
#define PythonQtSlotDecorator_Check( op)   (Py_TYPE(op) == &PythonQtSlotDecorator_Type)
+
+ +

Definition at line 44 of file PythonQtSlotDecorator.h.

+ +
+
+

Variable Documentation

+ +

◆ PythonQtSlotDecorator_Type

+ +
+
+ + + + + +
+ + + + +
PYTHONQT_EXPORT PyTypeObject PythonQtSlotDecorator_Type
+
+extern
+
+ +
+
+
+ + + + diff --git a/PythonQtSlotDecorator_8h_source.html b/PythonQtSlotDecorator_8h_source.html new file mode 100644 index 000000000..b0432efa4 --- /dev/null +++ b/PythonQtSlotDecorator_8h_source.html @@ -0,0 +1,120 @@ + + + + + + + +PythonQt: PythonQtSlotDecorator.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtSlotDecorator.h
+
+
+Go to the documentation of this file.
1#pragma once
+
2
+
3/*
+
4*
+
5* Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
6*
+
7* This library is free software; you can redistribute it and/or
+
8* modify it under the terms of the GNU Lesser General Public
+
9* License as published by the Free Software Foundation; either
+
10* version 2.1 of the License, or (at your option) any later version.
+
11*
+
12* This library is distributed in the hope that it will be useful,
+
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
+
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
15* Lesser General Public License for more details.
+
16*
+
17* Further, this software is distributed without any warranty that it is
+
18* free of the rightful claim of any third person regarding infringement
+
19* or the like. Any license provided herein, whether implied or
+
20* otherwise, applies only to this software file. Patent licenses, if
+
21* any, provided herein do not apply to combinations of this program with
+
22* other software, or any other product whatsoever.
+
23*
+
24* You should have received a copy of the GNU Lesser General Public
+
25* License along with this library; if not, write to the Free Software
+
26* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
27*
+
28* Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
29* 28359 Bremen, Germany or:
+
30*
+
31* http://www.mevis.de
+
32*
+
33*/
+
34
+ +
36#include "PythonQtSystem.h"
+
37#include <QByteArray>
+
38#include <QList>
+
39
+
40#include <structmember.h>
+
41
+ +
43
+
44#define PythonQtSlotDecorator_Check(op) (Py_TYPE(op) == &PythonQtSlotDecorator_Type)
+
45
+ +
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+ +
PYTHONQT_EXPORT PyTypeObject PythonQtSlotDecorator_Type
+ +
#define PYTHONQT_EXPORT
+ + +
PyObject_HEAD QByteArray * args
+
+ + + + diff --git a/PythonQtSlot_8h.html b/PythonQtSlot_8h.html new file mode 100644 index 000000000..8878d2af2 --- /dev/null +++ b/PythonQtSlot_8h.html @@ -0,0 +1,475 @@ + + + + + + + +PythonQt: PythonQtSlot.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtSlot.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "PythonQtSystem.h"
+#include "structmember.h"
+
+

Go to the source code of this file.

+ + + + + +

+Classes

struct  PythonQtSlotFunctionObject
 defines a python object that stores a Qt slot info More...
 
+ + + + + +

+Macros

#define PythonQtSlotFunction_Check(op)   (Py_TYPE(op) == &PythonQtSlotFunction_Type)
 
#define PythonQtSlotFunction_GET_SELF(func)   (((PythonQtSlotFunctionObject*)func)->m_self)
 
+ + + +

+Enumerations

enum  PythonQtPassThisOwnershipType { IgnoreOwnership +, PassOwnershipToCPP +, PassOwnershipToPython + }
 
+ + + + + + + + + + + + + + + + + + + +

+Functions

PythonQtSlotInfoPythonQtSlotFunction_GetSlotInfo (PyObject *)
 
PyObjectPythonQtSlotFunction_GetSelf (PyObject *)
 
PyObjectPythonQtSlotFunction_Call (PyObject *, PyObject *, PyObject *)
 
PyObjectPythonQtSlotFunction_CallImpl (PythonQtClassInfo *classInfo, QObject *objectToCall, PythonQtSlotInfo *info, PyObject *args, PyObject *kw, void *firstArg=nullptr, void **directReturnValuePointer=nullptr, PythonQtPassThisOwnershipType *passThisOwnershipToCPP=nullptr)
 
PyObjectPythonQtSlotFunction_New (PythonQtSlotInfo *, PyObject *, PyObject *)
 
PyObjectPythonQtMemberFunction_Call (PythonQtSlotInfo *info, PyObject *m_self, PyObject *args, PyObject *kw)
 
PyObjectPythonQtMemberFunction_parameterTypes (PythonQtSlotInfo *theInfo)
 
PyObjectPythonQtMemberFunction_parameterNames (PythonQtSlotInfo *theInfo)
 
PyObjectPythonQtMemberFunction_typeName (PythonQtSlotInfo *theInfo)
 
+ + + +

+Variables

PYTHONQT_EXPORT PyTypeObject PythonQtSlotFunction_Type
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2006-05
+ +

Definition in file PythonQtSlot.h.

+

Macro Definition Documentation

+ +

◆ PythonQtSlotFunction_Check

+ +
+
+ + + + + + + + +
#define PythonQtSlotFunction_Check( op)   (Py_TYPE(op) == &PythonQtSlotFunction_Type)
+
+ +

Definition at line 56 of file PythonQtSlot.h.

+ +
+
+ +

◆ PythonQtSlotFunction_GET_SELF

+ +
+
+ + + + + + + + +
#define PythonQtSlotFunction_GET_SELF( func)   (((PythonQtSlotFunctionObject*)func)->m_self)
+
+ +

Definition at line 63 of file PythonQtSlot.h.

+ +
+
+

Enumeration Type Documentation

+ +

◆ PythonQtPassThisOwnershipType

+ +
+
+ + + + +
Enumerator
IgnoreOwnership 
PassOwnershipToCPP 
PassOwnershipToPython 
+ +

Definition at line 52 of file PythonQtSlot.h.

+
+
@ PassOwnershipToPython
+
@ IgnoreOwnership
+
@ PassOwnershipToCPP
+
+
+
+

Function Documentation

+ +

◆ PythonQtMemberFunction_Call()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PyObject * PythonQtMemberFunction_Call (PythonQtSlotInfoinfo,
PyObjectm_self,
PyObjectargs,
PyObjectkw 
)
+
+ +
+
+ +

◆ PythonQtMemberFunction_parameterNames()

+ +
+
+ + + + + + + + +
PyObject * PythonQtMemberFunction_parameterNames (PythonQtSlotInfotheInfo)
+
+ +
+
+ +

◆ PythonQtMemberFunction_parameterTypes()

+ +
+
+ + + + + + + + +
PyObject * PythonQtMemberFunction_parameterTypes (PythonQtSlotInfotheInfo)
+
+ +
+
+ +

◆ PythonQtMemberFunction_typeName()

+ +
+
+ + + + + + + + +
PyObject * PythonQtMemberFunction_typeName (PythonQtSlotInfotheInfo)
+
+ +
+
+ +

◆ PythonQtSlotFunction_Call()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
PyObject * PythonQtSlotFunction_Call (PyObject,
PyObject,
PyObject 
)
+
+ +
+
+ +

◆ PythonQtSlotFunction_CallImpl()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PyObject * PythonQtSlotFunction_CallImpl (PythonQtClassInfoclassInfo,
QObject * objectToCall,
PythonQtSlotInfoinfo,
PyObjectargs,
PyObjectkw,
voidfirstArg = nullptr,
void ** directReturnValuePointer = nullptr,
PythonQtPassThisOwnershipTypepassThisOwnershipToCPP = nullptr 
)
+
+ +
+
+ +

◆ PythonQtSlotFunction_GetSelf()

+ +
+
+ + + + + + + + +
PyObject * PythonQtSlotFunction_GetSelf (PyObject)
+
+ +
+
+ +

◆ PythonQtSlotFunction_GetSlotInfo()

+ +
+
+ + + + + + + + +
PythonQtSlotInfo * PythonQtSlotFunction_GetSlotInfo (PyObject)
+
+ +
+
+ +

◆ PythonQtSlotFunction_New()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
PyObject * PythonQtSlotFunction_New (PythonQtSlotInfo,
PyObject,
PyObject 
)
+
+ +
+
+

Variable Documentation

+ +

◆ PythonQtSlotFunction_Type

+ +
+
+ + + + + +
+ + + + +
PYTHONQT_EXPORT PyTypeObject PythonQtSlotFunction_Type
+
+extern
+
+ +
+
+
+ + + + diff --git a/PythonQtSlot_8h_source.html b/PythonQtSlot_8h_source.html new file mode 100644 index 000000000..e177857e6 --- /dev/null +++ b/PythonQtSlot_8h_source.html @@ -0,0 +1,166 @@ + + + + + + + +PythonQt: PythonQtSlot.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtSlot.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTSLOT_H
+
2#define _PYTHONQTSLOT_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ +
46
+
47#include "PythonQtSystem.h"
+
48#include "structmember.h"
+
49
+ +
51
+ +
53
+ +
55
+
56#define PythonQtSlotFunction_Check(op) (Py_TYPE(op) == &PythonQtSlotFunction_Type)
+
57
+ + +
60
+
61/* Macros for direct access to these values. Type checks are *not*
+
62 done, so use with care. */
+
63#define PythonQtSlotFunction_GET_SELF(func) (((PythonQtSlotFunctionObject*)func)->m_self)
+
64
+ +
66
+ +
68 PyObject* args, PyObject* kw, void* firstArg = nullptr, void** directReturnValuePointer = nullptr,
+ +
70
+ +
72
+ + + + +
77
+
+ + +
81 PythonQtSlotInfo* m_ml; /* Description of the C function to call */
+
82 PyObject* m_self; /* Passed as 'self' arg to the C func, can be NULL */
+
83 PyObject* m_module; /* The __module__ attribute, can be anything */
+
84};
+
+
85
+
86#endif
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
struct _object PyObject
+ +
PyObject * PythonQtMemberFunction_parameterTypes(PythonQtSlotInfo *theInfo)
+
PyObject * PythonQtSlotFunction_CallImpl(PythonQtClassInfo *classInfo, QObject *objectToCall, PythonQtSlotInfo *info, PyObject *args, PyObject *kw, void *firstArg=nullptr, void **directReturnValuePointer=nullptr, PythonQtPassThisOwnershipType *passThisOwnershipToCPP=nullptr)
+
PythonQtSlotInfo * PythonQtSlotFunction_GetSlotInfo(PyObject *)
+
PyObject * PythonQtSlotFunction_GetSelf(PyObject *)
+
PyObject * PythonQtSlotFunction_New(PythonQtSlotInfo *, PyObject *, PyObject *)
+
PyObject * PythonQtMemberFunction_parameterNames(PythonQtSlotInfo *theInfo)
+
PyObject * PythonQtMemberFunction_Call(PythonQtSlotInfo *info, PyObject *m_self, PyObject *args, PyObject *kw)
+
PyObject * PythonQtMemberFunction_typeName(PythonQtSlotInfo *theInfo)
+
PYTHONQT_EXPORT PyTypeObject PythonQtSlotFunction_Type
+
PyObject * PythonQtSlotFunction_Call(PyObject *, PyObject *, PyObject *)
+
PythonQtPassThisOwnershipType
+
@ PassOwnershipToPython
+
@ IgnoreOwnership
+
@ PassOwnershipToCPP
+ +
#define PYTHONQT_EXPORT
+
a class that stores all required information about a Qt object (and an optional associated C++ class ...
+
stores information about a slot, including a next pointer to overloaded slots
+
defines a python object that stores a Qt slot info
+ + +
PyObject_HEAD PythonQtSlotInfo * m_ml
+
+ + + + diff --git a/PythonQtStdDecorators_8h.html b/PythonQtStdDecorators_8h.html new file mode 100644 index 000000000..ef96e2870 --- /dev/null +++ b/PythonQtStdDecorators_8h.html @@ -0,0 +1,98 @@ + + + + + + + +PythonQt: PythonQtStdDecorators.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtStdDecorators.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "PythonQt.h"
+#include <QObject>
+#include <QVariantList>
+#include <QTextDocument>
+#include <QColor>
+#include <QDateTime>
+#include <QDate>
+#include <QTime>
+#include <QTimer>
+#include <QImage>
+#include <QMetaMethod>
+#include <QMetaEnum>
+#include <QMetaProperty>
+#include <QRandomGenerator>
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + +

+Classes

class  PythonQtStdDecorators
 
class  PythonQtSingleShotTimer
 
class  PythonQtWrapper_QMetaObject
 
class  PythonQtConfigAPI
 Some methods to set properties of PythonQt from Python. More...
 
class  PythonQtDebugAPI
 Some helper methods that allow testing of the ownership. More...
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2007-04
+ +

Definition in file PythonQtStdDecorators.h.

+
+ + + + diff --git a/PythonQtStdDecorators_8h_source.html b/PythonQtStdDecorators_8h_source.html new file mode 100644 index 000000000..9855de7cc --- /dev/null +++ b/PythonQtStdDecorators_8h_source.html @@ -0,0 +1,430 @@ + + + + + + + +PythonQt: PythonQtStdDecorators.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtStdDecorators.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTSTDDECORATORS_H
+
2#define _PYTHONQTSTDDECORATORS_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ +
46
+
47#include "PythonQt.h"
+
48
+
49#include <QObject>
+
50#include <QVariantList>
+
51#include <QTextDocument>
+
52#include <QColor>
+
53#include <QDateTime>
+
54#include <QDate>
+
55#include <QTime>
+
56#include <QTimer>
+
57#include <QImage>
+
58#include <QMetaMethod>
+
59#include <QMetaEnum>
+
60#include <QMetaProperty>
+
61#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
+
62 #include <QRandomGenerator>
+
63#endif
+
64
+
+ +
66{
+ +
68
+
69public Q_SLOTS:
+
70 bool connect(QObject* sender, const QByteArray& signal, PyObject* callable);
+
71 bool connect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot,
+
72 Qt::ConnectionType type = Qt::AutoConnection);
+
+
73 bool connect(QObject* receiver, QObject* sender, const QByteArray& signal, const QByteArray& slot,
+
74 Qt::ConnectionType type = Qt::AutoConnection)
+
75 {
+
76 return connect(sender, signal, receiver, slot, type);
+
77 }
+
+
+ +
79 {
+
80 return connect(sender, signal, callable);
+
81 }
+
+
+
82 bool static_QObject_connect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot,
+
83 Qt::ConnectionType type = Qt::AutoConnection)
+
84 {
+
85 return connect(sender, signal, receiver, slot, type);
+
86 }
+
+
87 bool disconnect(QObject* sender, const QByteArray& signal, PyObject* callable = nullptr);
+
88 bool disconnect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot);
+
+ +
90 {
+
91 return disconnect(sender, signal, callable);
+
92 }
+
+
+
93 bool static_QObject_disconnect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot)
+
94 {
+
95 return disconnect(sender, signal, receiver, slot);
+
96 }
+
+
97
+
98 const QMetaObject* metaObject(QObject* obj);
+
99
+
100 QObject* parent(QObject* o);
+ +
102
+
103 const QObjectList* children(QObject* o);
+
104 QObject* findChild(QObject* parent, PyObject* type, const QString& name = QString());
+
105 QList<QObject*> findChildren(QObject* parent, PyObject* type, const QString& name = QString());
+ +
107
+
108 bool setProperty(QObject* o, const char* name, const QVariant& value);
+
109 QVariant property(QObject* o, const char* name);
+
110
+
111 double static_Qt_qAbs(double a) { return qAbs(a); }
+
112 double static_Qt_qBound(double a, double b, double c) { return qBound(a, b, c); }
+
113 void static_Qt_qDebug(const QByteArray& msg) { qDebug("%s", msg.constData()); }
+
114 // TODO: multi arg qDebug...
+
115 void static_Qt_qWarning(const QByteArray& msg) { qWarning("%s", msg.constData()); }
+
116 // TODO: multi arg qWarning...
+
117 void static_Qt_qCritical(const QByteArray& msg) { qCritical("%s", msg.constData()); }
+
118 // TODO: multi arg qCritical...
+
119 void static_Qt_qFatal(const QByteArray& msg) { qFatal("%s", msg.constData()); }
+
120 // TODO: multi arg qFatal...
+
121 bool static_Qt_qFuzzyCompare(double a, double b) { return qFuzzyCompare(a, b); }
+
122 double static_Qt_qMax(double a, double b) { return qMax(a, b); }
+
123 double static_Qt_qMin(double a, double b) { return qMin(a, b); }
+
124 int static_Qt_qRound(double a) { return qRound(a); }
+
125 qint64 static_Qt_qRound64(double a) { return qRound64(a); }
+
126 const char* static_Qt_qVersion() { return qVersion(); }
+
127
+
+ +
129 {
+
130#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
+
131 return qrand();
+
132#else
+
133 return QRandomGenerator::global()->generate();
+
134#endif
+
135 }
+
+
136
+
+ +
138 {
+
139#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
+
140 qsrand(a);
+
141#else
+
142 QRandomGenerator::global()->seed(a);
+
143#endif
+
144 }
+
+
145
+
146 QString tr(QObject* obj, const QString& text, const QString& ambig = QString(), int n = -1);
+
147
+
148 QString static_Qt_SIGNAL(const QString& s) { return QString("2") + s; }
+
149 QString static_Qt_SLOT(const QString& s) { return QString("1") + s; }
+
150
+ +
152
+
153private:
+
154 QObject* findChild(QObject* parent, const char* typeName, const QMetaObject* meta, const QString& name);
+
155 int findChildren(QObject* parent, const char* typeName, const QMetaObject* meta, const QString& name,
+ +
157 int findChildren(QObject* parent, const char* typeName, const QMetaObject* meta, const QRegularExpression& regExp,
+ +
159};
+
+
160
+
+
161class PythonQtSingleShotTimer : public QTimer
+
162{
+ +
164public:
+ + +
167
+
168public Q_SLOTS:
+ +
170
+
171private:
+
172 PythonQtObjectPtr _callable;
+
173};
+
+
174
+
+
175class PythonQtWrapper_QMetaObject : public QObject
+
176{
+ +
178
+
179public Q_SLOTS:
+
180 // Python 3: PythonQt shadows className, so we need an extra getClassName method...
+
181 const char* getClassName(QMetaObject* obj) const { return obj->className(); }
+
182 const QMetaObject* superClass(QMetaObject* obj) const { return obj->superClass(); }
+
183
+
184 int methodOffset(QMetaObject* obj) const { return obj->methodOffset(); }
+
185 int enumeratorOffset(QMetaObject* obj) const { return obj->enumeratorOffset(); }
+
186 int propertyOffset(QMetaObject* obj) const { return obj->propertyOffset(); }
+
187 int classInfoOffset(QMetaObject* obj) const { return obj->classInfoOffset(); }
+
188
+
189 int constructorCount(QMetaObject* obj) const { return obj->constructorCount(); }
+
190 int methodCount(QMetaObject* obj) const { return obj->methodCount(); }
+
191 int enumeratorCount(QMetaObject* obj) const { return obj->enumeratorCount(); }
+
192 int propertyCount(QMetaObject* obj) const { return obj->propertyCount(); }
+
193 int classInfoCount(QMetaObject* obj) const { return obj->classInfoCount(); }
+
194
+
+ +
196 {
+
197 return obj->indexOfConstructor(constructor);
+
198 }
+
+
199 int indexOfMethod(QMetaObject* obj, const char* method) const { return obj->indexOfMethod(method); }
+
200 int indexOfSignal(QMetaObject* obj, const char* signal) const { return obj->indexOfSignal(signal); }
+
201 int indexOfSlot(QMetaObject* obj, const char* slot) const { return obj->indexOfSlot(slot); }
+
202 int indexOfEnumerator(QMetaObject* obj, const char* name) const { return obj->indexOfEnumerator(name); }
+
203 int indexOfProperty(QMetaObject* obj, const char* name) const { return obj->indexOfProperty(name); }
+
204 int indexOfClassInfo(QMetaObject* obj, const char* name) const { return obj->indexOfClassInfo(name); }
+
205
+
206 QMetaMethod constructor(QMetaObject* obj, int index) const { return obj->constructor(index); }
+
207 QMetaMethod method(QMetaObject* obj, int index) const { return obj->method(index); }
+
208 QMetaEnum enumerator(QMetaObject* obj, int index) const { return obj->enumerator(index); }
+
209 QMetaProperty property(QMetaObject* obj, int index) const { return obj->property(index); }
+
210 QMetaClassInfo classInfo(QMetaObject* obj, int index) const { return obj->classInfo(index); }
+
211 QMetaProperty userProperty(QMetaObject* obj) const { return obj->userProperty(); }
+
212
+
+
213 bool static_QMetaObject_checkConnectArgs(const char* signal, const char* method)
+
214 {
+
215 return QMetaObject::checkConnectArgs(signal, method);
+
216 }
+
+
+ +
218 {
+
219 return QMetaObject::normalizedSignature(method);
+
220 }
+
+
221 QByteArray static_QMetaObject_normalizedType(const char* type) { return QMetaObject::normalizedType(type); }
+
222};
+
+
223
+
+
225class PYTHONQT_EXPORT PythonQtConfigAPI : public QObject
+
226{
+ +
228public:
+
+
229 PythonQtConfigAPI(QObject* parent)
+
230 : QObject(parent) {};
+
+
231
+
232public slots:
+ +
236};
+
+
237
+
+
239class PYTHONQT_EXPORT PythonQtDebugAPI : public QObject
+
240{
+ +
242public:
+
+
243 PythonQtDebugAPI(QObject* parent)
+
244 : QObject(parent) {};
+
+
245
+
246public slots:
+ + + +
253
+ + +
258
+ + +
263};
+
+
264
+
265#endif
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
struct _object PyObject
+ +
#define PYTHONQT_EXPORT
+ +
Some methods to set properties of PythonQt from Python.
+
PythonQtConfigAPI(QObject *parent)
+
void setTaskDoneCallback(PyObject *object)
+
Some helper methods that allow testing of the ownership.
+
bool isDerivedShellInstance(PyObject *object)
Returns if the C++ object is an instance of a Python class that derives a C++ class.
+
bool isOwnedByPython(PyObject *object)
Returns if the C++ object is owned by PythonQt and will be deleted when the reference goes away.
+
PythonQtDebugAPI(QObject *parent)
+
bool isPythonQtClassWrapper(PyObject *object)
Returns if the given object is a PythonQt class wrapper (or derived class)
+
bool isPythonQtInstanceWrapper(PyObject *object)
Returns if the given object is a PythonQt instance wrapper (or derived class)
+
bool passOwnershipToPython(PyObject *object)
Pass the ownership of the given object to Python (so that the C++ object will be deleted when the Pyt...
+
bool passOwnershipToCPP(PyObject *object)
Pass the ownership of the given object to CPP (so that it will not be deleted by Python if the refere...
+
bool hasExtraShellRefCount(PyObject *object)
Returns if the shell instance has an extra ref count from the C++ side.
+ +
a smart pointer that stores a PyObject pointer and that handles reference counting automatically
+ +
PythonQtSingleShotTimer(int msec, const PythonQtObjectPtr &callable)
+
~PythonQtSingleShotTimer() override
+ + +
double static_Qt_qMin(double a, double b)
+
QList< QObject * > findChildren(QObject *parent, PyObject *type, const QString &name=QString())
+
void static_Qt_qDebug(const QByteArray &msg)
+
double static_Qt_qMax(double a, double b)
+ +
bool connect(QObject *receiver, QObject *sender, const QByteArray &signal, const QByteArray &slot, Qt::ConnectionType type=Qt::AutoConnection)
+
void static_QTimer_singleShot(int msec, PyObject *callable)
+
void static_Qt_qCritical(const QByteArray &msg)
+ + +
bool static_QObject_disconnect(QObject *sender, const QByteArray &signal, PyObject *callable=nullptr)
+
void static_Qt_qWarning(const QByteArray &msg)
+ +
QObject * findChild(QObject *parent, PyObject *type, const QString &name=QString())
+
QString tr(QObject *obj, const QString &text, const QString &ambig=QString(), int n=-1)
+
QString static_Qt_SIGNAL(const QString &s)
+
bool connect(QObject *sender, const QByteArray &signal, PyObject *callable)
+
const QMetaObject * metaObject(QObject *obj)
+
bool static_QObject_disconnect(QObject *sender, const QByteArray &signal, QObject *receiver, const QByteArray &slot)
+
QString static_Qt_SLOT(const QString &s)
+
void static_Qt_qFatal(const QByteArray &msg)
+
double static_Qt_qBound(double a, double b, double c)
+
qint64 static_Qt_qRound64(double a)
+
QList< QObject * > findChildren(QObject *parent, PyObject *type, const QRegularExpression &regExp)
+
bool static_QObject_connect(QObject *sender, const QByteArray &signal, QObject *receiver, const QByteArray &slot, Qt::ConnectionType type=Qt::AutoConnection)
+
void setParent(QObject *o, PythonQtNewOwnerOfThis< QObject * > parent)
+
bool static_Qt_qFuzzyCompare(double a, double b)
+
bool static_QObject_connect(QObject *sender, const QByteArray &signal, PyObject *callable)
+ +
bool disconnect(QObject *sender, const QByteArray &signal, QObject *receiver, const QByteArray &slot)
+
QObject * parent(QObject *o)
+
bool disconnect(QObject *sender, const QByteArray &signal, PyObject *callable=nullptr)
+
const QObjectList * children(QObject *o)
+
bool connect(QObject *sender, const QByteArray &signal, QObject *receiver, const QByteArray &slot, Qt::ConnectionType type=Qt::AutoConnection)
+
QVariant property(QObject *o, const char *name)
+
bool setProperty(QObject *o, const char *name, const QVariant &value)
+ +
int methodCount(QMetaObject *obj) const
+
int indexOfProperty(QMetaObject *obj, const char *name) const
+
QMetaMethod method(QMetaObject *obj, int index) const
+
int methodOffset(QMetaObject *obj) const
+
int enumeratorOffset(QMetaObject *obj) const
+
int classInfoCount(QMetaObject *obj) const
+
QMetaClassInfo classInfo(QMetaObject *obj, int index) const
+
int indexOfClassInfo(QMetaObject *obj, const char *name) const
+
QMetaEnum enumerator(QMetaObject *obj, int index) const
+
QByteArray static_QMetaObject_normalizedType(const char *type)
+
QMetaMethod constructor(QMetaObject *obj, int index) const
+
int propertyCount(QMetaObject *obj) const
+
int indexOfConstructor(QMetaObject *obj, const char *constructor) const
+
const QMetaObject * superClass(QMetaObject *obj) const
+
int indexOfMethod(QMetaObject *obj, const char *method) const
+
QByteArray static_QMetaObject_normalizedSignature(const char *method)
+
int enumeratorCount(QMetaObject *obj) const
+
int propertyOffset(QMetaObject *obj) const
+
int constructorCount(QMetaObject *obj) const
+
int indexOfSlot(QMetaObject *obj, const char *slot) const
+
bool static_QMetaObject_checkConnectArgs(const char *signal, const char *method)
+
int classInfoOffset(QMetaObject *obj) const
+
int indexOfEnumerator(QMetaObject *obj, const char *name) const
+
QMetaProperty userProperty(QMetaObject *obj) const
+
const char * getClassName(QMetaObject *obj) const
+
int indexOfSignal(QMetaObject *obj, const char *signal) const
+
QMetaProperty property(QMetaObject *obj, int index) const
+
+ + + + diff --git a/PythonQtStdIn_8h.html b/PythonQtStdIn_8h.html new file mode 100644 index 000000000..722019a90 --- /dev/null +++ b/PythonQtStdIn_8h.html @@ -0,0 +1,135 @@ + + + + + + + +PythonQt: PythonQtStdIn.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtStdIn.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "structmember.h"
+#include <QString>
+
+

Go to the source code of this file.

+ + + + + +

+Classes

struct  PythonQtStdInRedirect
 declares the stdin redirection class More...
 
+ + + + +

+Typedefs

typedef QString PythonQtInputChangedCB(void *callData)
 declares the callback that is called from the write() function
 
+ + + + +

+Variables

PyTypeObject PythonQtStdInRedirectType
 declares the type of the stdout redirection class
 
+

Detailed Description

+
Author
Jean-Christophe Fillion-Robin
+
+Last changed by
+
Author
jcfr
+
Date
2011
+ +

Definition in file PythonQtStdIn.h.

+

Typedef Documentation

+ +

◆ PythonQtInputChangedCB

+ +
+
+ + + + +
typedef QString PythonQtInputChangedCB(void *callData)
+
+ +

declares the callback that is called from the write() function

+ +

Definition at line 53 of file PythonQtStdIn.h.

+ +
+
+

Variable Documentation

+ +

◆ PythonQtStdInRedirectType

+ +
+
+ + + + + +
+ + + + +
PyTypeObject PythonQtStdInRedirectType
+
+extern
+
+ +

declares the type of the stdout redirection class

+ +
+
+
+ + + + diff --git a/PythonQtStdIn_8h_source.html b/PythonQtStdIn_8h_source.html new file mode 100644 index 000000000..44a9f034e --- /dev/null +++ b/PythonQtStdIn_8h_source.html @@ -0,0 +1,124 @@ + + + + + + + +PythonQt: PythonQtStdIn.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtStdIn.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTSTDIN_H
+
2#define _PYTHONQTSTDIN_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2011 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ +
46#include "structmember.h"
+
47#include <QString>
+
48
+ +
51
+ +
54
+ +
62
+
63#endif
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+ +
QString PythonQtInputChangedCB(void *callData)
declares the callback that is called from the write() function
+
PyTypeObject PythonQtStdInRedirectType
declares the type of the stdout redirection class
+
declares the stdin redirection class
+
PyObject_HEAD PythonQtInputChangedCB * _cb
+ + +
+ + + + diff --git a/PythonQtStdOut_8h.html b/PythonQtStdOut_8h.html new file mode 100644 index 000000000..4aef27735 --- /dev/null +++ b/PythonQtStdOut_8h.html @@ -0,0 +1,135 @@ + + + + + + + +PythonQt: PythonQtStdOut.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtStdOut.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "structmember.h"
+#include <QString>
+
+

Go to the source code of this file.

+ + + + + +

+Classes

struct  PythonQtStdOutRedirect
 declares the stdout redirection class More...
 
+ + + + +

+Typedefs

typedef void PythonQtOutputChangedCB(const QString &str)
 declares the callback that is called from the write() function
 
+ + + + +

+Variables

PyTypeObject PythonQtStdOutRedirectType
 declares the type of the stdout redirection class
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2006-05
+ +

Definition in file PythonQtStdOut.h.

+

Typedef Documentation

+ +

◆ PythonQtOutputChangedCB

+ +
+
+ + + + +
typedef void PythonQtOutputChangedCB(const QString &str)
+
+ +

declares the callback that is called from the write() function

+ +

Definition at line 54 of file PythonQtStdOut.h.

+ +
+
+

Variable Documentation

+ +

◆ PythonQtStdOutRedirectType

+ +
+
+ + + + + +
+ + + + +
PyTypeObject PythonQtStdOutRedirectType
+
+extern
+
+ +

declares the type of the stdout redirection class

+ +
+
+
+ + + + diff --git a/PythonQtStdOut_8h_source.html b/PythonQtStdOut_8h_source.html new file mode 100644 index 000000000..942eda3f6 --- /dev/null +++ b/PythonQtStdOut_8h_source.html @@ -0,0 +1,125 @@ + + + + + + + +PythonQt: PythonQtStdOut.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtStdOut.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTSTDOUT_H
+
2#define _PYTHONQTSTDOUT_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ +
46
+
47#include "structmember.h"
+
48#include <QString>
+
49
+ +
52
+
54typedef void PythonQtOutputChangedCB(const QString& str);
+
55
+ +
63
+
64#endif
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+ +
void PythonQtOutputChangedCB(const QString &str)
declares the callback that is called from the write() function
+
PyTypeObject PythonQtStdOutRedirectType
declares the type of the stdout redirection class
+
declares the stdout redirection class
+ +
PyObject_HEAD PythonQtOutputChangedCB * _cb
+ +
+ + + + diff --git a/PythonQtSystem_8h.html b/PythonQtSystem_8h.html new file mode 100644 index 000000000..5a546b062 --- /dev/null +++ b/PythonQtSystem_8h.html @@ -0,0 +1,90 @@ + + + + + + + +PythonQt: PythonQtSystem.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtSystem.h File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Macros

#define PYTHONQT_EXPORT
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2006-05
+ +

Definition in file PythonQtSystem.h.

+

Macro Definition Documentation

+ +

◆ PYTHONQT_EXPORT

+ +
+
+ + + + +
#define PYTHONQT_EXPORT
+
+ +

Definition at line 55 of file PythonQtSystem.h.

+ +
+
+
+ + + + diff --git a/PythonQtSystem_8h_source.html b/PythonQtSystem_8h_source.html new file mode 100644 index 000000000..f2a8ccd3d --- /dev/null +++ b/PythonQtSystem_8h_source.html @@ -0,0 +1,113 @@ + + + + + + + +PythonQt: PythonQtSystem.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtSystem.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTSYSTEM_
+
2#define _PYTHONQTSYSTEM_
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+
45#if defined(WIN32)
+
46 #ifdef PYTHONQT_EXPORTS
+
47 #define PYTHONQT_EXPORT __declspec(dllexport)
+
48 #else
+
49 #define PYTHONQT_EXPORT __declspec(dllimport)
+
50 #endif
+
51#else
+
52 #ifdef PYTHONQT_EXPORTS
+
53 #define PYTHONQT_EXPORT __attribute__((__visibility__("default")))
+
54 #else
+
55 #define PYTHONQT_EXPORT
+
56 #endif
+
57#endif
+
58
+
59#endif
+
+ + + + diff --git a/PythonQtThreadSupport_8h.html b/PythonQtThreadSupport_8h.html new file mode 100644 index 000000000..40ea82338 --- /dev/null +++ b/PythonQtThreadSupport_8h.html @@ -0,0 +1,170 @@ + + + + + + + +PythonQt: PythonQtThreadSupport.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtThreadSupport.h File Reference
+
+
+
#include <QtGlobal>
+#include "PythonQtPythonInclude.h"
+#include "PythonQtSystem.h"
+
+

Go to the source code of this file.

+ + + + + + +

+Classes

class  PythonQtGILScope
 
class  PythonQtThreadStateSaver
 
+ + + + + + + + + + + +

+Macros

#define PYTHONQT_FULL_THREAD_SUPPORT
 
#define PYTHONQT_GIL_SUPPORT
 
#define PYTHONQT_ALLOW_THREADS_SUPPORT
 
#define PYTHONQT_GIL_SCOPE   PythonQtGILScope internal_pythonqt_gilscope;
 
#define PYTHONQT_ALLOW_THREADS_SCOPE   PythonQtThreadStateSaver internal_pythonqt_savethread;
 
+

Detailed Description

+
Author
Florian Link
+
Date
2018-08
+ +

Definition in file PythonQtThreadSupport.h.

+

Macro Definition Documentation

+ +

◆ PYTHONQT_ALLOW_THREADS_SCOPE

+ +
+
+ + + + +
#define PYTHONQT_ALLOW_THREADS_SCOPE   PythonQtThreadStateSaver internal_pythonqt_savethread;
+
+ +

Definition at line 99 of file PythonQtThreadSupport.h.

+ +
+
+ +

◆ PYTHONQT_ALLOW_THREADS_SUPPORT

+ +
+
+ + + + +
#define PYTHONQT_ALLOW_THREADS_SUPPORT
+
+ +

Definition at line 50 of file PythonQtThreadSupport.h.

+ +
+
+ +

◆ PYTHONQT_FULL_THREAD_SUPPORT

+ +
+
+ + + + +
#define PYTHONQT_FULL_THREAD_SUPPORT
+
+ +

Definition at line 46 of file PythonQtThreadSupport.h.

+ +
+
+ +

◆ PYTHONQT_GIL_SCOPE

+ +
+
+ + + + +
#define PYTHONQT_GIL_SCOPE   PythonQtGILScope internal_pythonqt_gilscope;
+
+ +

Definition at line 55 of file PythonQtThreadSupport.h.

+ +
+
+ +

◆ PYTHONQT_GIL_SUPPORT

+ +
+
+ + + + +
#define PYTHONQT_GIL_SUPPORT
+
+ +

Definition at line 49 of file PythonQtThreadSupport.h.

+ +
+
+
+ + + + diff --git a/PythonQtThreadSupport_8h_source.html b/PythonQtThreadSupport_8h_source.html new file mode 100644 index 000000000..6dab0f59f --- /dev/null +++ b/PythonQtThreadSupport_8h_source.html @@ -0,0 +1,203 @@ + + + + + + + +PythonQt: PythonQtThreadSupport.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtThreadSupport.h
+
+
+Go to the documentation of this file.
1#pragma once
+
2/*
+
3*
+
4* Copyright (C) 2018 MeVis Medical Solutions AG All Rights Reserved.
+
5*
+
6* This library is free software; you can redistribute it and/or
+
7* modify it under the terms of the GNU Lesser General Public
+
8* License as published by the Free Software Foundation; either
+
9* version 2.1 of the License, or (at your option) any later version.
+
10*
+
11* This library is distributed in the hope that it will be useful,
+
12* but WITHOUT ANY WARRANTY; without even the implied warranty of
+
13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
14* Lesser General Public License for more details.
+
15*
+
16* Further, this software is distributed without any warranty that it is
+
17* free of the rightful claim of any third person regarding infringement
+
18* or the like. Any license provided herein, whether implied or
+
19* otherwise, applies only to this software file. Patent licenses, if
+
20* any, provided herein do not apply to combinations of this program with
+
21* other software, or any other product whatsoever.
+
22*
+
23* You should have received a copy of the GNU Lesser General Public
+
24* License along with this library; if not, write to the Free Software
+
25* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
26*
+
27* Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
28* 28359 Bremen, Germany or:
+
29*
+
30* http://www.mevis.de
+
31*
+
32*/
+
33
+
34//----------------------------------------------------------------------------------
+
40//----------------------------------------------------------------------------------
+
41
+
42#include <QtGlobal> //Q_DISABLE_COPY
+ +
44#include "PythonQtSystem.h"
+
45
+
46#define PYTHONQT_FULL_THREAD_SUPPORT
+
47
+
48#ifdef PYTHONQT_FULL_THREAD_SUPPORT
+
49 #define PYTHONQT_GIL_SUPPORT
+
50 #define PYTHONQT_ALLOW_THREADS_SUPPORT
+
51#endif
+
52
+
53#ifdef PYTHONQT_GIL_SUPPORT
+
54
+
55 #define PYTHONQT_GIL_SCOPE PythonQtGILScope internal_pythonqt_gilscope;
+
56
+
+ +
61{
+
62public:
+ +
64
+ +
66
+
67 void release();
+
68
+
72 static void setGILScopeEnabled(bool flag);
+
74 static bool isGILScopeEnabled();
+
75
+
76private:
+
77 PyGILState_STATE _state;
+
78 bool _ensured;
+
79
+
80 static bool _enableGILScope;
+
81};
+
+
82
+
83#else
+
84
+
85 #define PYTHONQT_GIL_SCOPE
+
86
+ +
89{
+
90public:
+ +
92 void release() {}
+
93};
+
94
+
95#endif
+
96
+
97#ifdef PYTHONQT_ALLOW_THREADS_SUPPORT
+
98
+
99 #define PYTHONQT_ALLOW_THREADS_SCOPE PythonQtThreadStateSaver internal_pythonqt_savethread;
+
100
+
+ +
105{
+ +
107public:
+ +
109
+ +
111
+
112 void save() { _state = PyEval_SaveThread(); }
+
113
+
+
114 void restore()
+
115 {
+
116 if (_state) {
+
117 PyEval_RestoreThread(_state);
+
118 _state = nullptr;
+
119 }
+
120 }
+
+
121
+
122private:
+
123 PyThreadState* _state;
+
124};
+
+
125
+
126#else
+
127
+
128 #define PYTHONQT_ALLOW_THREADS_SCOPE
+
129
+ +
132{
+
133public:
+ +
135 void save() {}
+
136 void restore() {}
+
137};
+
138
+
139#endif
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+ + +
#define PYTHONQT_EXPORT
+ +
static void setGILScopeEnabled(bool flag)
+ + + +
static bool isGILScopeEnabled()
Check if GIL scopes are enabled.
+ + + + + +
+ + + + diff --git a/PythonQtUtils_8h.html b/PythonQtUtils_8h.html new file mode 100644 index 000000000..39e135634 --- /dev/null +++ b/PythonQtUtils_8h.html @@ -0,0 +1,97 @@ + + + + + + + +PythonQt: PythonQtUtils.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQtUtils.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "PythonQtSystem.h"
+#include <QByteArray>
+#include <QMetaMethod>
+#include <QMetaType>
+
+

Go to the source code of this file.

+ + + + +

+Namespaces

namespace  PythonQtUtils
 
+ + + + + + + + + + + + + + + + +

+Functions

QByteArray PythonQtUtils::signature (const QMetaMethod &method)
 
QByteArray PythonQtUtils::methodName (const QMetaMethod &method)
 
QByteArray PythonQtUtils::typeName (const QMetaMethod &method)
 
bool PythonQtUtils::isPythonClassType (PyObject *obj)
 Returns of the python object is a class type.
 
int PythonQtUtils::metaTypeIdFromTypeName (const QByteArray &className)
 Returns the meta type ID from a type name.
 
const charPythonQtUtils::typeNameFromMetaTypeId (int metaTypeId)
 Returns the type name from a meta type ID.
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2014-09
+ +

Definition in file PythonQtUtils.h.

+
+ + + + diff --git a/PythonQtUtils_8h_source.html b/PythonQtUtils_8h_source.html new file mode 100644 index 000000000..d3244a53e --- /dev/null +++ b/PythonQtUtils_8h_source.html @@ -0,0 +1,191 @@ + + + + + + + +PythonQt: PythonQtUtils.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtUtils.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTUTILS_H
+
2#define _PYTHONQTUTILS_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ +
46#include "PythonQtSystem.h"
+
47
+
48#include <QByteArray>
+
49#include <QMetaMethod>
+
50#include <QMetaType>
+
51
+
+
52namespace PythonQtUtils {
+
+
53inline QByteArray signature(const QMetaMethod& method)
+
54{
+
55#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
+
56 return method.methodSignature();
+
57#else
+
58 return QByteArray(method.signature());
+
59#endif
+
60}
+
+
61
+
+
62inline QByteArray methodName(const QMetaMethod& method)
+
63{
+
64#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
+
65 return method.name();
+
66#else
+
67 QByteArray sig(method.signature());
+
68 int idx = sig.indexOf('(');
+
69 sig = sig.left(idx);
+
70 return sig;
+
71#endif
+
72}
+
+
73
+
+
74inline QByteArray typeName(const QMetaMethod& method)
+
75{
+
76#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
+
77 QByteArray result = method.typeName();
+
78 if (result == "void") {
+
79 return QByteArray();
+
80 } else {
+
81 return result;
+
82 }
+
83#else
+
84 return method.typeName();
+
85#endif
+
86}
+
+
87
+
+ +
90{
+
91 return PyType_Check(obj);
+
92}
+
+
93
+
+
95inline int metaTypeIdFromTypeName(const QByteArray& className)
+
96{
+
97#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+
98 return QMetaType::fromName(className.constData()).id();
+
99#else
+
100 return QMetaType::type(className.constData());
+
101#endif
+
102}
+
+
103
+
+
105inline const char* typeNameFromMetaTypeId(int metaTypeId)
+
106{
+
107#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+
108 return QMetaType(metaTypeId).name();
+
109#else
+
110 return QMetaType::typeName(metaTypeId);
+
111#endif
+
112}
+
+
113}
+
+
114
+
115#endif
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
struct _object PyObject
+ + + +
const char * typeNameFromMetaTypeId(int metaTypeId)
Returns the type name from a meta type ID.
+
QByteArray methodName(const QMetaMethod &method)
+
QByteArray typeName(const QMetaMethod &method)
+
bool isPythonClassType(PyObject *obj)
Returns of the python object is a class type.
+
QByteArray signature(const QMetaMethod &method)
+
int metaTypeIdFromTypeName(const QByteArray &className)
Returns the meta type ID from a type name.
+
+ + + + diff --git a/PythonQtVariants_8h.html b/PythonQtVariants_8h.html new file mode 100644 index 000000000..42ebd388d --- /dev/null +++ b/PythonQtVariants_8h.html @@ -0,0 +1,94 @@ + + + + + + + +PythonQt: PythonQtVariants.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+
PythonQtVariants.h File Reference
+
+
+
#include <QBitArray>
+#include <QDate>
+#include <QTime>
+#include <QDateTime>
+#include <QUrl>
+#include <QLocale>
+#include <QRect>
+#include <QRectF>
+#include <QLine>
+#include <QLineF>
+#include <QPoint>
+#include <QPointF>
+#include <QRegularExpression>
+#include <QFont>
+#include <QBitmap>
+#include <QBrush>
+#include <QColor>
+#include <QPalette>
+#include <QIcon>
+#include <QImage>
+#include <QPolygon>
+#include <QRegion>
+#include <QCursor>
+#include <QSizePolicy>
+#include <QKeySequence>
+#include <QPen>
+#include <QTextLength>
+#include <QTextFormat>
+#include <QMatrix>
+
+

Go to the source code of this file.

+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
stk
+
Date
2006-08
+ +

Definition in file PythonQtVariants.h.

+
+ + + + diff --git a/PythonQtVariants_8h_source.html b/PythonQtVariants_8h_source.html new file mode 100644 index 000000000..d0ba4a327 --- /dev/null +++ b/PythonQtVariants_8h_source.html @@ -0,0 +1,133 @@ + + + + + + + +PythonQt: PythonQtVariants.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQtVariants.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQTVARIANTS_
+
2#define _PYTHONQTVARIANTS_
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+
45#include <QBitArray>
+
46#include <QDate>
+
47#include <QTime>
+
48#include <QDateTime>
+
49#include <QUrl>
+
50#include <QLocale>
+
51#include <QRect>
+
52#include <QRectF>
+
53#include <QLine>
+
54#include <QLineF>
+
55#include <QPoint>
+
56#include <QPointF>
+
57#include <QRegularExpression>
+
58
+
59#include <QFont>
+
60#include <QBitmap>
+
61#include <QBrush>
+
62#include <QColor>
+
63#include <QPalette>
+
64#include <QIcon>
+
65#include <QImage>
+
66#include <QPolygon>
+
67#include <QRegion>
+
68#include <QBitmap>
+
69#include <QCursor>
+
70#include <QSizePolicy>
+
71#include <QKeySequence>
+
72#include <QPen>
+
73#include <QTextLength>
+
74#include <QTextFormat>
+
75#if QT_VERSION < 0x060000
+
76 #include <QMatrix>
+
77#endif
+
78
+
79#endif
+
+ + + + diff --git a/PythonQt_8h.html b/PythonQt_8h.html new file mode 100644 index 000000000..b6e117923 --- /dev/null +++ b/PythonQt_8h.html @@ -0,0 +1,413 @@ + + + + + + + +PythonQt: PythonQt.h File Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+ +
PythonQt.h File Reference
+
+
+
#include "PythonQtPythonInclude.h"
+#include "PythonQtUtils.h"
+#include "PythonQtSystem.h"
+#include "PythonQtInstanceWrapper.h"
+#include "PythonQtClassWrapper.h"
+#include "PythonQtSlot.h"
+#include "PythonQtObjectPtr.h"
+#include "PythonQtStdIn.h"
+#include "PythonQtThreadSupport.h"
+#include <QObject>
+#include <QVariant>
+#include <QList>
+#include <QHash>
+#include <QByteArray>
+#include <QStringList>
+#include <QtDebug>
+#include <iostream>
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + +

+Classes

class  PythonQtPassOwnershipToCPP< T >
 
class  PythonQtPassOwnershipToPython< T >
 
class  PythonQtNewOwnerOfThis< T >
 
class  PythonQt
 The main interface to the Python Qt binding, realized as a singleton. More...
 
class  PythonQtPrivate
 internal PythonQt details More...
 
+ + + + + + + + +

+Macros

#define QStringToPythonConstCharPointer(arg)   ((arg).toUtf8().constData())
 Helper define to convert from QString to Python C-API.
 
#define QStringToPythonCharPointer(arg)   ((arg).toUtf8().data())
 
#define QStringToPythonEncoding(arg)   ((arg).toUtf8())
 
+ + + + + + + + + + + + + + + + +

+Typedefs

typedef void PythonQtVoidPtrCB(void *object)
 
typedef void PythonQtQObjectWrappedCB(QObject *object)
 
typedef void PythonQtQObjectNoLongerWrappedCB(QObject *object)
 
typedef voidPythonQtPolymorphicHandlerCB(const void *ptr, const char **class_name)
 
typedef QString PythonQtQObjectMissingAttributeCB(QObject *object, const QString &attribute)
 
typedef void PythonQtShellSetInstanceWrapperCB(void *object, PythonQtInstanceWrapper *wrapper)
 
typedef QObject * PythonQtQObjectCreatorFunctionCB()
 callback to create a QObject lazily
 
+ + + + + + + + + + + + +

+Functions

template<class T >
void PythonQtSetInstanceWrapperOnShell (void *object, PythonQtInstanceWrapper *wrapper)
 
template<class T1 , class T2 >
int PythonQtUpcastingOffset ()
 returns the offset that needs to be added to upcast an object of type T1 to T2
 
template<class T >
QObject * PythonQtCreateObject ()
 helper template to create a derived QObject class
 
+

Detailed Description

+
Author
Florian Link
+
+Last changed by
+
Author
florian
+
Date
2006-05
+ +

Definition in file PythonQt.h.

+

Macro Definition Documentation

+ +

◆ QStringToPythonCharPointer

+ +
+
+ + + + + + + + +
#define QStringToPythonCharPointer( arg)   ((arg).toUtf8().data())
+
+ +

Definition at line 166 of file PythonQt.h.

+ +
+
+ +

◆ QStringToPythonConstCharPointer

+ +
+
+ + + + + + + + +
#define QStringToPythonConstCharPointer( arg)   ((arg).toUtf8().constData())
+
+ +

Helper define to convert from QString to Python C-API.

+ +

Definition at line 165 of file PythonQt.h.

+ +
+
+ +

◆ QStringToPythonEncoding

+ +
+
+ + + + + + + + +
#define QStringToPythonEncoding( arg)   ((arg).toUtf8())
+
+ +

Definition at line 167 of file PythonQt.h.

+ +
+
+

Typedef Documentation

+ +

◆ PythonQtPolymorphicHandlerCB

+ +
+
+ + + + +
typedef void * PythonQtPolymorphicHandlerCB(const void *ptr, const char **class_name)
+
+ +

Definition at line 75 of file PythonQt.h.

+ +
+
+ +

◆ PythonQtQObjectCreatorFunctionCB

+ +
+
+ + + + +
typedef QObject * PythonQtQObjectCreatorFunctionCB()
+
+ +

callback to create a QObject lazily

+ +

Definition at line 155 of file PythonQt.h.

+ +
+
+ +

◆ PythonQtQObjectMissingAttributeCB

+ +
+
+ + + + +
typedef QString PythonQtQObjectMissingAttributeCB(QObject *object, const QString &attribute)
+
+ +

Definition at line 76 of file PythonQt.h.

+ +
+
+ +

◆ PythonQtQObjectNoLongerWrappedCB

+ +
+
+ + + + +
typedef void PythonQtQObjectNoLongerWrappedCB(QObject *object)
+
+ +

Definition at line 74 of file PythonQt.h.

+ +
+
+ +

◆ PythonQtQObjectWrappedCB

+ +
+
+ + + + +
typedef void PythonQtQObjectWrappedCB(QObject *object)
+
+ +

Definition at line 73 of file PythonQt.h.

+ +
+
+ +

◆ PythonQtShellSetInstanceWrapperCB

+ +
+
+ + + + +
typedef void PythonQtShellSetInstanceWrapperCB(void *object, PythonQtInstanceWrapper *wrapper)
+
+ +

Definition at line 78 of file PythonQt.h.

+ +
+
+ +

◆ PythonQtVoidPtrCB

+ +
+
+ + + + +
typedef void PythonQtVoidPtrCB(void *object)
+
+ +

Definition at line 72 of file PythonQt.h.

+ +
+
+

Function Documentation

+ +

◆ PythonQtCreateObject()

+ +
+
+
+template<class T >
+ + + + + + + +
QObject * PythonQtCreateObject ()
+
+ +

helper template to create a derived QObject class

+ +

Definition at line 159 of file PythonQt.h.

+
160{
+
161 return new T();
+
162}
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
+
+
+ +

◆ PythonQtSetInstanceWrapperOnShell()

+ +
+
+
+template<class T >
+ + + + + + + + + + + + + + + + + + +
void PythonQtSetInstanceWrapperOnShell (voidobject,
PythonQtInstanceWrapperwrapper 
)
+
+ +

Definition at line 81 of file PythonQt.h.

+
82{
+
83 (reinterpret_cast<T*>(object))->_wrapper = wrapper;
+
84}
+
+
+
+ +

◆ PythonQtUpcastingOffset()

+ +
+
+
+template<class T1 , class T2 >
+ + + + + + + +
int PythonQtUpcastingOffset ()
+
+ +

returns the offset that needs to be added to upcast an object of type T1 to T2

+ +

Definition at line 148 of file PythonQt.h.

+
149{
+
150 return ((reinterpret_cast<char*>(static_cast<T2*>(reinterpret_cast<T1*>(0x100))))
+
151 - (reinterpret_cast<char*>(reinterpret_cast<T1*>(0x100))));
+
152}
+
+
+
+
+ + + + diff --git a/PythonQt_8h_source.html b/PythonQt_8h_source.html new file mode 100644 index 000000000..99c22216e --- /dev/null +++ b/PythonQt_8h_source.html @@ -0,0 +1,873 @@ + + + + + + + +PythonQt: PythonQt.h Source File + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + + +
+
+
PythonQt.h
+
+
+Go to the documentation of this file.
1#ifndef _PYTHONQT_H
+
2#define _PYTHONQT_H
+
3
+
4/*
+
5 *
+
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
+
7 *
+
8 * This library is free software; you can redistribute it and/or
+
9 * modify it under the terms of the GNU Lesser General Public
+
10 * License as published by the Free Software Foundation; either
+
11 * version 2.1 of the License, or (at your option) any later version.
+
12 *
+
13 * This library is distributed in the hope that it will be useful,
+
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
+
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
16 * Lesser General Public License for more details.
+
17 *
+
18 * Further, this software is distributed without any warranty that it is
+
19 * free of the rightful claim of any third person regarding infringement
+
20 * or the like. Any license provided herein, whether implied or
+
21 * otherwise, applies only to this software file. Patent licenses, if
+
22 * any, provided herein do not apply to combinations of this program with
+
23 * other software, or any other product whatsoever.
+
24 *
+
25 * You should have received a copy of the GNU Lesser General Public
+
26 * License along with this library; if not, write to the Free Software
+
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
28 *
+
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
+
30 * 28359 Bremen, Germany or:
+
31 *
+
32 * http://www.mevis.de
+
33 *
+
34 */
+
35
+
36//----------------------------------------------------------------------------------
+
43//----------------------------------------------------------------------------------
+
44
+ +
46#include "PythonQtUtils.h"
+
47#include "PythonQtSystem.h"
+ + +
50#include "PythonQtSlot.h"
+
51#include "PythonQtObjectPtr.h"
+
52#include "PythonQtStdIn.h"
+ +
54#include <QObject>
+
55#include <QVariant>
+
56#include <QList>
+
57#include <QHash>
+
58#include <QByteArray>
+
59#include <QStringList>
+
60#include <QtDebug>
+
61#include <iostream>
+
62
+ +
64class PythonQtPrivate;
+ + + + + + +
71
+
72typedef void PythonQtVoidPtrCB(void* object);
+
73typedef void PythonQtQObjectWrappedCB(QObject* object);
+
74typedef void PythonQtQObjectNoLongerWrappedCB(QObject* object);
+
75typedef void* PythonQtPolymorphicHandlerCB(const void* ptr, const char** class_name);
+
76typedef QString PythonQtQObjectMissingAttributeCB(QObject* object, const QString& attribute);
+
77
+ +
79
+
80template<class T>
+
+ +
82{
+
83 (reinterpret_cast<T*>(object))->_wrapper = wrapper;
+
84}
+
+
85
+
89template<class T>
+
+ +
91{
+
92public:
+
+ +
95 : _t(t)
+
96 {
+
97 }
+
+
99 operator T() const { return _t; }
+
100
+
103 T _t;
+
104};
+
+
105
+
109template<class T>
+
+ +
111{
+
112public:
+
+ +
115 : _t(t)
+
116 {
+
117 }
+
+
119 operator T() const { return _t; }
+
120
+
123 T _t;
+
124};
+
+
125
+
129template<class T>
+
+ +
131{
+
132public:
+
+ +
135 : _t(t)
+
136 {
+
137 }
+
+
139 operator T() const { return _t; }
+
140
+
143 T _t;
+
144};
+
+
145
+
147template<class T1, class T2>
+
+ +
149{
+
150 return ((reinterpret_cast<char*>(static_cast<T2*>(reinterpret_cast<T1*>(0x100))))
+
151 - (reinterpret_cast<char*>(reinterpret_cast<T1*>(0x100))));
+
152}
+
+
153
+ +
156
+
158template<class T>
+
+ +
160{
+
161 return new T();
+
162}
+
+
163
+
165#define QStringToPythonConstCharPointer(arg) ((arg).toUtf8().constData())
+
166#define QStringToPythonCharPointer(arg) ((arg).toUtf8().data())
+
167#define QStringToPythonEncoding(arg) ((arg).toUtf8())
+
168
+
170
+
+
178class PYTHONQT_EXPORT PythonQt : public QObject
+
179{
+
180
+
181 Q_OBJECT
+
182
+
183public:
+
184
+
+ +
187 RedirectStdOut = 1,
+
188 IgnoreSiteModule = 2,
+
189 ExternalHelp = 4,
+
190 PythonAlreadyInitialized = 8
+
191 };
+
+
192
+
+ +
195 Type_Add = 1,
+
196 Type_Subtract = 1 << 1,
+
197 Type_Multiply = 1 << 2,
+
198 Type_Divide = 1 << 3,
+
199 Type_Mod = 1 << 4,
+
200 Type_And = 1 << 5,
+
201 Type_Or = 1 << 6,
+
202 Type_Xor = 1 << 7,
+
203 Type_LShift = 1 << 8,
+
204 Type_RShift = 1 << 9,
+
205
+
206 Type_InplaceAdd = 1 << 10,
+
207 Type_InplaceSubtract = 1 << 11,
+
208 Type_InplaceMultiply = 1 << 12,
+
209 Type_InplaceDivide = 1 << 13,
+
210 Type_InplaceMod = 1 << 14,
+
211 Type_InplaceAnd = 1 << 15,
+
212 Type_InplaceOr = 1 << 16,
+
213 Type_InplaceXor = 1 << 17,
+
214 Type_InplaceLShift = 1 << 18,
+
215 Type_InplaceRShift = 1 << 19,
+
216
+
217 Type_Length = 1 << 20,
+
218 Type_MappingSetItem = 1 << 21,
+
219 Type_MappingGetItem = 1 << 22,
+
220
+
221 Type_EnterExit = 1 << 23,
+
222
+
223 Type_Invert = 1 << 29,
+
224 Type_RichCompare = 1 << 30,
+
225 Type_NonZero = 1 << 31,
+
226
+
227 };
+
+
228
+
230 enum ProfilingCallbackState { Enter = 1, Leave = 2 };
+
231
+
234 typedef void ProfilingCB(ProfilingCallbackState state, const char* className, const char* methodName, PyObject* args);
+
235
+
236 //---------------------------------------------------------------------------
+
238
+
239
+
243 static void init(int flags = IgnoreSiteModule | RedirectStdOut, const QByteArray& pythonQtModuleName = QByteArray());
+
244
+
246 static void cleanup();
+
247
+
249 static PythonQt* self();
+
250
+
252
+
254 enum ObjectType { Class, Function, Variable, Module, Anything, CallOverloads };
+
255
+
256 //---------------------------------------------------------------------------
+
258
+
259
+
262 void setRedirectStdInCallback(PythonQtInputChangedCB* callback, void* callbackData = nullptr);
+
263
+ +
267
+
269
+
270 //---------------------------------------------------------------------------
+
272
+
273
+ +
276
+ +
279
+
281
+
282 //---------------------------------------------------------------------------
+
284
+
285
+ +
288
+
291 PythonQtObjectPtr importModule(const QString& name);
+
292
+
297 PythonQtObjectPtr createModuleFromFile(const QString& name, const QString& filename);
+
298
+
303 PythonQtObjectPtr createModuleFromScript(const QString& name, const QString& script = QString());
+
304
+ +
308
+
310
+
311 //---------------------------------------------------------------------------
+
313
+
314
+
316 void overwriteSysPath(const QStringList& paths);
+
317
+
319 void addSysPath(const QString& path);
+
320
+
322 void setModuleImportPath(PyObject* module, const QStringList& paths);
+
323
+
325
+
326 //---------------------------------------------------------------------------
+
328
+
329
+
331 /* Since Qt4 does not offer a way to detect if a given classname is derived from QObject and thus has a QMetaObject,
+
332 you MUST register all your QObject derived classes here when you want them to be detected in signal and slot calls */
+
333 void registerClass(const QMetaObject* metaobject, const char* package = nullptr,
+
334 PythonQtQObjectCreatorFunctionCB* wrapperCreator = nullptr, PythonQtShellSetInstanceWrapperCB* shell = nullptr);
+
335
+
338
+
344 void registerCPPClass(const char* typeName, const char* parentTypeName = nullptr, const char* package = nullptr,
+
345 PythonQtQObjectCreatorFunctionCB* wrapperCreator = nullptr, PythonQtShellSetInstanceWrapperCB* shell = nullptr);
+
346
+
349 void registerQObjectClassNames(const QStringList& names);
+
350
+
355 bool addParentClass(const char* typeName, const char* parentTypeName, int upcastingOffset = 0);
+
356
+ +
359
+
361
+
362 //---------------------------------------------------------------------------
+
364
+
365
+
367 PythonQtObjectPtr parseFile(const QString& filename);
+
368
+ +
373
+
376 QVariant evalCode(PyObject* object, PyObject* pycode);
+
377
+
379 QVariant evalScript(PyObject* object, const QString& script, int start = Py_file_input);
+
380
+
382 QVariant evalScript(const QString& script, PyObject* globals, PyObject* locals, int start);
+
383
+
385 void evalFile(PyObject* object, const QString& filename);
+
386
+
388
+
389 //---------------------------------------------------------------------------
+
391
+
392
+
394 bool addSignalHandler(QObject* obj, const char* signal, PyObject* module, const QString& objectname);
+
395
+
397 bool removeSignalHandler(QObject* obj, const char* signal, PyObject* module, const QString& objectname);
+
398
+
400 bool addSignalHandler(QObject* obj, const char* signal, PyObject* receiver);
+
401
+
403 bool removeSignalHandler(QObject* obj, const char* signal, PyObject* receiver);
+
404
+ +
407
+
409
+
410 //---------------------------------------------------------------------------
+
412
+
413
+
415 void addObject(PyObject* object, const QString& name, QObject* qObject);
+
416
+
418 void addVariable(PyObject* object, const QString& name, const QVariant& v);
+
419
+
421 void removeVariable(PyObject* module, const QString& name);
+
422
+
424 QVariant getVariable(PyObject* object, const QString& name);
+
425
+
427 QVariant getNativeVariable(PyObject* object, const QString& name);
+
428
+
430 QStringList introspection(PyObject* object, const QString& objectname, ObjectType type);
+
432 QStringList introspectObject(PyObject* object, ObjectType type);
+
437 QStringList introspectType(const QString& typeName, ObjectType type);
+
438
+
441 PythonQtObjectPtr lookupCallable(PyObject* object, const QString& name);
+
442
+
444 QString getReturnTypeOfWrappedMethod(PyObject* module, const QString& objectname);
+
446 QString getReturnTypeOfWrappedMethod(const QString& typeName, const QString& methodName);
+
448
+
449 //---------------------------------------------------------------------------
+
451
+
452
+
454 QVariant call(PyObject* object, const QString& callable, const QVariantList& args = QVariantList(),
+
455 const QVariantMap& kwargs = QVariantMap());
+
456
+
458 QVariant call(PyObject* callable, const QVariantList& args = QVariantList(),
+
459 const QVariantMap& kwargs = QVariantMap());
+
460
+
462 PyObject* callAndReturnPyObject(PyObject* callable, const QVariantList& args = QVariantList(),
+
463 const QVariantMap& kwargs = QVariantMap());
+
464
+
466
+
467 //---------------------------------------------------------------------------
+
469
+
470
+
475
+
496 void addInstanceDecorators(QObject* o);
+
497
+
500
+
514 void addClassDecorators(QObject* o);
+
515
+
517 void addDecorators(QObject* o);
+
518
+ +
521
+ +
524
+ +
527
+ +
530
+
532
+
533 //---------------------------------------------------------------------------
+
535
+
536
+ +
547
+
554 void installDefaultImporter() { setImporter(nullptr); }
+
555
+
557 void setImporterIgnorePaths(const QStringList& paths);
+
558
+
560 const QStringList& getImporterIgnorePaths();
+
561
+ +
564
+
566
+
567 //---------------------------------------------------------------------------
+
569
+
570
+
572 static PythonQtPrivate* priv() { return _self ? _self->_p : nullptr; }
+
573
+ +
577
+
580 bool handleError(bool printStack = true);
+
581
+
583 bool hadError() const;
+
584
+ +
588
+ +
592
+ +
596
+ + +
601
+
603 static void qObjectNoLongerWrappedCB(QObject* o);
+
604
+ +
607
+
609 static QString qObjectMissingAttributeCallback(QObject* o, const QString& attribute);
+
610
+ +
613
+
616 PythonQtObjectPtr lookupObject(PyObject* module, const QString& name);
+
617
+
619 void setProfilingCallback(ProfilingCB* cb);
+
620
+
626 static void setEnableThreadSupport(bool flag);
+
627
+
629
+
630Q_SIGNALS:
+
632 void pythonStdOut(const QString& str);
+
634 void pythonStdErr(const QString& str);
+
635
+
637 void pythonHelpRequest(const QByteArray& cppClassName);
+
638
+
642 void systemExitExceptionRaised(int exitCode);
+
643
+
644private:
+
645 void initPythonQtModule(bool redirectStdOut, const QByteArray& pythonQtModuleName);
+
646
+
647 QString getReturnTypeOfWrappedMethodHelper(const PythonQtObjectPtr& variableObject, const QString& methodName,
+
648 const QString& context);
+
649
+
650 PyObject* getObjectByType(const QString& typeName);
+
651
+
653 static void stdOutRedirectCB(const QString& str);
+
655 static void stdErrRedirectCB(const QString& str);
+
656
+
658 PythonQtSignalReceiver* getSignalReceiver(QObject* obj);
+
659
+
660 PythonQt(int flags, const QByteArray& pythonQtModuleName);
+
661 ~PythonQt() override;
+
662 static PythonQt* _self;
+
663 static int _uniqueModuleCount;
+
664
+
665 PythonQtPrivate* _p;
+
666};
+
+
667
+
668class PythonQtDebugAPI;
+ +
670
+
+
672class PYTHONQT_EXPORT PythonQtPrivate : public QObject
+
673{
+
674
+
675 Q_OBJECT
+
676
+
677public:
+ + +
680
+
+ +
682 StaticDecorator = 1,
+
683 ConstructorDecorator = 2,
+
684 DestructorDecorator = 4,
+
685 InstanceDecorator = 8,
+
686 AllDecorators = 0xffff
+
687 };
+
+
688
+ +
692
+ +
695
+ +
698
+
700 const QStringList& sharedLibrarySuffixes() { return _sharedLibrarySuffixes; }
+
701
+
703 bool isPythonQtObjectPtrMetaId(int id) { return _PythonQtObjectPtr_metaId == id; }
+
705 bool isPythonQtSafeObjectPtrMetaId(int id) { return _PythonQtSafeObjectPtr_metaId == id; }
+
+ +
708 {
+
709 return _PythonQtObjectPtr_metaId == id || _PythonQtSafeObjectPtr_metaId == id;
+
710 }
+
+
711
+ +
715 void removeWrapperPointer(void* obj);
+
716
+
718 void shellClassDeleted(void* shellClass);
+
719
+
721 void* unwrapForeignWrapper(const QByteArray& classname, PyObject* obj);
+
722
+
724 bool addParentClass(const char* typeName, const char* parentTypeName, int upcastingOffset);
+
725
+ +
728
+ +
731
+
733 void removeSignalEmitter(QObject* obj);
+
734
+
736 PyObject* wrapQObject(QObject* obj);
+
737
+
741 PyObject* wrapPtr(void* ptr, const QByteArray& name, bool passOwnership = false);
+
742
+
744 static PyObject* wrapMemoryAsBuffer(const void* data, Py_ssize_t size);
+
745
+
747 static PyObject* wrapMemoryAsBuffer(void* data, Py_ssize_t size);
+
748
+
750 /* Since Qt4 does not offer a way to detect if a given classname is derived from QObject and thus has a QMetaObject,
+
751 you MUST register all your QObject derived classes here when you want them to be detected in signal and slot calls */
+
752 void registerClass(const QMetaObject* metaobject, const char* package = nullptr,
+
753 PythonQtQObjectCreatorFunctionCB* wrapperCreator = nullptr, PythonQtShellSetInstanceWrapperCB* shell = nullptr,
+
754 PyObject* module = nullptr, int typeSlots = 0);
+
755
+
758
+
764 void registerCPPClass(const char* typeName, const char* parentTypeName = nullptr, const char* package = nullptr,
+
765 PythonQtQObjectCreatorFunctionCB* wrapperCreator = nullptr, PythonQtShellSetInstanceWrapperCB* shell = nullptr,
+
766 PyObject* module = nullptr, int typeSlots = 0);
+
767
+
769 void registerGlobalNamespace(const char* typeName, const char* package,
+
770 PythonQtQObjectCreatorFunctionCB* wrapperCreator, const QMetaObject& metaObject, PyObject* module = nullptr);
+
771
+
774 void registerQObjectClassNames(const QStringList& names);
+
775
+
777 void addDecorators(QObject* o, int decoTypes);
+
778
+ +
781 const QByteArray& pythonClassName);
+
782
+
784 static PyObject* createEnumValueInstance(PyObject* enumType, unsigned int enumValue);
+
785
+
787 static PyObject* createNewPythonQtEnumWrapper(const char* enumName, PyObject* parentObject);
+
788
+ +
791 void* wrappedPtr = nullptr);
+
792
+
794 PythonQtClassInfo* getClassInfo(const QMetaObject* meta);
+
795
+
797 PythonQtClassInfo* getClassInfo(const QByteArray& className);
+
798
+
801 void registerLazyClass(const QByteArray& name, const QByteArray& moduleToImport);
+
802
+
804 PythonQtObjectPtr createModule(const QString& name, PyObject* pycode);
+
805
+ +
808
+ +
811
+
813 void handleVirtualOverloadReturnError(const char* signature, const PythonQtMethodInfo* methodInfo, PyObject* result);
+
814
+
816 PythonQtObjectPtr pythonQtModule() const { return _pythonQtModule; }
+
817
+
819 PythonQt::ProfilingCB* profilingCB() const { return _profilingCB; }
+
820
+
822 QString getSignature(PyObject* object);
+
823
+
825 bool isMethodDescriptor(PyObject* object) const;
+
826
+
828 const QMetaObject* getDynamicMetaObject(PythonQtInstanceWrapper* wrapper, const QMetaObject* prototypeMetaObject);
+
829
+
831 const QMetaObject* setupDynamicMetaObjectChain(PythonQtClassWrapper* type, const QMetaObject* prototypeMetaObject);
+
832
+
834 const QMetaObject* buildDynamicMetaObject(PythonQtClassWrapper* type, const QMetaObject* prototypeMetaObject);
+
835
+
837 int handleMetaCall(QObject* object, PythonQtInstanceWrapper* wrapper, QMetaObject::Call call, int id, void** args);
+
838
+
840 void callMethodInPython(QMetaMethod& method, PythonQtInstanceWrapper* wrapper, void** args);
+
841
+
842private:
+
844 void setupSharedLibrarySuffixes();
+
845
+
847 void createPythonQtClassWrapper(PythonQtClassInfo* info, const char* package, PyObject* module = nullptr);
+
848
+
850 PyObject* packageByName(const char* name);
+
851
+
853 PythonQtInstanceWrapper* findWrapperAndRemoveUnused(void* obj);
+
854
+
856 QHash<void*, PythonQtInstanceWrapper*> _wrappedObjects;
+
857
+
859 QHash<QByteArray, PythonQtClassInfo*> _knownClassInfos;
+
860
+
862 QHash<QByteArray, bool> _knownQObjectClassNames;
+
863
+
865 QHash<QByteArray, QByteArray> _knownLazyClasses;
+
866
+
868 QHash<QObject*, PythonQtSignalReceiver*> _signalReceivers;
+
869
+
871 PythonQtObjectPtr _pythonQtModule;
+
872
+
874 QByteArray _pythonQtModuleName;
+
875
+
877 PythonQtImportFileInterface* _importInterface;
+
878
+
880 PythonQtQFileImporter* _defaultImporter;
+
881
+
882 PythonQtQObjectNoLongerWrappedCB* _noLongerWrappedCB;
+
883 PythonQtQObjectWrappedCB* _wrappedCB;
+
884 PythonQtQObjectMissingAttributeCB* _qObjectMissingAttribCB;
+
885
+
886 QStringList _importIgnorePaths;
+
887 QStringList _sharedLibrarySuffixes;
+
888
+
889 PythonQtObjectPtr _pySourceFileLoader;
+
890 PythonQtObjectPtr _pySourcelessFileLoader;
+
891 PythonQtObjectPtr _pyEnsureFuture;
+
892 PythonQtObjectPtr _pyFutureClass;
+
893
+
894 PythonQtObjectPtr _pyTaskDoneCallback;
+
895
+
897 QList<PythonQtCppWrapperFactory*> _cppWrapperFactories;
+
898
+
899 QList<PythonQtForeignWrapperFactory*> _foreignWrapperFactories;
+
900
+
901 QHash<QByteArray, PyObject*> _packages;
+
902
+
903 PythonQtClassInfo* _currentClassInfoForClassWrapperCreation;
+
904
+
905 PythonQt::ProfilingCB* _profilingCB;
+
906
+
907 PythonQtDebugAPI* _debugAPI;
+
908 PythonQtConfigAPI* _configAPI;
+
909
+
910 int _initFlags;
+
911 int _PythonQtObjectPtr_metaId;
+
912 int _PythonQtSafeObjectPtr_metaId;
+
913
+
914 bool _hadError;
+
915 bool _systemExitExceptionHandlerEnabled;
+
916
+
917 friend class PythonQt;
+
918};
+
+
919
+
920#endif
+ + +
struct _object PyObject
+ + + + +
QString PythonQtInputChangedCB(void *callData)
declares the callback that is called from the write() function
+ +
#define PYTHONQT_EXPORT
+ + +
int PythonQtUpcastingOffset()
returns the offset that needs to be added to upcast an object of type T1 to T2
Definition PythonQt.h:148
+
QObject * PythonQtCreateObject()
helper template to create a derived QObject class
Definition PythonQt.h:159
+
void PythonQtQObjectWrappedCB(QObject *object)
Definition PythonQt.h:73
+
void PythonQtShellSetInstanceWrapperCB(void *object, PythonQtInstanceWrapper *wrapper)
Definition PythonQt.h:78
+
void * PythonQtPolymorphicHandlerCB(const void *ptr, const char **class_name)
Definition PythonQt.h:75
+
void PythonQtVoidPtrCB(void *object)
Definition PythonQt.h:72
+
QString PythonQtQObjectMissingAttributeCB(QObject *object, const QString &attribute)
Definition PythonQt.h:76
+
void PythonQtQObjectNoLongerWrappedCB(QObject *object)
Definition PythonQt.h:74
+
void PythonQtSetInstanceWrapperOnShell(void *object, PythonQtInstanceWrapper *wrapper)
Definition PythonQt.h:81
+
QObject * PythonQtQObjectCreatorFunctionCB()
callback to create a QObject lazily
Definition PythonQt.h:155
+
a class that stores all required information about a Qt object (and an optional associated C++ class ...
+
Some methods to set properties of PythonQt from Python.
+
Factory interface for C++ classes that can be wrapped by QObject objects.
+
Some helper methods that allow testing of the ownership.
+ + +
stores information about a specific signal/slot/method
+ + +
PythonQtNewOwnerOfThis(const T &t)
Allow conversion from T to PythonQtNewOwnerOfThis<T>
Definition PythonQt.h:134
+
a smart pointer that stores a PyObject pointer and that handles reference counting automatically
+ +
PythonQtPassOwnershipToCPP(const T &t)
Allow conversion from T to PythonQtPassOwnershipToCPP<T>
Definition PythonQt.h:94
+ + + +
PythonQtPassOwnershipToPython(const T &t)
Allow conversion from T to PythonQtPassOwnershipToPython<T>
Definition PythonQt.h:114
+
internal PythonQt details
Definition PythonQt.h:673
+
void * unwrapForeignWrapper(const QByteArray &classname, PyObject *obj)
try to unwrap the given object to a C++ pointer using the foreign wrapper factories
+
void handleVirtualOverloadReturnError(const char *signature, const PythonQtMethodInfo *methodInfo, PyObject *result)
called by virtual overloads when a python return value can not be converted to the required Qt type
+
static PyObject * wrapMemoryAsBuffer(const void *data, Py_ssize_t size)
create a read-only buffer object from the given memory
+
void registerClass(const QMetaObject *metaobject, const char *package=nullptr, PythonQtQObjectCreatorFunctionCB *wrapperCreator=nullptr, PythonQtShellSetInstanceWrapperCB *shell=nullptr, PyObject *module=nullptr, int typeSlots=0)
registers a QObject derived class to PythonQt (this is implicitly called by addObject as well)
+
const QMetaObject * setupDynamicMetaObjectChain(PythonQtClassWrapper *type, const QMetaObject *prototypeMetaObject)
recursively creates the dynamic meta object chain down to the Qt class wrapper.
+ +
PythonQtClassWrapper * createNewPythonQtClassWrapper(PythonQtClassInfo *info, PyObject *module, const QByteArray &pythonClassName)
helper method that creates a PythonQtClassWrapper object (returns a new reference)
+
void registerQObjectClassNames(const QStringList &names)
+
const QStringList & sharedLibrarySuffixes()
get the suffixes that are used for shared libraries
Definition PythonQt.h:700
+
void removeWrapperPointer(void *obj)
remove the wrapper ptr again
+
void setTaskDoneCallback(const PythonQtObjectPtr &callable)
+
int handleMetaCall(QObject *object, PythonQtInstanceWrapper *wrapper, QMetaObject::Call call, int id, void **args)
redirected from shell classes, tries to call the given meta call on the Python wrapper.
+
PyObject * wrapQObject(QObject *obj)
wrap the given QObject into a Python object (or return existing wrapper!)
+
void addPolymorphicHandler(const char *typeName, PythonQtPolymorphicHandlerCB *cb)
add a handler for polymorphic downcasting
+
static PyObject * createNewPythonQtEnumWrapper(const char *enumName, PyObject *parentObject)
helper that creates a new int derived class that represents the enum of the given name (returns a new...
+
bool isMethodDescriptor(PyObject *object) const
returns true if the object is a method descriptor (same as inspect.ismethoddescriptor() in inspect....
+
void registerCPPClass(const char *typeName, const char *parentTypeName=nullptr, const char *package=nullptr, PythonQtQObjectCreatorFunctionCB *wrapperCreator=nullptr, PythonQtShellSetInstanceWrapperCB *shell=nullptr, PyObject *module=nullptr, int typeSlots=0)
+
static PyObject * wrapMemoryAsBuffer(void *data, Py_ssize_t size)
create a read-write buffer object from the given memory
+ +
bool addParentClass(const char *typeName, const char *parentTypeName, int upcastingOffset)
add parent class relation
+
PythonQtObjectPtr pythonQtModule() const
get access to the PythonQt module
Definition PythonQt.h:816
+
bool isPythonQtSafeObjectPtrMetaId(int id)
returns if the id is the id for PythonQtSafeObjectPtr
Definition PythonQt.h:705
+
PythonQtClassInfo * currentClassInfoForClassWrapperCreation()
get the current class info (for the next PythonQtClassWrapper that is created) and reset it to NULL a...
+
QString getSignature(PyObject *object)
determines the signature of the given callable object (similar as pydoc)
+
PythonQtObjectPtr checkAndRunCoroutine(const PythonQtObjectPtr &object)
Runs the given coroutine (via asyncio), returns a scheduled task if it object is a coroutine.
+
bool isPythonQtObjectPtrMetaId(int id)
returns if the id is the id for PythonQtObjectPtr
Definition PythonQt.h:703
+
PythonQtClassInfo * lookupClassInfoAndCreateIfNotPresent(const char *typeName)
lookup existing classinfo and return new if not yet present
+
PythonQtObjectPtr createModule(const QString &name, PyObject *pycode)
creates the new module from the given pycode
+
void callMethodInPython(QMetaMethod &method, PythonQtInstanceWrapper *wrapper, void **args)
calls the given method on Python function with same name.
+
bool isPythonQtAnyObjectPtrMetaId(int id)
returns if the id is either PythonQtObjectPtr or PythonQtSafeObjectPtr
Definition PythonQt.h:707
+
const QMetaObject * buildDynamicMetaObject(PythonQtClassWrapper *type, const QMetaObject *prototypeMetaObject)
builds and returns the dynamic meta object for the given type, derived from prototypeMetaObject.
+
void registerLazyClass(const QByteArray &name, const QByteArray &moduleToImport)
+
const QMetaObject * getDynamicMetaObject(PythonQtInstanceWrapper *wrapper, const QMetaObject *prototypeMetaObject)
get the dynamic meta object for the given wrapper. It will contain the signals/slots that have been a...
+
static PyObject * createEnumValueInstance(PyObject *enumType, unsigned int enumValue)
create a new instance of the given enum type with given value (returns a new reference)
+
static PyObject * dummyTuple()
the dummy tuple (which is empty and may be used to detected that a wrapper is called from internal wr...
+
PyObject * wrapPtr(void *ptr, const QByteArray &name, bool passOwnership=false)
+
void addWrapperPointer(void *obj, PythonQtInstanceWrapper *wrapper)
add the wrapper pointer (for reuse if the same obj appears while wrapper still exists)
+
PythonQtClassInfo * getClassInfo(const QMetaObject *meta)
get the class info for a meta object (if available)
+
void shellClassDeleted(void *shellClass)
called by destructor of shells to allow invalidation of the Python wrapper
+
void registerGlobalNamespace(const char *typeName, const char *package, PythonQtQObjectCreatorFunctionCB *wrapperCreator, const QMetaObject &metaObject, PyObject *module=nullptr)
Same as above, but all enums of the created wrapper will also be added to the given package and to th...
+
PythonQtObjectPtr createAsyncioFuture()
Creates a new asyncio.Future object.
+
void removeSignalEmitter(QObject *obj)
called when a signal emitting QObject is destroyed to remove the signal handler from the hash map
+
void addDecorators(QObject *o, int decoTypes)
add a decorator object
+
~PythonQtPrivate() override
+
PythonQtClassInfo * getClassInfo(const QByteArray &className)
get the class info for a meta object (if available)
+
PythonQtInstanceWrapper * createNewPythonQtInstanceWrapper(QObject *obj, PythonQtClassInfo *info, void *wrappedPtr=nullptr)
helper method that creates a PythonQtInstanceWrapper object and registers it in the object map
+
PythonQt::ProfilingCB * profilingCB() const
returns the profiling callback, which may be NULL
Definition PythonQt.h:819
+
default importer implementation using QFile to load python code
+
receives all signals for one QObject
+
The main interface to the Python Qt binding, realized as a singleton.
Definition PythonQt.h:179
+
QVariant call(PyObject *object, const QString &callable, const QVariantList &args=QVariantList(), const QVariantMap &kwargs=QVariantMap())
call the given python callable in the scope of object, returns the result converted to a QVariant
+
PythonQtObjectPtr lookupCallable(PyObject *object, const QString &name)
+
static QString qObjectMissingAttributeCallback(QObject *o, const QString &attribute)
call the callback if it is set
+
void systemExitExceptionRaised(int exitCode)
+
void evalFile(PyObject *object, const QString &filename)
evaluates the given script code from file
+
void addInstanceDecorators(QObject *o)
+
bool removeSignalHandler(QObject *obj, const char *signal, PyObject *receiver)
remove a signal handler from the given signal of obj
+
PythonQtObjectPtr createModuleFromFile(const QString &name, const QString &filename)
+
void setQObjectMissingAttributeCallback(PythonQtQObjectMissingAttributeCB *cb)
set a callback that is called when a QObject does not have a specific attribute.
+
void setSystemExitExceptionHandlerEnabled(bool value)
+
void addClassDecorators(QObject *o)
+
PythonQtObjectPtr importModule(const QString &name)
+
InitFlags
flags that can be passed to PythonQt::init()
Definition PythonQt.h:186
+
QString getReturnTypeOfWrappedMethod(const QString &typeName, const QString &methodName)
returns the return type of the method methodName of a wrapped c++ type referenced by typeName
+
static void init(int flags=IgnoreSiteModule|RedirectStdOut, const QByteArray &pythonQtModuleName=QByteArray())
+
ObjectType
defines the object types for introspection
Definition PythonQt.h:254
+ +
ProfilingCallbackState
enum for profiling callback
Definition PythonQt.h:230
+
static void cleanup()
cleanup of the singleton
+
static void setEnableThreadSupport(bool flag)
+
void registerCPPClass(const char *typeName, const char *parentTypeName=nullptr, const char *package=nullptr, PythonQtQObjectCreatorFunctionCB *wrapperCreator=nullptr, PythonQtShellSetInstanceWrapperCB *shell=nullptr)
+
void addSysPath(const QString &path)
prepend a path to sys.path to allow importing from it
+
TypeSlots
flags that tell PythonQt which operators to expect on the registered type
Definition PythonQt.h:194
+
bool addParentClass(const char *typeName, const char *parentTypeName, int upcastingOffset=0)
+
bool hadError() const
return true if handleError() has been called and an error occurred.
+
void registerQObjectClassNames(const QStringList &names)
+
void addWrapperFactory(PythonQtCppWrapperFactory *factory)
add the given factory to PythonQt (ownership stays with caller)
+
PythonQtObjectPtr parseFile(const QString &filename)
parses the given file (using PythonQt's own import mechanism) and returns the python code object,...
+
void registerClass(const QMetaObject *metaobject, const char *package=nullptr, PythonQtQObjectCreatorFunctionCB *wrapperCreator=nullptr, PythonQtShellSetInstanceWrapperCB *shell=nullptr)
registers a QObject derived class to PythonQt (this is implicitly called by addObject as well)
+
void setRedirectStdInCallbackEnabled(bool enabled)
+
void removeVariable(PyObject *module, const QString &name)
remove the given variable
+
void removeWrapperFactory(PythonQtCppWrapperFactory *factory)
remove the wrapper factory
+
bool addSignalHandler(QObject *obj, const char *signal, PyObject *receiver)
add a signal handler to the given signal of obj and connect it to a callable receiver
+
QVariant getNativeVariable(PyObject *object, const QString &name)
get the variable with the name of the object as QVariant of type PythonQtObjectPtr,...
+
QVariant evalScript(const QString &script, PyObject *globals, PyObject *locals, int start)
evaluates the given script code in context of given globals and locals and returns the result value
+
QVariant evalCode(PyObject *object, PyObject *pycode)
+
QVariant evalScript(PyObject *object, const QString &script, int start=Py_file_input)
evaluates the given script code and returns the result value
+
static void qObjectNoLongerWrappedCB(QObject *o)
call the callback if it is set
+
void setRedirectStdInCallback(PythonQtInputChangedCB *callback, void *callbackData=nullptr)
+
const QStringList & getImporterIgnorePaths()
get paths that the importer should ignore
+
void setImporter(PythonQtImportFileInterface *importInterface)
+
PythonQtObjectPtr createModuleFromScript(const QString &name, const QString &script=QString())
+
QStringList introspection(PyObject *object, const QString &objectname, ObjectType type)
read vars etc. in scope of an object, optional looking inside of an object objectname
+
void addObject(PyObject *object, const QString &name, QObject *qObject)
add the given qObject to the python object as a variable with name (it can be removed via clearVariab...
+
void pythonStdErr(const QString &str)
emitted when python outputs something to stderr (and redirection is turned on)
+
void installDefaultImporter()
Definition PythonQt.h:554
+
void addPolymorphicHandler(const char *typeName, PythonQtPolymorphicHandlerCB *cb)
add a handler for polymorphic downcasting
+
PyObject * helpCalled(PythonQtClassInfo *info)
called by internal help methods
+
void clearError()
+
void setModuleImportPath(PyObject *module, const QStringList &paths)
sets the path list of a module to the given list (important for local imports)
+
void removeSignalHandlers()
globally removes all signal handlers (connections between QObjects and Python).
+
void addVariable(PyObject *object, const QString &name, const QVariant &v)
add the given variable to the object
+
PythonQtObjectPtr getMainModule()
get the main module of python
+
void addDecorators(QObject *o)
this will add the object both as class and instance decorator (ownership is passed to PythonQt)
+
void setQObjectWrappedCallback(PythonQtQObjectWrappedCB *cb)
set a callback that is called when a QObject with parent == NULL is wrapped by PythonQt
+
QVariant call(PyObject *callable, const QVariantList &args=QVariantList(), const QVariantMap &kwargs=QVariantMap())
call the given python object, returns the result converted to a QVariant
+
bool systemExitExceptionHandlerEnabled() const
+
void addWrapperFactory(PythonQtForeignWrapperFactory *factory)
add the given factory to PythonQt (ownership stays with caller)
+
QVariant getVariable(PyObject *object, const QString &name)
get the variable with the name of the object, returns an invalid QVariant on error
+
void removeWrapperFactory(PythonQtForeignWrapperFactory *factory)
remove the wrapper factory
+
static PythonQtPrivate * priv()
get access to internal data (should not be used on the public API, but is used by some C functions)
Definition PythonQt.h:572
+
PythonQtObjectPtr lookupObject(PyObject *module, const QString &name)
+
void setImporterIgnorePaths(const QStringList &paths)
set paths that the importer should ignore
+
void setRedirectStdOutCallbackEnabled(bool enabled)
enable or disable std out/err redirection to pythonStdOut() and pythonStdErr() signals.
+
void pythonHelpRequest(const QByteArray &cppClassName)
emitted when help() is called on a PythonQt object and ExternalHelp is enabled
+
bool removeSignalHandler(QObject *obj, const char *signal, PyObject *module, const QString &objectname)
remove a signal handler from the given signal of obj
+
PyObject * callAndReturnPyObject(PyObject *callable, const QVariantList &args=QVariantList(), const QVariantMap &kwargs=QVariantMap())
call the given python object, returns the result as new PyObject
+
QString getReturnTypeOfWrappedMethod(PyObject *module, const QString &objectname)
returns the return type of the method of a wrapped c++ object referenced by objectname
+
bool addSignalHandler(QObject *obj, const char *signal, PyObject *module, const QString &objectname)
add a signal handler to the given signal of obj and connect it to a callable objectname in module
+
void setQObjectNoLongerWrappedCallback(PythonQtQObjectNoLongerWrappedCB *cb)
set a callback that is called when a QObject with parent == NULL is no longer wrapped by PythonQt
+
bool redirectStdOutCallbackEnabled() const
return true if std out/err redirection is enabled.
+
static PythonQtImportFileInterface * importInterface()
get access to the file importer (if set)
+
PythonQtObjectPtr parseFileWithPythonLoaders(const QString &filename)
+
void pythonStdOut(const QString &str)
emitted when python outputs something to stdout (and redirection is turned on)
+
void overwriteSysPath(const QStringList &paths)
overwrite the python sys path (call this directly after PythonQt::init() if you want to change the st...
+
void ProfilingCB(ProfilingCallbackState state, const char *className, const char *methodName, PyObject *args)
Definition PythonQt.h:234
+
static PythonQt * self()
get the singleton instance
+
QStringList introspectObject(PyObject *object, ObjectType type)
read vars etc. in scope of the given object
+
void clearNotFoundCachedMembers()
+
bool handleError(bool printStack=true)
+
PythonQtObjectPtr createUniqueModule()
+
QStringList introspectType(const QString &typeName, ObjectType type)
+
void setProfilingCallback(ProfilingCB *cb)
sets a callback that is called before and after function calls for profiling
+ +
a Python wrapper object for Qt objects and C++ objects (that are themselves wrapped by wrapper QObjec...
+
+ + + + diff --git a/README.md b/README.md deleted file mode 100644 index 210777e8c..000000000 --- a/README.md +++ /dev/null @@ -1,129 +0,0 @@ -# PythonQt - -[![License](https://img.shields.io/github/license/mevislab/pythonqt.svg?color=blue)](LICENSE) - -PythonQt is a dynamic [Python](https://www.python.org) binding for [Qt](https://www.qt.io). -It offers an easy way to embed the Python scripting language into -your Qt applications. - -# Documentation - -API documentation is available at: https://mevislab.github.io/pythonqt - -# Licensing - -PythonQt is distributed under the `LGPL 2.1` license. - -## Licensing of Generator - -The build system of PythonQt makes use of a patched version of the LGPL'ed QtScript -generator, located in the `generator` directory. - -See the `LICENSE.LGPL` file in the generator subdirectory for details. -Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) - -See https://code.qt.io/cgit/qt-labs/qtscriptgenerator.git for the original project. -The PythonQt wrappers generated by the generator are distributed under the `LGPL` -as well. - -The integrated preprocessor has been replaced with code from the simplecpp project, -see https://github.com/danmar/simplecpp. It is licensed under the `0BSDL` license, -see the `LICENSE` file in the generator/simplecpp directory. -Copyright (C) 2016-2023 simplecpp team - -Wrappers are **not** shipped pre-generated. You must run the generator to -create wrappers for your Qt version. The repository may keep a -single example tree (e.g., `generated_cpp_515`) only as a reference. - -# Building - -## General - -Building PythonQt requires a couple of steps. -Follow these instructions in order to get a correctly built PythonQt runtime and Qt bindings. - -### Environment - -First, you need to set a couple of environment variables, which depend on your Python and Qt installation. - -- `PYTHON_VERSION` - - Set the version of your Python interpreter. The syntax is `.`, e.g., `3.10`. - -- `PYTHON_PATH` - - This is the absolute path to the root directory of your Python installation. - -- `PYTHON_LIB` - - The absolute path to the `libs` directory in your python installation `$PYTHON_PATH/libs`. - -- `PYTHON_DIR` - - The `PYTHON_DIR` is required for non-Windows installations to find the `python-config` executable. - This should have the same value as `PYTHON_PATH`. - -- `QTDIR` - - The absolute path to the root directory of your Qt installation. - -### Binding Generator - -1. Configure the generator at the top level - - ```bash - qmake CONFIG+=generator_only CONFIG+=Release PythonQt.pro - ``` - -2. Build the generator - - Use `nmake` for MSVC (Visual Studio; make sure to have the environment variables set for Visual Studio beforehand). Otherwise, use `make`. - -3. Generate the bindings - - Use the generator executable from step 2 to generate the bindings. - The location of the generator executable can vary depending on your platform (the subdirectory is named after the current configuration, e.g., `release`). - On Windows, the generator is named `pythonqt_generator.exe`; on all other platforms, it is named `pythonqt_generator`. - - ```bash - qtscript_masterinclude.h build_all.txt - ``` - - -**Output location:** by default the generator emits to `../generated_cpp` -(relative to the build). You can override this with: - -```bash -qmake PYTHONQT_GENERATED_PATH=/abs/path/to/generated_cpp -``` - -#### qmake toggles (optional) - -* `CONFIG+=generator_only`: build only the wrapper generator. -* `CONFIG+=exclude_generator`: build everything **except** the generator. - -Use these to (1) build the generator, (2) run it to produce `generated_cpp`, then (3) build the rest without rebuilding the generator. - - -### PythonQt Runtime - -Next, build the runtime (and extensions) without the generator. - -1. Configure at the top level - - ``` - qmake CONFIG+=Release CONFIG+=exclude_generator PythonQt.pro - ``` - -2. Build - - Use `nmake` for MSVC (Visual Studio; make sure to have the environment variables set for Visual Studio beforehand). Otherwise, use `make`. - -> The build will fail early if wrappers are missing from `../generated_cpp` -> or the path specified via `PYTHONQT_GENERATED_PATH`. - -After all these steps, you should now have a fully working PythonQt runtime and Qt bindings for your Python/Qt installation 🎉. - -## MinGW - -It is possible to build PythonQt with MinGW on Windows instead of using MSVC. diff --git a/annotated.html b/annotated.html new file mode 100644 index 000000000..199193258 --- /dev/null +++ b/annotated.html @@ -0,0 +1,99 @@ + + + + + + + +PythonQt: Class List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
Class List
+
+
+
Here are the classes, structs, unions and interfaces with brief descriptions:
+
[detail level 12]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 CPythonQtThe main interface to the Python Qt binding, realized as a singleton
 CPythonQtArgumentFrameStores C++ arguments for a qt_metacall (which are created when converting data from Python to C++)
 CPythonQtBoolResultObjectDefines a python object that stores a single bool
 CPythonQtClassInfoClass that stores all required information about a Qt object (and an optional associated C++ class name)
 CParentClassInfoStore information about parent classes
 CPythonQtClassWrapper
 CPythonQtConfigAPISome methods to set properties of PythonQt from Python
 CPythonQtConvStatic class that offers methods for type conversion
 CPythonQtCppWrapperFactoryFactory interface for C++ classes that can be wrapped by QObject objects
 CPythonQtDebugAPISome helper methods that allow testing of the ownership
 CPythonQtDynamicClassInfo
 CPythonQtDynamicSignalInfo
 CPythonQtForeignWrapperFactory
 CPythonQtGILScope
 CPythonQtImportImplements importing of python files into PythonQt
 CModuleInfo
 CPythonQtImporterDefines a python object that stores a Qt slot info
 CPythonQtImportFileInterface
 CPythonQtInstanceWrapperPython wrapper object for Qt objects and C++ objects (that are themselves wrapped by wrapper QObjects)
 CPythonQtMemberInfo
 CPythonQtMethodInfoStores information about a specific signal/slot/method
 CParameterInfoStores various informations about a parameter/type name
 CPythonQtNewOwnerOfThis
 CPythonQtObjectPtrSmart pointer that stores a PyObject pointer and that handles reference counting automatically
 CPythonQtPassOwnershipToCPP
 CPythonQtPassOwnershipToPython
 CPythonQtPrivateInternal PythonQt details
 CPythonQtProperty
 CPythonQtPropertyData
 CPythonQtQFileImporterDefault importer implementation using QFile to load python code
 CPythonQtSafeObjectPtrSmart pointer that stores a PyObject pointer and that handles reference counting automatically
 CPythonQtSignalFunctionObjectDefines a python object that stores a Qt signal info
 CPythonQtSignalReceiverReceives all signals for one QObject
 CPythonQtSignalReceiverBaseBase class for signal receivers
 CPythonQtSignalTargetStores information about a signal target
 CPythonQtSingleShotTimer
 CPythonQtSlotDecorator
 CPythonQtSlotFunctionObjectDefines a python object that stores a Qt slot info
 CPythonQtSlotInfoStores information about a slot, including a next pointer to overloaded slots
 CPythonQtStdDecorators
 CPythonQtStdInRedirectDeclares the stdin redirection class
 CPythonQtStdOutRedirectDeclares the stdout redirection class
 CPythonQtThreadStateSaver
 CPythonQtWrapper_QMetaObject
+
+
+ + + + diff --git a/bc_s.png b/bc_s.png new file mode 100644 index 000000000..224b29aa9 Binary files /dev/null and b/bc_s.png differ diff --git a/bc_sd.png b/bc_sd.png new file mode 100644 index 000000000..31ca888dc Binary files /dev/null and b/bc_sd.png differ diff --git a/build/PythonQt.prf b/build/PythonQt.prf deleted file mode 100644 index fb80d3efc..000000000 --- a/build/PythonQt.prf +++ /dev/null @@ -1,18 +0,0 @@ -# profile for non-mevis users to link to PythonQt - -include ( python.prf ) - -INCLUDEPATH += $$PWD/../src - -# check if debug or release -CONFIG(debug, debug|release) { - DEBUG_EXT = _d -} else { - DEBUG_EXT = -} - -PYTHONQT_LIB_NAME=PythonQt-Qt$${QT_MAJOR_VERSION}-Python$${PYTHON_VERSION}$${DEBUG_EXT} - -win32-g++: LIBS += $$DESTDIR/../lib/$${PYTHONQT_LIB_NAME}.dll -win32-*msvc*: LIBS += $$DESTDIR/../lib/$${PYTHONQT_LIB_NAME}.lib -unix: LIBS += -L$$DESTDIR/../lib -l$${PYTHONQT_LIB_NAME} diff --git a/build/PythonQt_QtAll.prf b/build/PythonQt_QtAll.prf deleted file mode 100644 index 02f4ad2f2..000000000 --- a/build/PythonQt_QtAll.prf +++ /dev/null @@ -1,15 +0,0 @@ -# profile for non-mevis users to link to PythonQt_QtAll - -INCLUDEPATH += $$PWD/../extensions/PythonQt_QtAll - -# check if debug or release -CONFIG(debug, debug|release) { - DEBUG_EXT = _d -} else { - DEBUG_EXT = -} - - -win32-g++: LIBS += $$DESTDIR/../lib/PythonQt_QtAll-Qt$${QT_MAJOR_VERSION}-Python$${PYTHON_VERSION}$${DEBUG_EXT}.dll -win32-msvc*: LIBS += $$DESTDIR/../lib/PythonQt_QtAll-Qt$${QT_MAJOR_VERSION}-Python$${PYTHON_VERSION}$${DEBUG_EXT}.lib -unix: LIBS += -L$$DESTDIR/../lib -lPythonQt_QtAll-Qt$${QT_MAJOR_VERSION}-Python$${PYTHON_VERSION}$${DEBUG_EXT} \ No newline at end of file diff --git a/build/common.prf b/build/common.prf deleted file mode 100644 index ba3b80ada..000000000 --- a/build/common.prf +++ /dev/null @@ -1,56 +0,0 @@ - -# depending on your Qt configuration, you want to enable or disable -# one of the release/debug builds (if all three lines are commented, -# the default of your Qt installation will used) - -# build with both debug and release mode -#CONFIG += debug_and_release build_all - -# build with release mode only -#CONFIG += release - -# build with debug mode only -#CONFIG += debug - -# for all debug builds, add "_d" extension to target -CONFIG(debug, debug|release) { - TARGET = $${TARGET}_d -} - -# Allow override (e.g., qmake PYTHONQT_GENERATED_PATH=/abs/path) -isEmpty(PYTHONQT_GENERATED_PATH) { - PYTHONQT_GENERATED_PATH = $$PWD/../generated_cpp -} - -# Fallbacks to checked-in wrappers -!exists($$PYTHONQT_GENERATED_PATH) { - # Exact version directory (e.g., generated_cpp_515 or generated_cpp_69) - PYTHONQT_GENERATED_PATH_VERSIONED = $$PWD/../generated_cpp_$${QT_MAJOR_VERSION}$${QT_MINOR_VERSION} - exists($$PYTHONQT_GENERATED_PATH_VERSIONED) { - PYTHONQT_GENERATED_PATH = $$PYTHONQT_GENERATED_PATH_VERSIONED - } -} - -!exists($$PYTHONQT_GENERATED_PATH) { - error("No generated wrapper sources for Qt $${QT_VERSION}.\n" \ - "Looked in:\n" \ - " - $$PWD/../generated_cpp\n" \ - " - $$PWD/../generated_cpp_$${QT_MAJOR_VERSION}$${QT_MINOR_VERSION} (e.g., generated_cpp_515)\n" \ - "Generate them first:\n" \ - " qmake CONFIG+=generator_only && make\n" \ - " cd generator && ./pythonqt_generator\n" \ - "Or pass an explicit path:\n" \ - " qmake PYTHONQT_GENERATED_PATH=/abs/path") -} - -!build_pass { - message("Qt version: Qt$${QT_VERSION}") - message("Using generated sources files from $${PYTHONQT_GENERATED_PATH}") -} - -VERSION = 3.2.0 -win32: CONFIG += skip_target_version_ext -gcc|win32-clang-msvc:QMAKE_CXXFLAGS += -Wno-deprecated-declarations -Wuninitialized -Winit-self -pedantic -win32-clang-msvc:QMAKE_CXXFLAGS += -Wno-unused-command-line-argument -#Do not issue warning to system includes -gcc:!isEmpty(QT_INSTALL_HEADERS): QMAKE_CXXFLAGS += -isystem $$[QT_INSTALL_HEADERS] diff --git a/build/python.prf b/build/python.prf deleted file mode 100644 index 900a54121..000000000 --- a/build/python.prf +++ /dev/null @@ -1,97 +0,0 @@ -# profile to include and link Python - - -# Change this variable to your python version (3.7, 3.8, ...) -isEmpty( PYTHON_VERSION ) { - PYTHON_VERSION=$$(PYTHON_VERSION) -} -isEmpty( PYTHON_VERSION ) { - PYTHON_VERSION=3.10 -} - -isEmpty( PYTHON_DIR ) { - PYTHON_DIR=$$(PYTHON_DIR) -} -!isEmpty( PYTHON_DIR ) { - PYTHON_DIR=$${PYTHON_DIR}/ -} - -PYTHON_VERSION_MAJOR=$$section(PYTHON_VERSION, ., 0, 0) -PYTHON_VERSION_MINOR=$$section(PYTHON_VERSION, ., 1, 1) - -!equals(PYTHON_VERSION, $${PYTHON_VERSION_MAJOR}.$${PYTHON_VERSION_MINOR}) { - error("Failed to parse PYTHON_VERSION:\"$$PYTHON_VERSION\"") -} else { - message(Using Python version $${PYTHON_VERSION}) -} - -# Python 3.x is required -equals(PYTHON_VERSION_MAJOR, 2) { - error("Python >= 3.x is required") -} - -contains(PKGCONFIG, "python.*"){ -# If `pkg-config` is configured, use `qmake PKGCONFIG+=python3.10-embed CONFIG+=...` -# or `PKGCONFIG+=python2.7m`-like form for older versions, -# see `pkg-config --list-all | grep python` for details. -# This can help with GNU/Linux (including macOS with Homebrew), MSYS2/MinGW environment, -# and also with OpenEmbedded and other cross-builds - CONFIG += link_pkgconfig - PYTHON_PKGCONFIG = $$member($$unique($$find(PKGCONFIG, "python.*")), 1, 1) - # add rpath - PYTHON_LIBDIR = $$system($$pkgConfigExecutable() --libs-only-L $$PYTHON_PKGCONFIG) - QMAKE_RPATHDIR += $$replace(PYTHON_LIBDIR,-L,) -} else:macx:isEmpty(PYTHON_DIR){ - # for macx you need to have the Python development kit installed as framework - INCLUDEPATH += /System/Library/Frameworks/Python.framework/Headers - LIBS += -F/System/Library/Frameworks -framework Python -} else:win32 { - # for windows install a Python development kit or build Python yourself from the sources - # Make sure that you set the environment variable PYTHON_PATH to point to your - # python installation (or the python sources/header files when building from source). - # - # When using the prebuild Python installer, this will be: - # set PYTHON_PATH = c:\Python310 - # - # When using the python sources, this will be something like: - # set PYTHON_PATH = c:\yourDir\Python-3.10.12\ - - # check if debug or release - CONFIG(debug, debug|release) { - DEBUG_EXT = _d - } else { - DEBUG_EXT = - } - - isEmpty(PYTHON_PATH):PYTHON_PATH=$(PYTHON_PATH) - isEmpty(PYTHON_PATH)|!exists("$$PYTHON_PATH\\include") | !exists("$$PYTHON_PATH\\libs\\") { - error("PYTHON_PATH must be set to correct folder with \\libs and \\include subfolders ") - } - - INCLUDEPATH += $$shell_path($${PYTHON_PATH}/include) - - LIBS += $$shell_path(-L$${PYTHON_PATH}/libs) - LIBS += -lpython$${PYTHON_VERSION_MAJOR}$${PYTHON_VERSION_MINOR}$${DEBUG_EXT} - - # Hack for "CONFIG+=testcase" and 'make check' to add python's dll to PATH - deppath += $$shell_path($${PYTHON_PATH}) - -} else:unix { - # on linux, python-config is used to autodetect Python. - # make sure that you have installed a matching python-dev package. - - PYTHON_CONFIG = $${PYTHON_DIR}/bin/python$${PYTHON_VERSION}-config - PYTHON_CONFIG_OPTIONS_LIBS = --libs - equals(PYTHON_VERSION_MAJOR, 3):!lessThan(PYTHON_VERSION_MINOR, 8) { - # Since 3.8 `--embed` is needed - PYTHON_CONFIG_OPTIONS_LIBS += --embed - } - LIBS += $$system($${PYTHON_CONFIG} $${PYTHON_CONFIG_OPTIONS_LIBS}) - QMAKE_CXXFLAGS += $$system($${PYTHON_CONFIG} --includes) - PYTHON_LFLAGS = $$system($${PYTHON_CONFIG} --ldflags) - QMAKE_LFLAGS += $${PYTHON_LFLAGS} - # add rpath - PYTHON_LIBDIR = $$find(PYTHON_LFLAGS,-L.*) - PYTHON_RPATH = $$replace(PYTHON_LIBDIR,-L,) - QMAKE_RPATHDIR += $$PYTHON_RPATH -} diff --git a/classPythonQt-members.html b/classPythonQt-members.html new file mode 100644 index 000000000..87a00770f --- /dev/null +++ b/classPythonQt-members.html @@ -0,0 +1,175 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQt Member List
+
+
+ +

This is the complete list of members for PythonQt, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
addClassDecorators(QObject *o)PythonQt
addDecorators(QObject *o)PythonQt
addInstanceDecorators(QObject *o)PythonQt
addObject(PyObject *object, const QString &name, QObject *qObject)PythonQt
addParentClass(const char *typeName, const char *parentTypeName, int upcastingOffset=0)PythonQt
addPolymorphicHandler(const char *typeName, PythonQtPolymorphicHandlerCB *cb)PythonQt
addSignalHandler(QObject *obj, const char *signal, PyObject *module, const QString &objectname)PythonQt
addSignalHandler(QObject *obj, const char *signal, PyObject *receiver)PythonQt
addSysPath(const QString &path)PythonQt
addVariable(PyObject *object, const QString &name, const QVariant &v)PythonQt
addWrapperFactory(PythonQtCppWrapperFactory *factory)PythonQt
addWrapperFactory(PythonQtForeignWrapperFactory *factory)PythonQt
Anything enum valuePythonQt
call(PyObject *object, const QString &callable, const QVariantList &args=QVariantList(), const QVariantMap &kwargs=QVariantMap())PythonQt
call(PyObject *callable, const QVariantList &args=QVariantList(), const QVariantMap &kwargs=QVariantMap())PythonQt
callAndReturnPyObject(PyObject *callable, const QVariantList &args=QVariantList(), const QVariantMap &kwargs=QVariantMap())PythonQt
CallOverloads enum valuePythonQt
Class enum valuePythonQt
cleanup()PythonQtstatic
clearError()PythonQt
clearNotFoundCachedMembers()PythonQt
createModuleFromFile(const QString &name, const QString &filename)PythonQt
createModuleFromScript(const QString &name, const QString &script=QString())PythonQt
createUniqueModule()PythonQt
Enter enum valuePythonQt
evalCode(PyObject *object, PyObject *pycode)PythonQt
evalFile(PyObject *object, const QString &filename)PythonQt
evalScript(PyObject *object, const QString &script, int start=Py_file_input)PythonQt
evalScript(const QString &script, PyObject *globals, PyObject *locals, int start)PythonQt
ExternalHelp enum valuePythonQt
Function enum valuePythonQt
getImporterIgnorePaths()PythonQt
getMainModule()PythonQt
getNativeVariable(PyObject *object, const QString &name)PythonQt
getReturnTypeOfWrappedMethod(PyObject *module, const QString &objectname)PythonQt
getReturnTypeOfWrappedMethod(const QString &typeName, const QString &methodName)PythonQt
getVariable(PyObject *object, const QString &name)PythonQt
hadError() constPythonQt
handleError(bool printStack=true)PythonQt
helpCalled(PythonQtClassInfo *info)PythonQt
IgnoreSiteModule enum valuePythonQt
importInterface()PythonQtstatic
importModule(const QString &name)PythonQt
init(int flags=IgnoreSiteModule|RedirectStdOut, const QByteArray &pythonQtModuleName=QByteArray())PythonQtstatic
InitFlags enum namePythonQt
installDefaultImporter()PythonQtinline
introspection(PyObject *object, const QString &objectname, ObjectType type)PythonQt
introspectObject(PyObject *object, ObjectType type)PythonQt
introspectType(const QString &typeName, ObjectType type)PythonQt
Leave enum valuePythonQt
lookupCallable(PyObject *object, const QString &name)PythonQt
lookupObject(PyObject *module, const QString &name)PythonQt
Module enum valuePythonQt
ObjectType enum namePythonQt
overwriteSysPath(const QStringList &paths)PythonQt
parseFile(const QString &filename)PythonQt
parseFileWithPythonLoaders(const QString &filename)PythonQt
priv()PythonQtinlinestatic
ProfilingCallbackState enum namePythonQt
ProfilingCB typedefPythonQt
PythonAlreadyInitialized enum valuePythonQt
pythonHelpRequest(const QByteArray &cppClassName)PythonQtsignal
pythonStdErr(const QString &str)PythonQtsignal
pythonStdOut(const QString &str)PythonQtsignal
qObjectMissingAttributeCallback(QObject *o, const QString &attribute)PythonQtstatic
qObjectNoLongerWrappedCB(QObject *o)PythonQtstatic
RedirectStdOut enum valuePythonQt
redirectStdOutCallbackEnabled() constPythonQt
registerClass(const QMetaObject *metaobject, const char *package=nullptr, PythonQtQObjectCreatorFunctionCB *wrapperCreator=nullptr, PythonQtShellSetInstanceWrapperCB *shell=nullptr)PythonQt
registerCPPClass(const char *typeName, const char *parentTypeName=nullptr, const char *package=nullptr, PythonQtQObjectCreatorFunctionCB *wrapperCreator=nullptr, PythonQtShellSetInstanceWrapperCB *shell=nullptr)PythonQt
registerQObjectClassNames(const QStringList &names)PythonQt
removeSignalHandler(QObject *obj, const char *signal, PyObject *module, const QString &objectname)PythonQt
removeSignalHandler(QObject *obj, const char *signal, PyObject *receiver)PythonQt
removeSignalHandlers()PythonQt
removeVariable(PyObject *module, const QString &name)PythonQt
removeWrapperFactory(PythonQtCppWrapperFactory *factory)PythonQt
removeWrapperFactory(PythonQtForeignWrapperFactory *factory)PythonQt
self()PythonQtstatic
setEnableThreadSupport(bool flag)PythonQtstatic
setImporter(PythonQtImportFileInterface *importInterface)PythonQt
setImporterIgnorePaths(const QStringList &paths)PythonQt
setModuleImportPath(PyObject *module, const QStringList &paths)PythonQt
setProfilingCallback(ProfilingCB *cb)PythonQt
setQObjectMissingAttributeCallback(PythonQtQObjectMissingAttributeCB *cb)PythonQt
setQObjectNoLongerWrappedCallback(PythonQtQObjectNoLongerWrappedCB *cb)PythonQt
setQObjectWrappedCallback(PythonQtQObjectWrappedCB *cb)PythonQt
setRedirectStdInCallback(PythonQtInputChangedCB *callback, void *callbackData=nullptr)PythonQt
setRedirectStdInCallbackEnabled(bool enabled)PythonQt
setRedirectStdOutCallbackEnabled(bool enabled)PythonQt
setSystemExitExceptionHandlerEnabled(bool value)PythonQt
systemExitExceptionHandlerEnabled() constPythonQt
systemExitExceptionRaised(int exitCode)PythonQtsignal
Type_Add enum valuePythonQt
Type_And enum valuePythonQt
Type_Divide enum valuePythonQt
Type_EnterExit enum valuePythonQt
Type_InplaceAdd enum valuePythonQt
Type_InplaceAnd enum valuePythonQt
Type_InplaceDivide enum valuePythonQt
Type_InplaceLShift enum valuePythonQt
Type_InplaceMod enum valuePythonQt
Type_InplaceMultiply enum valuePythonQt
Type_InplaceOr enum valuePythonQt
Type_InplaceRShift enum valuePythonQt
Type_InplaceSubtract enum valuePythonQt
Type_InplaceXor enum valuePythonQt
Type_Invert enum valuePythonQt
Type_Length enum valuePythonQt
Type_LShift enum valuePythonQt
Type_MappingGetItem enum valuePythonQt
Type_MappingSetItem enum valuePythonQt
Type_Mod enum valuePythonQt
Type_Multiply enum valuePythonQt
Type_NonZero enum valuePythonQt
Type_Or enum valuePythonQt
Type_RichCompare enum valuePythonQt
Type_RShift enum valuePythonQt
Type_Subtract enum valuePythonQt
Type_Xor enum valuePythonQt
TypeSlots enum namePythonQt
Variable enum valuePythonQt
+ + + + diff --git a/classPythonQt.html b/classPythonQt.html new file mode 100644 index 000000000..6b1b7ea33 --- /dev/null +++ b/classPythonQt.html @@ -0,0 +1,2685 @@ + + + + + + + +PythonQt: PythonQt Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQt Class Reference
+
+
+ +

The main interface to the Python Qt binding, realized as a singleton. + More...

+ +

#include <PythonQt.h>

+
+Inheritance diagram for PythonQt:
+
+
+ +
+ + + + + + + + + + + + + +

+Public Types

enum  InitFlags { RedirectStdOut = 1 +, IgnoreSiteModule = 2 +, ExternalHelp = 4 +, PythonAlreadyInitialized = 8 + }
 flags that can be passed to PythonQt::init() More...
 
enum  TypeSlots {
+  Type_Add = 1 +, Type_Subtract = 1 << 1 +, Type_Multiply = 1 << 2 +, Type_Divide = 1 << 3 +,
+  Type_Mod = 1 << 4 +, Type_And = 1 << 5 +, Type_Or = 1 << 6 +, Type_Xor = 1 << 7 +,
+  Type_LShift = 1 << 8 +, Type_RShift = 1 << 9 +, Type_InplaceAdd = 1 << 10 +, Type_InplaceSubtract = 1 << 11 +,
+  Type_InplaceMultiply = 1 << 12 +, Type_InplaceDivide = 1 << 13 +, Type_InplaceMod = 1 << 14 +, Type_InplaceAnd = 1 << 15 +,
+  Type_InplaceOr = 1 << 16 +, Type_InplaceXor = 1 << 17 +, Type_InplaceLShift = 1 << 18 +, Type_InplaceRShift = 1 << 19 +,
+  Type_Length = 1 << 20 +, Type_MappingSetItem = 1 << 21 +, Type_MappingGetItem = 1 << 22 +, Type_EnterExit = 1 << 23 +,
+  Type_Invert = 1 << 29 +, Type_RichCompare = 1 << 30 +, Type_NonZero = 1 << 31 +
+ }
 flags that tell PythonQt which operators to expect on the registered type More...
 
enum  ProfilingCallbackState { Enter = 1 +, Leave = 2 + }
 enum for profiling callback More...
 
typedef void ProfilingCB(ProfilingCallbackState state, const char *className, const char *methodName, PyObject *args)
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

Standard input handling
void setRedirectStdInCallback (PythonQtInputChangedCB *callback, void *callbackData=nullptr)
 
void setRedirectStdInCallbackEnabled (bool enabled)
 
Standard output handling
bool redirectStdOutCallbackEnabled () const
 return true if std out/err redirection is enabled.
 
void setRedirectStdOutCallbackEnabled (bool enabled)
 enable or disable std out/err redirection to pythonStdOut() and pythonStdErr() signals.
 
Modules
PythonQtObjectPtr getMainModule ()
 get the main module of python
 
PythonQtObjectPtr importModule (const QString &name)
 
PythonQtObjectPtr createModuleFromFile (const QString &name, const QString &filename)
 
PythonQtObjectPtr createModuleFromScript (const QString &name, const QString &script=QString())
 
PythonQtObjectPtr createUniqueModule ()
 
Importing/Paths
void overwriteSysPath (const QStringList &paths)
 overwrite the python sys path (call this directly after PythonQt::init() if you want to change the std python sys path)
 
void addSysPath (const QString &path)
 prepend a path to sys.path to allow importing from it
 
void setModuleImportPath (PyObject *module, const QStringList &paths)
 sets the path list of a module to the given list (important for local imports)
 
Registering Classes
void registerClass (const QMetaObject *metaobject, const char *package=nullptr, PythonQtQObjectCreatorFunctionCB *wrapperCreator=nullptr, PythonQtShellSetInstanceWrapperCB *shell=nullptr)
 registers a QObject derived class to PythonQt (this is implicitly called by addObject as well)
 
void registerCPPClass (const char *typeName, const char *parentTypeName=nullptr, const char *package=nullptr, PythonQtQObjectCreatorFunctionCB *wrapperCreator=nullptr, PythonQtShellSetInstanceWrapperCB *shell=nullptr)
 
void registerQObjectClassNames (const QStringList &names)
 
bool addParentClass (const char *typeName, const char *parentTypeName, int upcastingOffset=0)
 
void addPolymorphicHandler (const char *typeName, PythonQtPolymorphicHandlerCB *cb)
 add a handler for polymorphic downcasting
 
Script Parsing and Evaluation
PythonQtObjectPtr parseFile (const QString &filename)
 parses the given file (using PythonQt's own import mechanism) and returns the python code object, this can then be used to call evalCode()
 
PythonQtObjectPtr parseFileWithPythonLoaders (const QString &filename)
 
QVariant evalCode (PyObject *object, PyObject *pycode)
 
QVariant evalScript (PyObject *object, const QString &script, int start=Py_file_input)
 evaluates the given script code and returns the result value
 
QVariant evalScript (const QString &script, PyObject *globals, PyObject *locals, int start)
 evaluates the given script code in context of given globals and locals and returns the result value
 
void evalFile (PyObject *object, const QString &filename)
 evaluates the given script code from file
 
Signal Handlers
bool addSignalHandler (QObject *obj, const char *signal, PyObject *module, const QString &objectname)
 add a signal handler to the given signal of obj and connect it to a callable objectname in module
 
bool removeSignalHandler (QObject *obj, const char *signal, PyObject *module, const QString &objectname)
 remove a signal handler from the given signal of obj
 
bool addSignalHandler (QObject *obj, const char *signal, PyObject *receiver)
 add a signal handler to the given signal of obj and connect it to a callable receiver
 
bool removeSignalHandler (QObject *obj, const char *signal, PyObject *receiver)
 remove a signal handler from the given signal of obj
 
void removeSignalHandlers ()
 globally removes all signal handlers (connections between QObjects and Python).
 
Variable access
void addObject (PyObject *object, const QString &name, QObject *qObject)
 add the given qObject to the python object as a variable with name (it can be removed via clearVariable)
 
void addVariable (PyObject *object, const QString &name, const QVariant &v)
 add the given variable to the object
 
void removeVariable (PyObject *module, const QString &name)
 remove the given variable
 
QVariant getVariable (PyObject *object, const QString &name)
 get the variable with the name of the object, returns an invalid QVariant on error
 
QVariant getNativeVariable (PyObject *object, const QString &name)
 get the variable with the name of the object as QVariant of type PythonQtObjectPtr, returns an invalid QVariant on error
 
QStringList introspection (PyObject *object, const QString &objectname, ObjectType type)
 read vars etc. in scope of an object, optional looking inside of an object objectname
 
QStringList introspectObject (PyObject *object, ObjectType type)
 read vars etc. in scope of the given object
 
QStringList introspectType (const QString &typeName, ObjectType type)
 
PythonQtObjectPtr lookupCallable (PyObject *object, const QString &name)
 
QString getReturnTypeOfWrappedMethod (PyObject *module, const QString &objectname)
 returns the return type of the method of a wrapped c++ object referenced by objectname
 
QString getReturnTypeOfWrappedMethod (const QString &typeName, const QString &methodName)
 returns the return type of the method methodName of a wrapped c++ type referenced by typeName
 
Calling Python Objects
QVariant call (PyObject *object, const QString &callable, const QVariantList &args=QVariantList(), const QVariantMap &kwargs=QVariantMap())
 call the given python callable in the scope of object, returns the result converted to a QVariant
 
QVariant call (PyObject *callable, const QVariantList &args=QVariantList(), const QVariantMap &kwargs=QVariantMap())
 call the given python object, returns the result converted to a QVariant
 
PyObjectcallAndReturnPyObject (PyObject *callable, const QVariantList &args=QVariantList(), const QVariantMap &kwargs=QVariantMap())
 call the given python object, returns the result as new PyObject
 
Decorations, Constructors, Wrappers...
void addInstanceDecorators (QObject *o)
 
void addClassDecorators (QObject *o)
 
void addDecorators (QObject *o)
 this will add the object both as class and instance decorator (ownership is passed to PythonQt)
 
void addWrapperFactory (PythonQtCppWrapperFactory *factory)
 add the given factory to PythonQt (ownership stays with caller)
 
void addWrapperFactory (PythonQtForeignWrapperFactory *factory)
 add the given factory to PythonQt (ownership stays with caller)
 
void removeWrapperFactory (PythonQtCppWrapperFactory *factory)
 remove the wrapper factory
 
void removeWrapperFactory (PythonQtForeignWrapperFactory *factory)
 remove the wrapper factory
 
+ + + + + + + + + + + + +

Singleton Initialization

enum  ObjectType {
+  Class +, Function +, Variable +, Module +,
+  Anything +, CallOverloads +
+ }
 defines the object types for introspection More...
 
static void init (int flags=IgnoreSiteModule|RedirectStdOut, const QByteArray &pythonQtModuleName=QByteArray())
 
static void cleanup ()
 cleanup of the singleton
 
static PythonQtself ()
 get the singleton instance
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Other Stuff

static PythonQtPrivatepriv ()
 get access to internal data (should not be used on the public API, but is used by some C functions)
 
static void qObjectNoLongerWrappedCB (QObject *o)
 call the callback if it is set
 
static QString qObjectMissingAttributeCallback (QObject *o, const QString &attribute)
 call the callback if it is set
 
static void setEnableThreadSupport (bool flag)
 
void clearNotFoundCachedMembers ()
 
bool handleError (bool printStack=true)
 
bool hadError () const
 return true if handleError() has been called and an error occurred.
 
void clearError ()
 
void setSystemExitExceptionHandlerEnabled (bool value)
 
bool systemExitExceptionHandlerEnabled () const
 
void setQObjectWrappedCallback (PythonQtQObjectWrappedCB *cb)
 set a callback that is called when a QObject with parent == NULL is wrapped by PythonQt
 
void setQObjectNoLongerWrappedCallback (PythonQtQObjectNoLongerWrappedCB *cb)
 set a callback that is called when a QObject with parent == NULL is no longer wrapped by PythonQt
 
void setQObjectMissingAttributeCallback (PythonQtQObjectMissingAttributeCB *cb)
 set a callback that is called when a QObject does not have a specific attribute.
 
PyObjecthelpCalled (PythonQtClassInfo *info)
 called by internal help methods
 
PythonQtObjectPtr lookupObject (PyObject *module, const QString &name)
 
void setProfilingCallback (ProfilingCB *cb)
 sets a callback that is called before and after function calls for profiling
 
void pythonStdOut (const QString &str)
 emitted when python outputs something to stdout (and redirection is turned on)
 
void pythonStdErr (const QString &str)
 emitted when python outputs something to stderr (and redirection is turned on)
 
void pythonHelpRequest (const QByteArray &cppClassName)
 emitted when help() is called on a PythonQt object and ExternalHelp is enabled
 
void systemExitExceptionRaised (int exitCode)
 
+ + + + + + + + + + + + + + +

Custom Importer

static PythonQtImportFileInterfaceimportInterface ()
 get access to the file importer (if set)
 
void setImporter (PythonQtImportFileInterface *importInterface)
 
void installDefaultImporter ()
 
void setImporterIgnorePaths (const QStringList &paths)
 set paths that the importer should ignore
 
const QStringListgetImporterIgnorePaths ()
 get paths that the importer should ignore
 
+

Detailed Description

+

The main interface to the Python Qt binding, realized as a singleton.

+

Use PythonQt::init() to initialize the singleton and PythonQt::self() to access it. While there can be only one PythonQt instance, you can have any number of Python context to do scripting in. One possibility is to use createModuleFromFile(), createModuleFromScript() or createUniqueModule() to get a context that is separated from the other contexts. Alternatively you can use Python dicts as contexts for script evaluation, but you will need to populate the dict with the builtins instance to have all Pythons available when running code in the scope of a dict.

+ +

Definition at line 178 of file PythonQt.h.

+

Member Typedef Documentation

+ +

◆ ProfilingCB

+ +
+
+ + + + +
typedef void PythonQt::ProfilingCB(ProfilingCallbackState state, const char *className, const char *methodName, PyObject *args)
+
+

callback for profiling. className and methodName are only passed when state == Enter, otherwise they are NULL.

+ +

Definition at line 234 of file PythonQt.h.

+ +
+
+

Member Enumeration Documentation

+ +

◆ InitFlags

+ +
+
+ +

flags that can be passed to PythonQt::init()

+ + + + + +
Enumerator
RedirectStdOut 

< sets if the std out/err is redirected to pythonStdOut() and pythonStdErr() signals

+
IgnoreSiteModule 

< sets if Python should ignore the site module

+
ExternalHelp 

< sets if help() calls on PythonQt modules are forwarded to the pythonHelpRequest() signal

+
PythonAlreadyInitialized 

< sets that PythonQt should not can PyInitialize, since it is already done

+
+ +

Definition at line 186 of file PythonQt.h.

+
186 {
+
187 RedirectStdOut = 1,
+
188 IgnoreSiteModule = 2,
+
189 ExternalHelp = 4,
+ +
191 };
+
@ RedirectStdOut
< sets if the std out/err is redirected to pythonStdOut() and pythonStdErr() signals
Definition PythonQt.h:187
+
@ IgnoreSiteModule
< sets if Python should ignore the site module
Definition PythonQt.h:188
+
@ PythonAlreadyInitialized
< sets that PythonQt should not can PyInitialize, since it is already done
Definition PythonQt.h:190
+
@ ExternalHelp
< sets if help() calls on PythonQt modules are forwarded to the pythonHelpRequest() signal
Definition PythonQt.h:189
+
+
+
+ +

◆ ObjectType

+ +
+
+ +

defines the object types for introspection

+ + + + + + + +
Enumerator
Class 
Function 
Variable 
Module 
Anything 
CallOverloads 
+ +

Definition at line 254 of file PythonQt.h.

+ +
+
+ +

◆ ProfilingCallbackState

+ +
+
+ +

enum for profiling callback

+ + + +
Enumerator
Enter 
Leave 
+ +

Definition at line 230 of file PythonQt.h.

+
230{ Enter = 1, Leave = 2 };
+ + +
+
+
+ +

◆ TypeSlots

+ +
+
+ +

flags that tell PythonQt which operators to expect on the registered type

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Enumerator
Type_Add 
Type_Subtract 
Type_Multiply 
Type_Divide 
Type_Mod 
Type_And 
Type_Or 
Type_Xor 
Type_LShift 
Type_RShift 
Type_InplaceAdd 
Type_InplaceSubtract 
Type_InplaceMultiply 
Type_InplaceDivide 
Type_InplaceMod 
Type_InplaceAnd 
Type_InplaceOr 
Type_InplaceXor 
Type_InplaceLShift 
Type_InplaceRShift 
Type_Length 
Type_MappingSetItem 
Type_MappingGetItem 
Type_EnterExit 
Type_Invert 
Type_RichCompare 
Type_NonZero 
+ +

Definition at line 194 of file PythonQt.h.

+
194 {
+
195 Type_Add = 1,
+
196 Type_Subtract = 1 << 1,
+
197 Type_Multiply = 1 << 2,
+
198 Type_Divide = 1 << 3,
+
199 Type_Mod = 1 << 4,
+
200 Type_And = 1 << 5,
+
201 Type_Or = 1 << 6,
+
202 Type_Xor = 1 << 7,
+
203 Type_LShift = 1 << 8,
+
204 Type_RShift = 1 << 9,
+
205
+
206 Type_InplaceAdd = 1 << 10,
+
207 Type_InplaceSubtract = 1 << 11,
+
208 Type_InplaceMultiply = 1 << 12,
+
209 Type_InplaceDivide = 1 << 13,
+
210 Type_InplaceMod = 1 << 14,
+
211 Type_InplaceAnd = 1 << 15,
+
212 Type_InplaceOr = 1 << 16,
+
213 Type_InplaceXor = 1 << 17,
+
214 Type_InplaceLShift = 1 << 18,
+
215 Type_InplaceRShift = 1 << 19,
+
216
+
217 Type_Length = 1 << 20,
+
218 Type_MappingSetItem = 1 << 21,
+
219 Type_MappingGetItem = 1 << 22,
+
220
+
221 Type_EnterExit = 1 << 23,
+
222
+
223 Type_Invert = 1 << 29,
+
224 Type_RichCompare = 1 << 30,
+
225 Type_NonZero = 1 << 31,
+
226
+
227 };
+
@ Type_InplaceXor
Definition PythonQt.h:213
+
@ Type_MappingGetItem
Definition PythonQt.h:219
+
@ Type_InplaceAnd
Definition PythonQt.h:211
+
@ Type_InplaceMultiply
Definition PythonQt.h:208
+
@ Type_Length
Definition PythonQt.h:217
+
@ Type_InplaceOr
Definition PythonQt.h:212
+ +
@ Type_InplaceDivide
Definition PythonQt.h:209
+
@ Type_EnterExit
Definition PythonQt.h:221
+
@ Type_MappingSetItem
Definition PythonQt.h:218
+
@ Type_RShift
Definition PythonQt.h:204
+ + +
@ Type_Multiply
Definition PythonQt.h:197
+ +
@ Type_InplaceLShift
Definition PythonQt.h:214
+
@ Type_Divide
Definition PythonQt.h:198
+
@ Type_InplaceSubtract
Definition PythonQt.h:207
+
@ Type_RichCompare
Definition PythonQt.h:224
+
@ Type_InplaceMod
Definition PythonQt.h:210
+
@ Type_InplaceRShift
Definition PythonQt.h:215
+
@ Type_InplaceAdd
Definition PythonQt.h:206
+
@ Type_Subtract
Definition PythonQt.h:196
+ +
@ Type_Invert
Definition PythonQt.h:223
+
@ Type_LShift
Definition PythonQt.h:203
+
@ Type_NonZero
Definition PythonQt.h:225
+
+
+
+

Member Function Documentation

+ +

◆ addClassDecorators()

+ +
+
+ + + + + + + + +
void PythonQt::addClassDecorators (QObject * o)
+
+

add an object whose slots will be used as decorator slots for class objects (ownership is passed to PythonQt)

+

The slots need to follow the following convention:

    +
  • SomeClass* new_SomeClass(...)
  • +
  • QVariant new_SomeClass(...)
  • +
  • void delete_SomeClass(SomeClass*)
  • +
  • ... static_SomeClass_someName(...)
  • +
+

This will add:

    +
  • a constructor
  • +
  • a constructor which generates a QVariant
  • +
  • a destructor (only useful for CPP objects)
  • +
  • a static decorator slot which will be available on the MetaObject (visible in PythonQt module)
  • +
+ +
+
+ +

◆ addDecorators()

+ +
+
+ + + + + + + + +
void PythonQt::addDecorators (QObject * o)
+
+ +

this will add the object both as class and instance decorator (ownership is passed to PythonQt)

+ +
+
+ +

◆ addInstanceDecorators()

+ +
+
+ + + + + + + + +
void PythonQt::addInstanceDecorators (QObject * o)
+
+

add an object whose slots will be used as decorator slots for other QObjects or CPP classes. The slots need to follow the convention that the first argument is a pointer to the wrapped object. (ownership is passed to PythonQt)

+

Example:

+

A slot with the signature

+
bool doSomething(QWidget* w, int a)
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+

will extend QWidget instances (and derived classes) with a "bool doSomething(int a)" slot that will be called with the concrete instance as first argument. So in Python you can now e.g. call

+
someWidget.doSomething(12)
+

without QWidget really having this method. This allows to easily make normal methods of Qt classes callable by forwarding them with such decorator slots or to make CPP classes (which are not derived from QObject) callable from Python.

+ +
+
+ +

◆ addObject()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void PythonQt::addObject (PyObjectobject,
const QStringname,
QObject * qObject 
)
+
+ +

add the given qObject to the python object as a variable with name (it can be removed via clearVariable)

+ +
+
+ +

◆ addParentClass()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQt::addParentClass (const chartypeName,
const charparentTypeName,
int upcastingOffset = 0 
)
+
+

add a parent class relation to the given typeName, the upcastingOffset is needed for multiple inheritance and can be calculated using PythonQtUpcastingOffset<type,parentType>(), which also verifies that type is really derived from parentType. Returns false if the typeName was not yet registered.

+ +
+
+ +

◆ addPolymorphicHandler()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void PythonQt::addPolymorphicHandler (const chartypeName,
PythonQtPolymorphicHandlerCBcb 
)
+
+ +

add a handler for polymorphic downcasting

+ +
+
+ +

◆ addSignalHandler() [1/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQt::addSignalHandler (QObject * obj,
const charsignal,
PyObjectmodule,
const QStringobjectname 
)
+
+ +

add a signal handler to the given signal of obj and connect it to a callable objectname in module

+ +
+
+ +

◆ addSignalHandler() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQt::addSignalHandler (QObject * obj,
const charsignal,
PyObjectreceiver 
)
+
+ +

add a signal handler to the given signal of obj and connect it to a callable receiver

+ +
+
+ +

◆ addSysPath()

+ +
+
+ + + + + + + + +
void PythonQt::addSysPath (const QStringpath)
+
+ +

prepend a path to sys.path to allow importing from it

+ +
+
+ +

◆ addVariable()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void PythonQt::addVariable (PyObjectobject,
const QStringname,
const QVariantv 
)
+
+ +

add the given variable to the object

+ +
+
+ +

◆ addWrapperFactory() [1/2]

+ +
+
+ + + + + + + + +
void PythonQt::addWrapperFactory (PythonQtCppWrapperFactoryfactory)
+
+ +

add the given factory to PythonQt (ownership stays with caller)

+ +
+
+ +

◆ addWrapperFactory() [2/2]

+ +
+
+ + + + + + + + +
void PythonQt::addWrapperFactory (PythonQtForeignWrapperFactoryfactory)
+
+ +

add the given factory to PythonQt (ownership stays with caller)

+ +
+
+ +

◆ call() [1/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
QVariant PythonQt::call (PyObjectcallable,
const QVariantListargs = QVariantList(),
const QVariantMapkwargs = QVariantMap() 
)
+
+ +

call the given python object, returns the result converted to a QVariant

+ +
+
+ +

◆ call() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QVariant PythonQt::call (PyObjectobject,
const QStringcallable,
const QVariantListargs = QVariantList(),
const QVariantMapkwargs = QVariantMap() 
)
+
+ +

call the given python callable in the scope of object, returns the result converted to a QVariant

+ +
+
+ +

◆ callAndReturnPyObject()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
PyObject * PythonQt::callAndReturnPyObject (PyObjectcallable,
const QVariantListargs = QVariantList(),
const QVariantMapkwargs = QVariantMap() 
)
+
+ +

call the given python object, returns the result as new PyObject

+ +
+
+ +

◆ cleanup()

+ +
+
+ + + + + +
+ + + + + + + +
static void PythonQt::cleanup ()
+
+static
+
+ +

cleanup of the singleton

+ +
+
+ +

◆ clearError()

+ +
+
+ + + + + + + +
void PythonQt::clearError ()
+
+

reset error flag. After calling this, hadError() will return false.

See also
hadError()
+ +
+
+ +

◆ clearNotFoundCachedMembers()

+ +
+
+ + + + + + + +
void PythonQt::clearNotFoundCachedMembers ()
+
+

clear all NotFound entries on all class infos, to ensure that newly loaded wrappers can add methods even when the object was wrapped by PythonQt before the wrapper was loaded

+ +
+
+ +

◆ createModuleFromFile()

+ +
+
+ + + + + + + + + + + + + + + + + + +
PythonQtObjectPtr PythonQt::createModuleFromFile (const QStringname,
const QStringfilename 
)
+
+

creates the new module name and evaluates the given file in the context of that module If the script is empty, the module contains no initial code. You can use evalScript/evalCode to add code to a module later on. The user needs to make sure that the name is unique in the python module dictionary.

+ +
+
+ +

◆ createModuleFromScript()

+ +
+
+ + + + + + + + + + + + + + + + + + +
PythonQtObjectPtr PythonQt::createModuleFromScript (const QStringname,
const QStringscript = QString() 
)
+
+

creates the new module name and evaluates the given script in the context of that module. If the script is empty, the module contains no initial code. You can use evalScript/evalCode to add code to a module later on. The user needs to make sure that the name is unique in the python module dictionary.

+ +
+
+ +

◆ createUniqueModule()

+ +
+
+ + + + + + + +
PythonQtObjectPtr PythonQt::createUniqueModule ()
+
+

create a uniquely named module, you can use evalFile or evalScript to populate the module with script code

+ +
+
+ +

◆ evalCode()

+ +
+
+ + + + + + + + + + + + + + + + + + +
QVariant PythonQt::evalCode (PyObjectobject,
PyObjectpycode 
)
+
+

evaluates the given code and returns the result value (use Py_Compile etc. to create pycode from string) If pycode is NULL, a python error is printed.

+ +
+
+ +

◆ evalFile()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void PythonQt::evalFile (PyObjectobject,
const QStringfilename 
)
+
+ +

evaluates the given script code from file

+ +
+
+ +

◆ evalScript() [1/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QVariant PythonQt::evalScript (const QStringscript,
PyObjectglobals,
PyObjectlocals,
int start 
)
+
+ +

evaluates the given script code in context of given globals and locals and returns the result value

+ +
+
+ +

◆ evalScript() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
QVariant PythonQt::evalScript (PyObjectobject,
const QStringscript,
int start = Py_file_input 
)
+
+ +

evaluates the given script code and returns the result value

+ +
+
+ +

◆ getImporterIgnorePaths()

+ +
+
+ + + + + + + +
const QStringList & PythonQt::getImporterIgnorePaths ()
+
+ +

get paths that the importer should ignore

+ +
+
+ +

◆ getMainModule()

+ +
+
+ + + + + + + +
PythonQtObjectPtr PythonQt::getMainModule ()
+
+ +

get the main module of python

+ +
+
+ +

◆ getNativeVariable()

+ +
+
+ + + + + + + + + + + + + + + + + + +
QVariant PythonQt::getNativeVariable (PyObjectobject,
const QStringname 
)
+
+ +

get the variable with the name of the object as QVariant of type PythonQtObjectPtr, returns an invalid QVariant on error

+ +
+
+ +

◆ getReturnTypeOfWrappedMethod() [1/2]

+ +
+
+ + + + + + + + + + + + + + + + + + +
QString PythonQt::getReturnTypeOfWrappedMethod (const QStringtypeName,
const QStringmethodName 
)
+
+ +

returns the return type of the method methodName of a wrapped c++ type referenced by typeName

+ +
+
+ +

◆ getReturnTypeOfWrappedMethod() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + + + +
QString PythonQt::getReturnTypeOfWrappedMethod (PyObjectmodule,
const QStringobjectname 
)
+
+ +

returns the return type of the method of a wrapped c++ object referenced by objectname

+ +
+
+ +

◆ getVariable()

+ +
+
+ + + + + + + + + + + + + + + + + + +
QVariant PythonQt::getVariable (PyObjectobject,
const QStringname 
)
+
+ +

get the variable with the name of the object, returns an invalid QVariant on error

+ +
+
+ +

◆ hadError()

+ +
+
+ + + + + + + +
bool PythonQt::hadError () const
+
+ +

return true if handleError() has been called and an error occurred.

+ +
+
+ +

◆ handleError()

+ +
+
+ + + + + + + + +
bool PythonQt::handleError (bool printStack = true)
+
+

handle a python error, call this when a python function fails. If no error occurred, it returns false. The error is currently just output to the python stderr, future version might implement better trace printing

+ +
+
+ +

◆ helpCalled()

+ +
+
+ + + + + + + + +
PyObject * PythonQt::helpCalled (PythonQtClassInfoinfo)
+
+ +

called by internal help methods

+ +
+
+ +

◆ importInterface()

+ +
+
+ + + + + +
+ + + + + + + +
static PythonQtImportFileInterface * PythonQt::importInterface ()
+
+static
+
+ +

get access to the file importer (if set)

+ +
+
+ +

◆ importModule()

+ +
+
+ + + + + + + + +
PythonQtObjectPtr PythonQt::importModule (const QStringname)
+
+

import the given module and return a reference to it (useful to import e.g. "sys" and call something on it) If a module is already imported, this returns the already imported module.

+ +
+
+ +

◆ init()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static void PythonQt::init (int flags = IgnoreSiteModule|RedirectStdOut,
const QByteArraypythonQtModuleName = QByteArray() 
)
+
+static
+
+

initialize the python qt binding (flags are a or combination of PythonQt::InitFlags), if pythonQtModuleName is given it defines the name of the python module that PythonQt will add, otherwise "PythonQt" is used. This can be used to e.g. pass in PySide or PyQt4 to make it more compatible.

+ +
+
+ +

◆ installDefaultImporter()

+ +
+
+ + + + + +
+ + + + + + + +
void PythonQt::installDefaultImporter ()
+
+inline
+
+

this installs the default QFile importer (which effectively does a setImporter(NULL)) (without calling setImporter or installDefaultImporter at least once, the default python import mechanism is in place) the default importer allows to import files from anywhere QFile can read from, including the Qt resource system using ":". Keep in mind that you need to extend "sys.path" with ":" to be able to import from the Qt resources.

+ +

Definition at line 554 of file PythonQt.h.

+
554{ setImporter(nullptr); }
+
void setImporter(PythonQtImportFileInterface *importInterface)
+
+
+
+ +

◆ introspection()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
QStringList PythonQt::introspection (PyObjectobject,
const QStringobjectname,
ObjectType type 
)
+
+ +

read vars etc. in scope of an object, optional looking inside of an object objectname

+ +
+
+ +

◆ introspectObject()

+ +
+
+ + + + + + + + + + + + + + + + + + +
QStringList PythonQt::introspectObject (PyObjectobject,
ObjectType type 
)
+
+ +

read vars etc. in scope of the given object

+ +
+
+ +

◆ introspectType()

+ +
+
+ + + + + + + + + + + + + + + + + + +
QStringList PythonQt::introspectType (const QStringtypeName,
ObjectType type 
)
+
+

read vars etc. in scope of the type object called typename. First the typename of the form module.type is split into module and type. Then the module is looked up in sys.modules. If the module or type is not found there, then the type is looked up in the builtin module.

+ +
+
+ +

◆ lookupCallable()

+ +
+
+ + + + + + + + + + + + + + + + + + +
PythonQtObjectPtr PythonQt::lookupCallable (PyObjectobject,
const QStringname 
)
+
+

returns the found callable object or NULL

Returns
new reference
+ +
+
+ +

◆ lookupObject()

+ +
+
+ + + + + + + + + + + + + + + + + + +
PythonQtObjectPtr PythonQt::lookupObject (PyObjectmodule,
const QStringname 
)
+
+

returns the found object or NULL

Returns
new reference
+ +
+
+ +

◆ overwriteSysPath()

+ +
+
+ + + + + + + + +
void PythonQt::overwriteSysPath (const QStringListpaths)
+
+ +

overwrite the python sys path (call this directly after PythonQt::init() if you want to change the std python sys path)

+ +
+
+ +

◆ parseFile()

+ +
+
+ + + + + + + + +
PythonQtObjectPtr PythonQt::parseFile (const QStringfilename)
+
+ +

parses the given file (using PythonQt's own import mechanism) and returns the python code object, this can then be used to call evalCode()

+ +
+
+ +

◆ parseFileWithPythonLoaders()

+ +
+
+ + + + + + + + +
PythonQtObjectPtr PythonQt::parseFileWithPythonLoaders (const QStringfilename)
+
+

Parses the given file and returns the python code object, this can then be used to call evalCode() It uses Python's importlib machinery to load the file's code and supports source and sourceless loading and generation of cache files.

+ +
+
+ +

◆ priv()

+ +
+
+ + + + + +
+ + + + + + + +
static PythonQtPrivate * PythonQt::priv ()
+
+inlinestatic
+
+ +

get access to internal data (should not be used on the public API, but is used by some C functions)

+ +

Definition at line 572 of file PythonQt.h.

+
572{ return _self ? _self->_p : nullptr; }
+
+

Referenced by PythonQtConvertListOfKnownClassToPythonList(), and PythonQtConvertPythonListToListOfKnownClass().

+ +
+
+ +

◆ pythonHelpRequest

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQt::pythonHelpRequest (const QByteArraycppClassName)
+
+signal
+
+ +

emitted when help() is called on a PythonQt object and ExternalHelp is enabled

+ +
+
+ +

◆ pythonStdErr

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQt::pythonStdErr (const QStringstr)
+
+signal
+
+ +

emitted when python outputs something to stderr (and redirection is turned on)

+ +
+
+ +

◆ pythonStdOut

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQt::pythonStdOut (const QStringstr)
+
+signal
+
+ +

emitted when python outputs something to stdout (and redirection is turned on)

+ +
+
+ +

◆ qObjectMissingAttributeCallback()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static QString PythonQt::qObjectMissingAttributeCallback (QObject * o,
const QStringattribute 
)
+
+static
+
+ +

call the callback if it is set

+ +
+
+ +

◆ qObjectNoLongerWrappedCB()

+ +
+
+ + + + + +
+ + + + + + + + +
static void PythonQt::qObjectNoLongerWrappedCB (QObject * o)
+
+static
+
+ +

call the callback if it is set

+ +
+
+ +

◆ redirectStdOutCallbackEnabled()

+ +
+
+ + + + + + + +
bool PythonQt::redirectStdOutCallbackEnabled () const
+
+ +

return true if std out/err redirection is enabled.

+ +
+
+ +

◆ registerClass()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void PythonQt::registerClass (const QMetaObjectmetaobject,
const charpackage = nullptr,
PythonQtQObjectCreatorFunctionCBwrapperCreator = nullptr,
PythonQtShellSetInstanceWrapperCBshell = nullptr 
)
+
+ +

registers a QObject derived class to PythonQt (this is implicitly called by addObject as well)

+ +
+
+ +

◆ registerCPPClass()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void PythonQt::registerCPPClass (const chartypeName,
const charparentTypeName = nullptr,
const charpackage = nullptr,
PythonQtQObjectCreatorFunctionCBwrapperCreator = nullptr,
PythonQtShellSetInstanceWrapperCBshell = nullptr 
)
+
+

add a wrapper object for the given QMetaType typeName, also does an addClassDecorators() to add constructors for variants (ownership of wrapper is passed to PythonQt)

+

Make sure that you have done a qRegisterMetaType first, if typeName is a user type!

+

This will add a wrapper object that is used to make calls to the given classname typeName. All slots that take a pointer to typeName as the first argument will be callable from Python on a variant object that contains such a type.

+ +
+
+ +

◆ registerQObjectClassNames()

+ +
+
+ + + + + + + + +
void PythonQt::registerQObjectClassNames (const QStringListnames)
+
+

as an alternative to registerClass, you can tell PythonQt the names of QObject derived classes and it will register the classes when it first sees a pointer to such a derived class

+ +
+
+ +

◆ removeSignalHandler() [1/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQt::removeSignalHandler (QObject * obj,
const charsignal,
PyObjectmodule,
const QStringobjectname 
)
+
+ +

remove a signal handler from the given signal of obj

+ +
+
+ +

◆ removeSignalHandler() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQt::removeSignalHandler (QObject * obj,
const charsignal,
PyObjectreceiver 
)
+
+ +

remove a signal handler from the given signal of obj

+ +
+
+ +

◆ removeSignalHandlers()

+ +
+
+ + + + + + + +
void PythonQt::removeSignalHandlers ()
+
+ +

globally removes all signal handlers (connections between QObjects and Python).

+ +
+
+ +

◆ removeVariable()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void PythonQt::removeVariable (PyObjectmodule,
const QStringname 
)
+
+ +

remove the given variable

+ +
+
+ +

◆ removeWrapperFactory() [1/2]

+ +
+
+ + + + + + + + +
void PythonQt::removeWrapperFactory (PythonQtCppWrapperFactoryfactory)
+
+ +

remove the wrapper factory

+ +
+
+ +

◆ removeWrapperFactory() [2/2]

+ +
+
+ + + + + + + + +
void PythonQt::removeWrapperFactory (PythonQtForeignWrapperFactoryfactory)
+
+ +

remove the wrapper factory

+ +
+
+ +

◆ self()

+ +
+
+ + + + + +
+ + + + + + + +
static PythonQt * PythonQt::self ()
+
+static
+
+ +

get the singleton instance

+ +
+
+ +

◆ setEnableThreadSupport()

+ +
+
+ + + + + +
+ + + + + + + + +
static void PythonQt::setEnableThreadSupport (bool flag)
+
+static
+
+

Enable GIL and thread state handling (turned off by default). If you want to use Python threading, you have to call this with true early in your main thread, before you launch any threads in Python. It can be called before or after PythonQt::init().

+ +
+
+ +

◆ setImporter()

+ +
+
+ + + + + + + + +
void PythonQt::setImporter (PythonQtImportFileInterfaceimportInterface)
+
+

replace the internal import implementation and use the supplied interface to load files (both py and pyc files) (this method should be called directly after initialization of init() and before calling overwriteSysPath(). On the first call to this method, it will install a generic PythonQt importer in Pythons "path_hooks". This is not reversible, so even setting setImporter(NULL) afterwards will keep the custom PythonQt importer with a QFile default import interface. Subsequent python import calls will make use of the passed importInterface which forwards all import calls to the given importInterface. Passing NULL will install a default QFile importer. (importInterface ownership stays with caller)

+ +
+
+ +

◆ setImporterIgnorePaths()

+ +
+
+ + + + + + + + +
void PythonQt::setImporterIgnorePaths (const QStringListpaths)
+
+ +

set paths that the importer should ignore

+ +
+
+ +

◆ setModuleImportPath()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void PythonQt::setModuleImportPath (PyObjectmodule,
const QStringListpaths 
)
+
+ +

sets the path list of a module to the given list (important for local imports)

+ +
+
+ +

◆ setProfilingCallback()

+ +
+
+ + + + + + + + +
void PythonQt::setProfilingCallback (ProfilingCBcb)
+
+ +

sets a callback that is called before and after function calls for profiling

+ +
+
+ +

◆ setQObjectMissingAttributeCallback()

+ +
+
+ + + + + + + + +
void PythonQt::setQObjectMissingAttributeCallback (PythonQtQObjectMissingAttributeCBcb)
+
+ +

set a callback that is called when a QObject does not have a specific attribute.

+ +
+
+ +

◆ setQObjectNoLongerWrappedCallback()

+ +
+
+ + + + + + + + +
void PythonQt::setQObjectNoLongerWrappedCallback (PythonQtQObjectNoLongerWrappedCBcb)
+
+ +

set a callback that is called when a QObject with parent == NULL is no longer wrapped by PythonQt

+ +
+
+ +

◆ setQObjectWrappedCallback()

+ +
+
+ + + + + + + + +
void PythonQt::setQObjectWrappedCallback (PythonQtQObjectWrappedCBcb)
+
+ +

set a callback that is called when a QObject with parent == NULL is wrapped by PythonQt

+ +
+
+ +

◆ setRedirectStdInCallback()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void PythonQt::setRedirectStdInCallback (PythonQtInputChangedCBcallback,
voidcallbackData = nullptr 
)
+
+

Overwrite default handling of stdin using a custom callback. It internally backup the original 'sys.stdin' into 'sys.pythonqt_original_stdin'

+ +
+
+ +

◆ setRedirectStdInCallbackEnabled()

+ +
+
+ + + + + + + + +
void PythonQt::setRedirectStdInCallbackEnabled (bool enabled)
+
+

Enable or disable stdin custom callback. It resets 'sys.stdin' using either 'sys.pythonqt_stdin' or 'sys.pythonqt_original_stdin'

+ +
+
+ +

◆ setRedirectStdOutCallbackEnabled()

+ +
+
+ + + + + + + + +
void PythonQt::setRedirectStdOutCallbackEnabled (bool enabled)
+
+ +

enable or disable std out/err redirection to pythonStdOut() and pythonStdErr() signals.

+ +
+
+ +

◆ setSystemExitExceptionHandlerEnabled()

+ +
+
+ + + + + + + + +
void PythonQt::setSystemExitExceptionHandlerEnabled (bool value)
+
+

if set to true, the systemExitExceptionRaised signal will be emitted if exception SystemExit is caught

See also
handleError()
+ +
+
+ +

◆ systemExitExceptionHandlerEnabled()

+ +
+
+ + + + + + + +
bool PythonQt::systemExitExceptionHandlerEnabled () const
+
+

return true if SystemExit exception is handled by PythonQt

See also
setSystemExitExceptionHandlerEnabled()
+ +
+
+ +

◆ systemExitExceptionRaised

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQt::systemExitExceptionRaised (int exitCode)
+
+signal
+
+

emitted when both custom SystemExit exception handler is enabled and a SystemExit exception is raised.

See also
setSystemExitExceptionHandlerEnabled(bool)
+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQt.png b/classPythonQt.png new file mode 100644 index 000000000..546301e5d Binary files /dev/null and b/classPythonQt.png differ diff --git a/classPythonQtArgumentFrame-members.html b/classPythonQtArgumentFrame-members.html new file mode 100644 index 000000000..01dddc5ea --- /dev/null +++ b/classPythonQtArgumentFrame-members.html @@ -0,0 +1,62 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtArgumentFrame Member List
+
+
+ +

This is the complete list of members for PythonQtArgumentFrame, including all inherited members.

+ + + + + + + + + +
cleanupFreeList()PythonQtArgumentFramestatic
deleteFrame(PythonQtArgumentFrame *frame)PythonQtArgumentFramestatic
establishPersistentPtr(void *alreadyAllocatedPtr, const Class &value)PythonQtArgumentFrameinline
establishPersistentViewPtr(void *alreadyAllocatedPtr, const Class &value)PythonQtArgumentFrameinline
newFrame()PythonQtArgumentFramestatic
nextPODPtr()PythonQtArgumentFrame
nextVariantPtr()PythonQtArgumentFrame
reset()PythonQtArgumentFrame
+ + + + diff --git a/classPythonQtArgumentFrame.html b/classPythonQtArgumentFrame.html new file mode 100644 index 000000000..c8822cd6b --- /dev/null +++ b/classPythonQtArgumentFrame.html @@ -0,0 +1,349 @@ + + + + + + + +PythonQt: PythonQtArgumentFrame Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtArgumentFrame Class Reference
+
+
+ +

Stores C++ arguments for a qt_metacall (which are created when converting data from Python to C++) + More...

+ +

#include <PythonQtMisc.h>

+ + + + + + + + + + + + + + + + + +

+Public Member Functions

void reset ()
 Resets the pod and variant argument lists to empty lists.
 
QVariantnextVariantPtr ()
 Get next pointer to a variant.
 
quint64nextPODPtr ()
 Get next pointer to a POD.
 
template<typename Class >
voidestablishPersistentPtr (void *alreadyAllocatedPtr, const Class &value)
 
template<typename Class , typename ViewClass >
voidestablishPersistentViewPtr (void *alreadyAllocatedPtr, const Class &value)
 
+ + + + + + + + + + +

+Static Public Member Functions

static PythonQtArgumentFramenewFrame ()
 Create a new (empty) frame (which is typically reused from a freelist)
 
static void deleteFrame (PythonQtArgumentFrame *frame)
 Frees the frame (resetting it and putting it back to the freelist)
 
static void cleanupFreeList ()
 Frees all PythonQtArgumentFrame frames that are stored.
 
+

Detailed Description

+

Stores C++ arguments for a qt_metacall (which are created when converting data from Python to C++)

+ +

Definition at line 104 of file PythonQtMisc.h.

+

Member Function Documentation

+ +

◆ cleanupFreeList()

+ +
+
+ + + + + +
+ + + + + + + +
static void PythonQtArgumentFrame::cleanupFreeList ()
+
+static
+
+ +

Frees all PythonQtArgumentFrame frames that are stored.

+ +
+
+ +

◆ deleteFrame()

+ +
+
+ + + + + +
+ + + + + + + + +
static void PythonQtArgumentFrame::deleteFrame (PythonQtArgumentFrameframe)
+
+static
+
+ +

Frees the frame (resetting it and putting it back to the freelist)

+ +
+
+ +

◆ establishPersistentPtr()

+ +
+
+
+template<typename Class >
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void * PythonQtArgumentFrame::establishPersistentPtr (voidalreadyAllocatedPtr,
const Class & value 
)
+
+inline
+
+ +

Definition at line 125 of file PythonQtMisc.h.

+
126 {
+ +
128 *reinterpret_cast<Class*>(alreadyAllocatedPtr) = value;
+
129 return alreadyAllocatedPtr;
+
130 } else {
+ +
132 *item = QVariant(value);
+
133 return const_cast<void*>(item->constData());
+
134 }
+
135 }
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
QVariant * nextVariantPtr()
Get next pointer to a variant.
+
+

References nextVariantPtr(), and PythonQtConvertPairToPython().

+ +
+
+ +

◆ establishPersistentViewPtr()

+ +
+
+
+template<typename Class , typename ViewClass >
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void * PythonQtArgumentFrame::establishPersistentViewPtr (voidalreadyAllocatedPtr,
const Class & value 
)
+
+inline
+
+ +

Definition at line 138 of file PythonQtMisc.h.

+
139 {
+ + + +
143 *reinterpret_cast<ViewClass*>(alreadyAllocatedPtr) =
+
144 ViewClass(*reinterpret_cast<const Class*>(itemStore->constData()));
+
145 return alreadyAllocatedPtr;
+
146 } else {
+ +
148 *item = QVariant::fromValue(ViewClass(*reinterpret_cast<const Class*>(itemStore->constData())));
+
149 return const_cast<void*>(item->constData());
+
150 }
+
151 }
+
+

References nextVariantPtr(), and PythonQtConvertPairToPython().

+ +
+
+ +

◆ newFrame()

+ +
+
+ + + + + +
+ + + + + + + +
static PythonQtArgumentFrame * PythonQtArgumentFrame::newFrame ()
+
+static
+
+ +

Create a new (empty) frame (which is typically reused from a freelist)

+ +
+
+ +

◆ nextPODPtr()

+ +
+
+ + + + + + + +
quint64 * PythonQtArgumentFrame::nextPODPtr ()
+
+ +

Get next pointer to a POD.

+ +
+
+ +

◆ nextVariantPtr()

+ +
+
+ + + + + + + +
QVariant * PythonQtArgumentFrame::nextVariantPtr ()
+
+ +

Get next pointer to a variant.

+ +

Referenced by establishPersistentPtr(), and establishPersistentViewPtr().

+ +
+
+ +

◆ reset()

+ +
+
+ + + + + + + +
void PythonQtArgumentFrame::reset ()
+
+ +

Resets the pod and variant argument lists to empty lists.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtClassInfo-members.html b/classPythonQtClassInfo-members.html new file mode 100644 index 000000000..1f0fe11f8 --- /dev/null +++ b/classPythonQtClassInfo-members.html @@ -0,0 +1,103 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtClassInfo Member List
+
+
+ +

This is the complete list of members for PythonQtClassInfo, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
addConstructor(PythonQtSlotInfo *info)PythonQtClassInfo
addDecoratorSlot(PythonQtSlotInfo *info)PythonQtClassInfo
addGlobalNamespaceWrapper(PythonQtClassInfo *namespaceWrapper)PythonQtClassInfostatic
addNestedClass(PythonQtClassInfo *info)PythonQtClassInfo
addParentClass(const ParentClassInfo &info)PythonQtClassInfoinline
addPolymorphicHandler(PythonQtPolymorphicHandlerCB *cb)PythonQtClassInfoinline
castDownIfPossible(void *ptr, PythonQtClassInfo **resultClassInfo)PythonQtClassInfo
castTo(void *ptr, const char *classname)PythonQtClassInfo
className() constPythonQtClassInfo
clearGlobalNamespaceWrappers()PythonQtClassInfostatic
clearNotFoundCachedMembers()PythonQtClassInfo
constructors()PythonQtClassInfo
copyObject(void *cppObject)PythonQtClassInfo
decorator()PythonQtClassInfo
destructor()PythonQtClassInfo
escapeReservedNames(const QByteArray &name)PythonQtClassInfostatic
findEnumWrapper(const QByteArray &name, PythonQtClassInfo *localScope, bool *isLocalEnum=nullptr)PythonQtClassInfostatic
getClassInfoForProperty(const QString &name)PythonQtClassInfo
getCopyConstructor()PythonQtClassInfo
getPythonTypeForProperty(const QString &name)PythonQtClassInfo
help()PythonQtClassInfo
inherits(const char *classname)PythonQtClassInfo
inherits(PythonQtClassInfo *info)PythonQtClassInfo
isCPPWrapper()PythonQtClassInfoinline
isQObject()PythonQtClassInfoinline
member(const char *member)PythonQtClassInfo
memberList()PythonQtClassInfo
metaObject()PythonQtClassInfoinline
metaTypeId()PythonQtClassInfoinline
nestedClasses()PythonQtClassInfoinline
propertyList()PythonQtClassInfo
PythonQtClassInfo()PythonQtClassInfo
pythonQtClassWrapper()PythonQtClassInfoinline
referenceCountingRefCB()PythonQtClassInfo
referenceCountingUnrefCB()PythonQtClassInfo
setDecoratorProvider(PythonQtQObjectCreatorFunctionCB *cb)PythonQtClassInfo
setDestructor(PythonQtSlotInfo *info)PythonQtClassInfo
setMetaObject(const QMetaObject *meta)PythonQtClassInfo
setPythonQtClassWrapper(PyObject *obj)PythonQtClassInfoinline
setReferenceCounting(PythonQtVoidPtrCB *refCB, PythonQtVoidPtrCB *unrefCB)PythonQtClassInfo
setShellSetInstanceWrapperCB(PythonQtShellSetInstanceWrapperCB *cb)PythonQtClassInfoinline
setTypeSlots(int typeSlots)PythonQtClassInfoinline
setupCPPObject(const QByteArray &classname)PythonQtClassInfo
setupQObject(const QMetaObject *meta)PythonQtClassInfo
shellSetInstanceWrapperCB()PythonQtClassInfoinline
supportsRichCompare()PythonQtClassInfo
typeSlots() constPythonQtClassInfoinline
unscopedClassName() constPythonQtClassInfo
~PythonQtClassInfo()PythonQtClassInfo
+ + + + diff --git a/classPythonQtClassInfo.html b/classPythonQtClassInfo.html new file mode 100644 index 000000000..787424575 --- /dev/null +++ b/classPythonQtClassInfo.html @@ -0,0 +1,1394 @@ + + + + + + + +PythonQt: PythonQtClassInfo Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtClassInfo Class Reference
+
+
+ +

a class that stores all required information about a Qt object (and an optional associated C++ class name) + More...

+ +

#include <PythonQtClassInfo.h>

+ + + + + +

+Classes

struct  ParentClassInfo
 store information about parent classes More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 PythonQtClassInfo ()
 
 ~PythonQtClassInfo ()
 
void setupQObject (const QMetaObject *meta)
 setup as a QObject, taking the meta object as meta information about the QObject
 
void setupCPPObject (const QByteArray &classname)
 setup as a CPP (non-QObject), taking the classname
 
void setTypeSlots (int typeSlots)
 set the type capabilities
 
int typeSlots () const
 get the type capabilities
 
PythonQtMemberInfo member (const char *member)
 get the Python method definition for a given slot name (without return type and signature)
 
PythonQtSlotInfoconstructors ()
 get access to the constructor slot (which may be overloaded if there are multiple constructors)
 
PythonQtSlotInfodestructor ()
 get access to the destructor slot
 
void addConstructor (PythonQtSlotInfo *info)
 add a constructor, ownership is passed to classinfo
 
void setDestructor (PythonQtSlotInfo *info)
 set a destructor, ownership is passed to classinfo
 
void addDecoratorSlot (PythonQtSlotInfo *info)
 add a decorator slot, ownership is passed to classinfo
 
void addNestedClass (PythonQtClassInfo *info)
 add a nested class, so that it can be shown as outer class member
 
const QByteArrayclassName () const
 get the classname (either of the QObject or of the wrapped CPP object)
 
QByteArray unscopedClassName () const
 get the unscoped classname (without ParentClass::) for nested classes
 
bool isQObject ()
 returns if the QObject
 
bool isCPPWrapper ()
 returns if the class is a CPP wrapper
 
const QMetaObjectmetaObject ()
 get the meta object
 
void setMetaObject (const QMetaObject *meta)
 set the meta object, this will reset the caching
 
bool inherits (const char *classname)
 returns if this class inherits from the given classname
 
bool inherits (PythonQtClassInfo *info)
 returns if this class inherits from the given classinfo
 
voidcastTo (void *ptr, const char *classname)
 
QString help ()
 get help string for the metaobject
 
QStringList propertyList ()
 get list of all properties (on QObjects only, otherwise the list is empty)
 
QStringList memberList ()
 get list of all members (excluding properties, which can be listed with propertyList())
 
int metaTypeId ()
 get the meta type id of this class (only valid for isCPPWrapper() == true)
 
void setDecoratorProvider (PythonQtQObjectCreatorFunctionCB *cb)
 set an additional decorator provider that offers additional decorator slots for this class
 
QObject * decorator ()
 get the decorator qobject instance
 
void addParentClass (const ParentClassInfo &info)
 add the parent class info of a CPP object
 
void setPythonQtClassWrapper (PyObject *obj)
 set the associated PythonQtClassWrapper (which handles instance creation of this type)
 
PyObjectpythonQtClassWrapper ()
 get the associated PythonQtClassWrapper (which handles instance creation of this type)
 
void setShellSetInstanceWrapperCB (PythonQtShellSetInstanceWrapperCB *cb)
 set the shell set instance wrapper cb
 
PythonQtShellSetInstanceWrapperCBshellSetInstanceWrapperCB ()
 get the shell set instance wrapper cb
 
void addPolymorphicHandler (PythonQtPolymorphicHandlerCB *cb)
 add a handler for polymorphic downcasting
 
voidcastDownIfPossible (void *ptr, PythonQtClassInfo **resultClassInfo)
 cast the pointer down in the class hierarchy if a polymorphic handler allows to do that
 
void clearNotFoundCachedMembers ()
 clear all members that where cached as "NotFound"
 
const QList< PythonQtClassInfo * > & nestedClasses ()
 get nested classes
 
PyObjectcopyObject (void *cppObject)
 
PythonQtSlotInfogetCopyConstructor ()
 Get the copy constructor for this class.
 
void setReferenceCounting (PythonQtVoidPtrCB *refCB, PythonQtVoidPtrCB *unrefCB)
 Sets reference counting callbacks for this class and all its subclasses.
 
PythonQtVoidPtrCBreferenceCountingRefCB ()
 Returns the ref counting CB, if there is any.
 
PythonQtVoidPtrCBreferenceCountingUnrefCB ()
 Returns the unref counting CB, if there is any.
 
PyObjectgetPythonTypeForProperty (const QString &name)
 
PythonQtClassInfogetClassInfoForProperty (const QString &name)
 Returns the class info for given property, if available.
 
bool supportsRichCompare ()
 
+ + + + + + + + + + + +

+Static Public Member Functions

static PyObjectfindEnumWrapper (const QByteArray &name, PythonQtClassInfo *localScope, bool *isLocalEnum=nullptr)
 returns if the localScope has an enum of that type name or if the enum contains a :: scope, if that class contails the enum
 
static QByteArray escapeReservedNames (const QByteArray &name)
 
static void addGlobalNamespaceWrapper (PythonQtClassInfo *namespaceWrapper)
 Add a wrapper that contains global enums.
 
static void clearGlobalNamespaceWrappers ()
 
+

Detailed Description

+

a class that stores all required information about a Qt object (and an optional associated C++ class name)

+

for fast lookup of slots when calling the object from Python

+ +

Definition at line 88 of file PythonQtClassInfo.h.

+

Constructor & Destructor Documentation

+ +

◆ PythonQtClassInfo()

+ +
+
+ + + + + + + +
PythonQtClassInfo::PythonQtClassInfo ()
+
+ +
+
+ +

◆ ~PythonQtClassInfo()

+ +
+
+ + + + + + + +
PythonQtClassInfo::~PythonQtClassInfo ()
+
+ +
+
+

Member Function Documentation

+ +

◆ addConstructor()

+ +
+
+ + + + + + + + +
void PythonQtClassInfo::addConstructor (PythonQtSlotInfoinfo)
+
+ +

add a constructor, ownership is passed to classinfo

+ +
+
+ +

◆ addDecoratorSlot()

+ +
+
+ + + + + + + + +
void PythonQtClassInfo::addDecoratorSlot (PythonQtSlotInfoinfo)
+
+ +

add a decorator slot, ownership is passed to classinfo

+ +
+
+ +

◆ addGlobalNamespaceWrapper()

+ +
+
+ + + + + +
+ + + + + + + + +
static void PythonQtClassInfo::addGlobalNamespaceWrapper (PythonQtClassInfonamespaceWrapper)
+
+static
+
+ +

Add a wrapper that contains global enums.

+ +
+
+ +

◆ addNestedClass()

+ +
+
+ + + + + + + + +
void PythonQtClassInfo::addNestedClass (PythonQtClassInfoinfo)
+
+ +

add a nested class, so that it can be shown as outer class member

+ +
+
+ +

◆ addParentClass()

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQtClassInfo::addParentClass (const ParentClassInfoinfo)
+
+inline
+
+ +

add the parent class info of a CPP object

+ +

Definition at line 185 of file PythonQtClassInfo.h.

+
185{ _parentClasses.append(info); }
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
+
+
+ +

◆ addPolymorphicHandler()

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQtClassInfo::addPolymorphicHandler (PythonQtPolymorphicHandlerCBcb)
+
+inline
+
+ +

add a handler for polymorphic downcasting

+ +

Definition at line 200 of file PythonQtClassInfo.h.

+
200{ _polymorphicHandlers.append(cb); }
+
+
+
+ +

◆ castDownIfPossible()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void * PythonQtClassInfo::castDownIfPossible (voidptr,
PythonQtClassInfo ** resultClassInfo 
)
+
+ +

cast the pointer down in the class hierarchy if a polymorphic handler allows to do that

+ +
+
+ +

◆ castTo()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void * PythonQtClassInfo::castTo (voidptr,
const charclassname 
)
+
+

casts the given ptr to an object of type classname, returns the new pointer which might be different to ptr due to C++ multiple inheritance (if the cast is not possible or if ptr is NULL, NULL is returned)

+ +
+
+ +

◆ className()

+ +
+
+ + + + + + + +
const QByteArray & PythonQtClassInfo::className () const
+
+ +

get the classname (either of the QObject or of the wrapped CPP object)

+ +

Referenced by PythonQtConvertListOfKnownClassToPythonList(), and PythonQtConvertPythonListToListOfKnownClass().

+ +
+
+ +

◆ clearGlobalNamespaceWrappers()

+ +
+
+ + + + + +
+ + + + + + + +
static void PythonQtClassInfo::clearGlobalNamespaceWrappers ()
+
+static
+
+

Clear the registry of global-namespace wrappers (used for top-level enums). Must be called before destroying PythonQtClassInfo instances and before a fresh init.

+ +
+
+ +

◆ clearNotFoundCachedMembers()

+ +
+
+ + + + + + + +
void PythonQtClassInfo::clearNotFoundCachedMembers ()
+
+ +

clear all members that where cached as "NotFound"

+ +
+
+ +

◆ constructors()

+ +
+
+ + + + + + + +
PythonQtSlotInfo * PythonQtClassInfo::constructors ()
+
+ +

get access to the constructor slot (which may be overloaded if there are multiple constructors)

+ +
+
+ +

◆ copyObject()

+ +
+
+ + + + + + + + +
PyObject * PythonQtClassInfo::copyObject (voidcppObject)
+
+

Create a copy of the given C++ object (which is known to be of a derived class), wrapped by Python and owned by PythonQt. This will downcast if possible and return a copy of the down casted object. This either requires a copy constructor on the class or it needs to be registered as a meta type.

+ +
+
+ +

◆ decorator()

+ +
+
+ + + + + + + +
QObject * PythonQtClassInfo::decorator ()
+
+ +

get the decorator qobject instance

+ +
+
+ +

◆ destructor()

+ +
+
+ + + + + + + +
PythonQtSlotInfo * PythonQtClassInfo::destructor ()
+
+ +

get access to the destructor slot

+ +
+
+ +

◆ escapeReservedNames()

+ +
+
+ + + + + +
+ + + + + + + + +
static QByteArray PythonQtClassInfo::escapeReservedNames (const QByteArrayname)
+
+static
+
+

Sometimes enum values use a reserved name in Python. In this case replace it with something that is not reserved

+ +
+
+ +

◆ findEnumWrapper()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtClassInfo::findEnumWrapper (const QByteArrayname,
PythonQtClassInfolocalScope,
boolisLocalEnum = nullptr 
)
+
+static
+
+ +

returns if the localScope has an enum of that type name or if the enum contains a :: scope, if that class contails the enum

+ +
+
+ +

◆ getClassInfoForProperty()

+ +
+
+ + + + + + + + +
PythonQtClassInfo * PythonQtClassInfo::getClassInfoForProperty (const QStringname)
+
+ +

Returns the class info for given property, if available.

+ +
+
+ +

◆ getCopyConstructor()

+ +
+
+ + + + + + + +
PythonQtSlotInfo * PythonQtClassInfo::getCopyConstructor ()
+
+ +

Get the copy constructor for this class.

+ +
+
+ +

◆ getPythonTypeForProperty()

+ +
+
+ + + + + + + + +
PyObject * PythonQtClassInfo::getPythonTypeForProperty (const QStringname)
+
+

Returns the Python type object for a given property. (the returned object does not get an extra reference count)

+ +
+
+ +

◆ help()

+ +
+
+ + + + + + + +
QString PythonQtClassInfo::help ()
+
+ +

get help string for the metaobject

+ +
+
+ +

◆ inherits() [1/2]

+ +
+
+ + + + + + + + +
bool PythonQtClassInfo::inherits (const charclassname)
+
+ +

returns if this class inherits from the given classname

+ +
+
+ +

◆ inherits() [2/2]

+ +
+
+ + + + + + + + +
bool PythonQtClassInfo::inherits (PythonQtClassInfoinfo)
+
+ +

returns if this class inherits from the given classinfo

+ +
+
+ +

◆ isCPPWrapper()

+ +
+
+ + + + + +
+ + + + + + + +
bool PythonQtClassInfo::isCPPWrapper ()
+
+inline
+
+ +

returns if the class is a CPP wrapper

+ +

Definition at line 147 of file PythonQtClassInfo.h.

+
147{ return !_isQObject; }
+
+
+
+ +

◆ isQObject()

+ +
+
+ + + + + +
+ + + + + + + +
bool PythonQtClassInfo::isQObject ()
+
+inline
+
+ +

returns if the QObject

+ +

Definition at line 144 of file PythonQtClassInfo.h.

+
144{ return _isQObject; }
+
+
+
+ +

◆ member()

+ +
+
+ + + + + + + + +
PythonQtMemberInfo PythonQtClassInfo::member (const charmember)
+
+ +

get the Python method definition for a given slot name (without return type and signature)

+ +
+
+ +

◆ memberList()

+ +
+
+ + + + + + + +
QStringList PythonQtClassInfo::memberList ()
+
+ +

get list of all members (excluding properties, which can be listed with propertyList())

+ +
+
+ +

◆ metaObject()

+ +
+
+ + + + + +
+ + + + + + + +
const QMetaObject * PythonQtClassInfo::metaObject ()
+
+inline
+
+ +

get the meta object

+ +

Definition at line 150 of file PythonQtClassInfo.h.

+
150{ return _meta; }
+
+
+
+ +

◆ metaTypeId()

+ +
+
+ + + + + +
+ + + + + + + +
int PythonQtClassInfo::metaTypeId ()
+
+inline
+
+ +

get the meta type id of this class (only valid for isCPPWrapper() == true)

+ +

Definition at line 176 of file PythonQtClassInfo.h.

+
176{ return _metaTypeId; }
+
+
+
+ +

◆ nestedClasses()

+ +
+
+ + + + + +
+ + + + + + + +
const QList< PythonQtClassInfo * > & PythonQtClassInfo::nestedClasses ()
+
+inline
+
+ +

get nested classes

+ +

Definition at line 212 of file PythonQtClassInfo.h.

+
212{ return _nestedClasses; }
+
+
+
+ +

◆ propertyList()

+ +
+
+ + + + + + + +
QStringList PythonQtClassInfo::propertyList ()
+
+ +

get list of all properties (on QObjects only, otherwise the list is empty)

+ +
+
+ +

◆ pythonQtClassWrapper()

+ +
+
+ + + + + +
+ + + + + + + +
PyObject * PythonQtClassInfo::pythonQtClassWrapper ()
+
+inline
+
+ +

get the associated PythonQtClassWrapper (which handles instance creation of this type)

+ +

Definition at line 191 of file PythonQtClassInfo.h.

+
191{ return _pythonQtClassWrapper; }
+
+
+
+ +

◆ referenceCountingRefCB()

+ +
+
+ + + + + + + +
PythonQtVoidPtrCB * PythonQtClassInfo::referenceCountingRefCB ()
+
+ +

Returns the ref counting CB, if there is any.

+ +
+
+ +

◆ referenceCountingUnrefCB()

+ +
+
+ + + + + + + +
PythonQtVoidPtrCB * PythonQtClassInfo::referenceCountingUnrefCB ()
+
+ +

Returns the unref counting CB, if there is any.

+ +
+
+ +

◆ setDecoratorProvider()

+ +
+
+ + + + + + + + +
void PythonQtClassInfo::setDecoratorProvider (PythonQtQObjectCreatorFunctionCBcb)
+
+ +

set an additional decorator provider that offers additional decorator slots for this class

+ +
+
+ +

◆ setDestructor()

+ +
+
+ + + + + + + + +
void PythonQtClassInfo::setDestructor (PythonQtSlotInfoinfo)
+
+ +

set a destructor, ownership is passed to classinfo

+ +
+
+ +

◆ setMetaObject()

+ +
+
+ + + + + + + + +
void PythonQtClassInfo::setMetaObject (const QMetaObjectmeta)
+
+ +

set the meta object, this will reset the caching

+ +
+
+ +

◆ setPythonQtClassWrapper()

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQtClassInfo::setPythonQtClassWrapper (PyObjectobj)
+
+inline
+
+ +

set the associated PythonQtClassWrapper (which handles instance creation of this type)

+ +

Definition at line 188 of file PythonQtClassInfo.h.

+
188{ _pythonQtClassWrapper = obj; }
+
+
+
+ +

◆ setReferenceCounting()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void PythonQtClassInfo::setReferenceCounting (PythonQtVoidPtrCBrefCB,
PythonQtVoidPtrCBunrefCB 
)
+
+ +

Sets reference counting callbacks for this class and all its subclasses.

+ +
+
+ +

◆ setShellSetInstanceWrapperCB()

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQtClassInfo::setShellSetInstanceWrapperCB (PythonQtShellSetInstanceWrapperCBcb)
+
+inline
+
+ +

set the shell set instance wrapper cb

+ +

Definition at line 194 of file PythonQtClassInfo.h.

+
194{ _shellSetInstanceWrapperCB = cb; }
+
+
+
+ +

◆ setTypeSlots()

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQtClassInfo::setTypeSlots (int typeSlots)
+
+inline
+
+ +

set the type capabilities

+ +

Definition at line 112 of file PythonQtClassInfo.h.

+
112{ _typeSlots = typeSlots; }
+
int typeSlots() const
get the type capabilities
+
+
+
+ +

◆ setupCPPObject()

+ +
+
+ + + + + + + + +
void PythonQtClassInfo::setupCPPObject (const QByteArrayclassname)
+
+ +

setup as a CPP (non-QObject), taking the classname

+ +
+
+ +

◆ setupQObject()

+ +
+
+ + + + + + + + +
void PythonQtClassInfo::setupQObject (const QMetaObjectmeta)
+
+ +

setup as a QObject, taking the meta object as meta information about the QObject

+ +
+
+ +

◆ shellSetInstanceWrapperCB()

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtShellSetInstanceWrapperCB * PythonQtClassInfo::shellSetInstanceWrapperCB ()
+
+inline
+
+ +

get the shell set instance wrapper cb

+ +

Definition at line 197 of file PythonQtClassInfo.h.

+
197{ return _shellSetInstanceWrapperCB; }
+
+
+
+ +

◆ supportsRichCompare()

+ +
+
+ + + + + + + +
bool PythonQtClassInfo::supportsRichCompare ()
+
+

Returns if the class supports rich compare. This tests for eq, ne, lt, le, gt, ge slots and if any of the slots is present it returns true and modifies the _typeSlots with Type_RichCompare. The result is cached internally.

+ +
+
+ +

◆ typeSlots()

+ +
+
+ + + + + +
+ + + + + + + +
int PythonQtClassInfo::typeSlots () const
+
+inline
+
+ +

get the type capabilities

+ +

Definition at line 114 of file PythonQtClassInfo.h.

+
114{ return _typeSlots; }
+
+
+
+ +

◆ unscopedClassName()

+ +
+
+ + + + + + + +
QByteArray PythonQtClassInfo::unscopedClassName () const
+
+ +

get the unscoped classname (without ParentClass::) for nested classes

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtConfigAPI-members.html b/classPythonQtConfigAPI-members.html new file mode 100644 index 000000000..983e7b3dc --- /dev/null +++ b/classPythonQtConfigAPI-members.html @@ -0,0 +1,56 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtConfigAPI Member List
+
+
+ +

This is the complete list of members for PythonQtConfigAPI, including all inherited members.

+ + + +
PythonQtConfigAPI(QObject *parent)PythonQtConfigAPIinline
setTaskDoneCallback(PyObject *object)PythonQtConfigAPIslot
+ + + + diff --git a/classPythonQtConfigAPI.html b/classPythonQtConfigAPI.html new file mode 100644 index 000000000..62d760ef1 --- /dev/null +++ b/classPythonQtConfigAPI.html @@ -0,0 +1,142 @@ + + + + + + + +PythonQt: PythonQtConfigAPI Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtConfigAPI Class Reference
+
+
+ +

Some methods to set properties of PythonQt from Python. + More...

+ +

#include <PythonQtStdDecorators.h>

+
+Inheritance diagram for PythonQtConfigAPI:
+
+
+ +
+ + + + +

+Public Slots

void setTaskDoneCallback (PyObject *object)
 
+ + + +

+Public Member Functions

 PythonQtConfigAPI (QObject *parent)
 
+

Detailed Description

+

Some methods to set properties of PythonQt from Python.

+ +

Definition at line 225 of file PythonQtStdDecorators.h.

+

Constructor & Destructor Documentation

+ +

◆ PythonQtConfigAPI()

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtConfigAPI::PythonQtConfigAPI (QObject * parent)
+
+inline
+
+ +

Definition at line 229 of file PythonQtStdDecorators.h.

+
230 : QObject(parent) {};
+
+
+
+

Member Function Documentation

+ +

◆ setTaskDoneCallback

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQtConfigAPI::setTaskDoneCallback (PyObjectobject)
+
+slot
+
+

Set a callable that is used as the argument for the add_done_callback for the Task/Future created when, e.g., an async function is connected to signal.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtConfigAPI.png b/classPythonQtConfigAPI.png new file mode 100644 index 000000000..3fb09f3eb Binary files /dev/null and b/classPythonQtConfigAPI.png differ diff --git a/classPythonQtConv-members.html b/classPythonQtConv-members.html new file mode 100644 index 000000000..b4c689129 --- /dev/null +++ b/classPythonQtConv-members.html @@ -0,0 +1,103 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtConv Member List
+
+
+ +

This is the complete list of members for PythonQtConv, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
_metaTypeToPythonConvertersPythonQtConvprotectedstatic
_pythonSequenceToQVariantListCBPythonQtConvprotectedstatic
_pythonToMetaTypeConvertersPythonQtConvprotectedstatic
castWrapperTo(PythonQtInstanceWrapper *wrapper, const QByteArray &className, bool &ok)PythonQtConvstatic
convertFromPythonQtObjectPtr(const void *inObject, int)PythonQtConvstatic
convertFromPythonQtSafeObjectPtr(const void *inObject, int)PythonQtConvstatic
convertFromQListOfPythonQtObjectPtr(const void *inObject, int)PythonQtConvstatic
convertFromStringRef(const void *inObject, int)PythonQtConvstatic
ConvertPythonListToQListOfPointerType(PyObject *obj, QList< void * > *list, const PythonQtMethodInfo::ParameterInfo &info, bool strict)PythonQtConvprotectedstatic
ConvertPythonToQt(const PythonQtMethodInfo::ParameterInfo &info, PyObject *obj, bool strict, PythonQtClassInfo *classInfo, void *alreadyAllocatedCPPObject, PythonQtArgumentFrame *frame=nullptr)PythonQtConvstatic
ConvertQListOfPointerTypeToPythonList(QList< void * > *list, const PythonQtMethodInfo::ParameterInfo &info)PythonQtConvprotectedstatic
ConvertQtValueToPython(const PythonQtMethodInfo::ParameterInfo &info, const void *data)PythonQtConvstatic
convertQtValueToPythonInternal(int type, const void *data)PythonQtConvstatic
convertToPythonQtObjectPtr(PyObject *obj, void *outPtr, int, bool)PythonQtConvstatic
convertToPythonQtSafeObjectPtr(PyObject *obj, void *outPtr, int, bool)PythonQtConvstatic
convertToQListOfPythonQtObjectPtr(PyObject *obj, void *outList, int, bool)PythonQtConvstatic
CPPObjectToString(int type, const void *data)PythonQtConvstatic
createCopyFromMetaType(int type, const void *object)PythonQtConvstatic
CreateQtReturnValue(const PythonQtMethodInfo::ParameterInfo &info, PythonQtArgumentFrame *frame)PythonQtConvstatic
getCPPTypeName(PyObject *type)PythonQtConvstatic
GetPyBool(bool val)PythonQtConvstatic
handlePythonToQtAutoConversion(int typeId, PyObject *obj, void *alreadyAllocatedCPPObject, PythonQtArgumentFrame *frame)PythonQtConvprotectedstatic
isStringType(PyTypeObject *type)PythonQtConvstatic
mapToPython(const Map &m)PythonQtConvprotectedstatic
PyObjGetBool(PyObject *val, bool strict, bool &ok)PythonQtConvstatic
PyObjGetBytes(PyObject *val, bool strict, bool &ok)PythonQtConvstatic
PyObjGetBytesAllowString(PyObject *val, bool strict, bool &ok)PythonQtConvstatic
PyObjGetDouble(PyObject *val, bool strict, bool &ok)PythonQtConvstatic
PyObjGetInt(PyObject *val, bool strict, bool &ok)PythonQtConvstatic
PyObjGetLongLong(PyObject *val, bool strict, bool &ok)PythonQtConvstatic
PyObjGetRepresentation(PyObject *val)PythonQtConvstatic
PyObjGetString(PyObject *val)PythonQtConvinlinestatic
PyObjGetString(PyObject *val, bool strict, bool &ok)PythonQtConvstatic
PyObjGetULongLong(PyObject *val, bool strict, bool &ok)PythonQtConvstatic
PyObjToQVariant(PyObject *val, int type=-1)PythonQtConvstatic
PyObjToStringList(PyObject *val, bool strict, bool &ok)PythonQtConvstatic
pythonToMapVariant(PyObject *val, QVariant &result)PythonQtConvprotectedstatic
QStringListToPyList(const QStringList &list)PythonQtConvstatic
QStringListToPyObject(const QStringList &list)PythonQtConvstatic
QStringToPyObject(const QString &str)PythonQtConvstatic
QVariantHashToPyObject(const QVariantHash &m)PythonQtConvstatic
QVariantListToPyObject(const QVariantList &l)PythonQtConvstatic
QVariantMapToPyObject(const QVariantMap &m)PythonQtConvstatic
QVariantToPyObject(const QVariant &v)PythonQtConvstatic
registerMetaTypeToPythonConverter(int metaTypeId, PythonQtConvertMetaTypeToPythonCB *cb)PythonQtConvinlinestatic
registerPythonToMetaTypeConverter(int metaTypeId, PythonQtConvertPythonToMetaTypeCB *cb)PythonQtConvinlinestatic
registerStringViewTypes()PythonQtConvstatic
setPythonSequenceToQVariantListCallback(PythonQtConvertPythonSequenceToQVariantListCB *cb)PythonQtConvinlinestatic
stringRefTypeIdPythonQtConvprotectedstatic
+ + + + diff --git a/classPythonQtConv.html b/classPythonQtConv.html new file mode 100644 index 000000000..f366d080a --- /dev/null +++ b/classPythonQtConv.html @@ -0,0 +1,2027 @@ + + + + + + + +PythonQt: PythonQtConv Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+ +
+ +

a static class that offers methods for type conversion + More...

+ +

#include <PythonQtConversion.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Static Public Member Functions

static PyObjectGetPyBool (bool val)
 get a ref counted True or False Python object
 
static PyObjectConvertQtValueToPython (const PythonQtMethodInfo::ParameterInfo &info, const void *data)
 converts the Qt parameter given in data, interpreting it as a info parameter, into a Python object,
 
static voidConvertPythonToQt (const PythonQtMethodInfo::ParameterInfo &info, PyObject *obj, bool strict, PythonQtClassInfo *classInfo, void *alreadyAllocatedCPPObject, PythonQtArgumentFrame *frame=nullptr)
 
static voidCreateQtReturnValue (const PythonQtMethodInfo::ParameterInfo &info, PythonQtArgumentFrame *frame)
 creates a data storage for the passed parameter type and returns a void pointer to be set as arg[0] of qt_metacall
 
static PyObjectQStringToPyObject (const QString &str)
 converts QString to Python string (unicode!)
 
static PyObjectQStringListToPyObject (const QStringList &list)
 converts QStringList to Python tuple
 
static PyObjectQStringListToPyList (const QStringList &list)
 converts QStringList to Python list
 
static QString PyObjGetRepresentation (PyObject *val)
 get string representation of py object
 
static QString PyObjGetString (PyObject *val)
 get string value from py object
 
static QString PyObjGetString (PyObject *val, bool strict, bool &ok)
 get string value from py object
 
static QByteArray PyObjGetBytes (PyObject *val, bool strict, bool &ok)
 get bytes from py object
 
static QByteArray PyObjGetBytesAllowString (PyObject *val, bool strict, bool &ok)
 get bytes from py object, also allows Python string
 
static int PyObjGetInt (PyObject *val, bool strict, bool &ok)
 get int from py object
 
static qint64 PyObjGetLongLong (PyObject *val, bool strict, bool &ok)
 get int64 from py object
 
static quint64 PyObjGetULongLong (PyObject *val, bool strict, bool &ok)
 get int64 from py object
 
static double PyObjGetDouble (PyObject *val, bool strict, bool &ok)
 get double from py object
 
static bool PyObjGetBool (PyObject *val, bool strict, bool &ok)
 get bool from py object
 
static QStringList PyObjToStringList (PyObject *val, bool strict, bool &ok)
 create a string list from python sequence
 
static QVariant PyObjToQVariant (PyObject *val, int type=-1)
 
static PyObjectQVariantToPyObject (const QVariant &v)
 convert QVariant from PyObject
 
static PyObjectQVariantHashToPyObject (const QVariantHash &m)
 
static PyObjectQVariantMapToPyObject (const QVariantMap &m)
 
static PyObjectQVariantListToPyObject (const QVariantList &l)
 
static QString CPPObjectToString (int type, const void *data)
 get human readable string from CPP object (when the metatype is known)
 
static void registerPythonToMetaTypeConverter (int metaTypeId, PythonQtConvertPythonToMetaTypeCB *cb)
 register a converter callback from python to cpp for given metatype
 
static void registerMetaTypeToPythonConverter (int metaTypeId, PythonQtConvertMetaTypeToPythonCB *cb)
 register a converter callback from cpp to python for given metatype
 
static void setPythonSequenceToQVariantListCallback (PythonQtConvertPythonSequenceToQVariantListCB *cb)
 
static PyObjectconvertQtValueToPythonInternal (int type, const void *data)
 converts the Qt parameter given in data, interpreting it as a type registered qvariant/meta type, into a Python object,
 
static PyObjectcreateCopyFromMetaType (int type, const void *object)
 creates a copy of given object, using the QMetaType
 
static voidcastWrapperTo (PythonQtInstanceWrapper *wrapper, const QByteArray &className, bool &ok)
 cast wrapper to given className if possible
 
static bool convertToPythonQtObjectPtr (PyObject *obj, void *outPtr, int, bool)
 
static PyObjectconvertFromPythonQtObjectPtr (const void *inObject, int)
 
static bool convertToPythonQtSafeObjectPtr (PyObject *obj, void *outPtr, int, bool)
 
static PyObjectconvertFromPythonQtSafeObjectPtr (const void *inObject, int)
 
static bool convertToQListOfPythonQtObjectPtr (PyObject *obj, void *outList, int, bool)
 
static PyObjectconvertFromQListOfPythonQtObjectPtr (const void *inObject, int)
 
static PyObjectconvertFromStringRef (const void *inObject, int)
 
static QByteArray getCPPTypeName (PyObject *type)
 Returns the name of the equivalent CPP type (for signals and slots)
 
static bool isStringType (PyTypeObject *type)
 Returns if the given object is a string (or unicode string)
 
static void registerStringViewTypes ()
 Register QStringView like types, that need to be handled specially.
 
+ + + + + + + + + + + + + + + + + + +

+Static Protected Member Functions

static voidhandlePythonToQtAutoConversion (int typeId, PyObject *obj, void *alreadyAllocatedCPPObject, PythonQtArgumentFrame *frame)
 handle automatic conversion of some special types (QColor, QBrush, ...)
 
static PyObjectConvertQListOfPointerTypeToPythonList (QList< void * > *list, const PythonQtMethodInfo::ParameterInfo &info)
 converts the list of pointers of given type to Python
 
static bool ConvertPythonListToQListOfPointerType (PyObject *obj, QList< void * > *list, const PythonQtMethodInfo::ParameterInfo &info, bool strict)
 tries to convert the python object to a QList of pointers to type objects, returns true on success
 
template<typename Map >
static void pythonToMapVariant (PyObject *val, QVariant &result)
 helper template method for conversion from Python to QVariantMap/Hash
 
template<typename Map >
static PyObjectmapToPython (const Map &m)
 helper template function for QVariantMapToPyObject/QVariantHashToPyObject
 
+ + + + + + + + + +

+Static Protected Attributes

static QHash< int, PythonQtConvertMetaTypeToPythonCB * > _metaTypeToPythonConverters
 
static QHash< int, PythonQtConvertPythonToMetaTypeCB * > _pythonToMetaTypeConverters
 
static PythonQtConvertPythonSequenceToQVariantListCB_pythonSequenceToQVariantListCB
 
static int stringRefTypeId
 
+

Detailed Description

+

a static class that offers methods for type conversion

+ +

Definition at line 113 of file PythonQtConversion.h.

+

Member Function Documentation

+ +

◆ castWrapperTo()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static void * PythonQtConv::castWrapperTo (PythonQtInstanceWrapperwrapper,
const QByteArrayclassName,
boolok 
)
+
+static
+
+ +

cast wrapper to given className if possible

+ +

Referenced by PythonQtConvertPythonListToListOfKnownClass().

+ +
+
+ +

◆ convertFromPythonQtObjectPtr()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtConv::convertFromPythonQtObjectPtr (const voidinObject,
int  
)
+
+static
+
+ +
+
+ +

◆ convertFromPythonQtSafeObjectPtr()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtConv::convertFromPythonQtSafeObjectPtr (const voidinObject,
int  
)
+
+static
+
+ +
+
+ +

◆ convertFromQListOfPythonQtObjectPtr()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtConv::convertFromQListOfPythonQtObjectPtr (const voidinObject,
int  
)
+
+static
+
+ +
+
+ +

◆ convertFromStringRef()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtConv::convertFromStringRef (const voidinObject,
int  
)
+
+static
+
+ +
+
+ +

◆ ConvertPythonListToQListOfPointerType()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static bool PythonQtConv::ConvertPythonListToQListOfPointerType (PyObjectobj,
QList< void * > * list,
const PythonQtMethodInfo::ParameterInfoinfo,
bool strict 
)
+
+staticprotected
+
+ +

tries to convert the python object to a QList of pointers to type objects, returns true on success

+ +
+
+ +

◆ ConvertPythonToQt()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static void * PythonQtConv::ConvertPythonToQt (const PythonQtMethodInfo::ParameterInfoinfo,
PyObjectobj,
bool strict,
PythonQtClassInfoclassInfo,
voidalreadyAllocatedCPPObject,
PythonQtArgumentFrameframe = nullptr 
)
+
+static
+
+

convert python object to Qt (according to the given parameter) and if the conversion should be strict (classInfo is currently not used anymore) If an alreadyAllocatedCPPObject is used it must have the same type as given by info.typeId

+ +
+
+ +

◆ ConvertQListOfPointerTypeToPythonList()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtConv::ConvertQListOfPointerTypeToPythonList (QList< void * > * list,
const PythonQtMethodInfo::ParameterInfoinfo 
)
+
+staticprotected
+
+ +

converts the list of pointers of given type to Python

+ +
+
+ +

◆ ConvertQtValueToPython()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtConv::ConvertQtValueToPython (const PythonQtMethodInfo::ParameterInfoinfo,
const voiddata 
)
+
+static
+
+ +

converts the Qt parameter given in data, interpreting it as a info parameter, into a Python object,

+ +
+
+ +

◆ convertQtValueToPythonInternal()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtConv::convertQtValueToPythonInternal (int type,
const voiddata 
)
+
+static
+
+ +

converts the Qt parameter given in data, interpreting it as a type registered qvariant/meta type, into a Python object,

+ +

Referenced by PythonQtConvertIntegerMapToPython(), PythonQtConvertListOfValueTypeToPythonList(), and PythonQtConvertPairToPython().

+ +
+
+ +

◆ convertToPythonQtObjectPtr()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static bool PythonQtConv::convertToPythonQtObjectPtr (PyObjectobj,
voidoutPtr,
int ,
bool  
)
+
+static
+
+ +
+
+ +

◆ convertToPythonQtSafeObjectPtr()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static bool PythonQtConv::convertToPythonQtSafeObjectPtr (PyObjectobj,
voidoutPtr,
int ,
bool  
)
+
+static
+
+ +
+
+ +

◆ convertToQListOfPythonQtObjectPtr()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static bool PythonQtConv::convertToQListOfPythonQtObjectPtr (PyObjectobj,
voidoutList,
int ,
bool  
)
+
+static
+
+ +
+
+ +

◆ CPPObjectToString()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static QString PythonQtConv::CPPObjectToString (int type,
const voiddata 
)
+
+static
+
+ +

get human readable string from CPP object (when the metatype is known)

+ +
+
+ +

◆ createCopyFromMetaType()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtConv::createCopyFromMetaType (int type,
const voidobject 
)
+
+static
+
+ +

creates a copy of given object, using the QMetaType

+ +
+
+ +

◆ CreateQtReturnValue()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static void * PythonQtConv::CreateQtReturnValue (const PythonQtMethodInfo::ParameterInfoinfo,
PythonQtArgumentFrameframe 
)
+
+static
+
+ +

creates a data storage for the passed parameter type and returns a void pointer to be set as arg[0] of qt_metacall

+ +
+
+ +

◆ getCPPTypeName()

+ +
+
+ + + + + +
+ + + + + + + + +
static QByteArray PythonQtConv::getCPPTypeName (PyObjecttype)
+
+static
+
+ +

Returns the name of the equivalent CPP type (for signals and slots)

+ +
+
+ +

◆ GetPyBool()

+ +
+
+ + + + + +
+ + + + + + + + +
static PyObject * PythonQtConv::GetPyBool (bool val)
+
+static
+
+ +

get a ref counted True or False Python object

+ +
+
+ +

◆ handlePythonToQtAutoConversion()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static void * PythonQtConv::handlePythonToQtAutoConversion (int typeId,
PyObjectobj,
voidalreadyAllocatedCPPObject,
PythonQtArgumentFrameframe 
)
+
+staticprotected
+
+ +

handle automatic conversion of some special types (QColor, QBrush, ...)

+ +
+
+ +

◆ isStringType()

+ +
+
+ + + + + +
+ + + + + + + + +
static bool PythonQtConv::isStringType (PyTypeObjecttype)
+
+static
+
+ +

Returns if the given object is a string (or unicode string)

+ +
+
+ +

◆ mapToPython()

+ +
+
+
+template<typename Map >
+ + + + + +
+ + + + + + + + +
static PyObject * PythonQtConv::mapToPython (const Mapm)
+
+staticprotected
+
+ +

helper template function for QVariantMapToPyObject/QVariantHashToPyObject

+ +
+
+ +

◆ PyObjGetBool()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static bool PythonQtConv::PyObjGetBool (PyObjectval,
bool strict,
boolok 
)
+
+static
+
+ +

get bool from py object

+ +
+
+ +

◆ PyObjGetBytes()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static QByteArray PythonQtConv::PyObjGetBytes (PyObjectval,
bool strict,
boolok 
)
+
+static
+
+ +

get bytes from py object

+ +
+
+ +

◆ PyObjGetBytesAllowString()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static QByteArray PythonQtConv::PyObjGetBytesAllowString (PyObjectval,
bool strict,
boolok 
)
+
+static
+
+ +

get bytes from py object, also allows Python string

+ +
+
+ +

◆ PyObjGetDouble()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static double PythonQtConv::PyObjGetDouble (PyObjectval,
bool strict,
boolok 
)
+
+static
+
+ +

get double from py object

+ +
+
+ +

◆ PyObjGetInt()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static int PythonQtConv::PyObjGetInt (PyObjectval,
bool strict,
boolok 
)
+
+static
+
+ +

get int from py object

+ +

Referenced by PythonQtConvertPythonToIntegerMap().

+ +
+
+ +

◆ PyObjGetLongLong()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static qint64 PythonQtConv::PyObjGetLongLong (PyObjectval,
bool strict,
boolok 
)
+
+static
+
+ +

get int64 from py object

+ +
+
+ +

◆ PyObjGetRepresentation()

+ +
+
+ + + + + +
+ + + + + + + + +
static QString PythonQtConv::PyObjGetRepresentation (PyObjectval)
+
+static
+
+ +

get string representation of py object

+ +
+
+ +

◆ PyObjGetString() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
static QString PythonQtConv::PyObjGetString (PyObjectval)
+
+inlinestatic
+
+ +

get string value from py object

+ +

Definition at line 145 of file PythonQtConversion.h.

+
146 {
+
147 bool ok;
+
148 QString s = PyObjGetString(val, false, ok);
+
149 return s;
+
150 }
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
static QString PyObjGetString(PyObject *val)
get string value from py object
+
+
+
+ +

◆ PyObjGetString() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static QString PythonQtConv::PyObjGetString (PyObjectval,
bool strict,
boolok 
)
+
+static
+
+ +

get string value from py object

+ +
+
+ +

◆ PyObjGetULongLong()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static quint64 PythonQtConv::PyObjGetULongLong (PyObjectval,
bool strict,
boolok 
)
+
+static
+
+ +

get int64 from py object

+ +
+
+ +

◆ PyObjToQVariant()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static QVariant PythonQtConv::PyObjToQVariant (PyObjectval,
int type = -1 
)
+
+static
+
+

convert python object to qvariant, if type is given it will try to create a qvariant of that type, otherwise it will guess from the python type

+ +

Referenced by PythonQtConvertPythonListToListOfValueType(), PythonQtConvertPythonToIntegerMap(), and PythonQtConvertPythonToPair().

+ +
+
+ +

◆ PyObjToStringList()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static QStringList PythonQtConv::PyObjToStringList (PyObjectval,
bool strict,
boolok 
)
+
+static
+
+ +

create a string list from python sequence

+ +
+
+ +

◆ pythonToMapVariant()

+ +
+
+
+template<typename Map >
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static void PythonQtConv::pythonToMapVariant (PyObjectval,
QVariantresult 
)
+
+staticprotected
+
+ +

helper template method for conversion from Python to QVariantMap/Hash

+ +
+
+ +

◆ QStringListToPyList()

+ +
+
+ + + + + +
+ + + + + + + + +
static PyObject * PythonQtConv::QStringListToPyList (const QStringListlist)
+
+static
+
+ +

converts QStringList to Python list

+ +
+
+ +

◆ QStringListToPyObject()

+ +
+
+ + + + + +
+ + + + + + + + +
static PyObject * PythonQtConv::QStringListToPyObject (const QStringListlist)
+
+static
+
+ +

converts QStringList to Python tuple

+ +
+
+ +

◆ QStringToPyObject()

+ +
+
+ + + + + +
+ + + + + + + + +
static PyObject * PythonQtConv::QStringToPyObject (const QStringstr)
+
+static
+
+ +

converts QString to Python string (unicode!)

+ +
+
+ +

◆ QVariantHashToPyObject()

+ +
+
+ + + + + +
+ + + + + + + + +
static PyObject * PythonQtConv::QVariantHashToPyObject (const QVariantHashm)
+
+static
+
+ +
+
+ +

◆ QVariantListToPyObject()

+ +
+
+ + + + + +
+ + + + + + + + +
static PyObject * PythonQtConv::QVariantListToPyObject (const QVariantListl)
+
+static
+
+ +
+
+ +

◆ QVariantMapToPyObject()

+ +
+
+ + + + + +
+ + + + + + + + +
static PyObject * PythonQtConv::QVariantMapToPyObject (const QVariantMapm)
+
+static
+
+ +
+
+ +

◆ QVariantToPyObject()

+ +
+
+ + + + + +
+ + + + + + + + +
static PyObject * PythonQtConv::QVariantToPyObject (const QVariantv)
+
+static
+
+ +

convert QVariant from PyObject

+ +
+
+ +

◆ registerMetaTypeToPythonConverter()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static void PythonQtConv::registerMetaTypeToPythonConverter (int metaTypeId,
PythonQtConvertMetaTypeToPythonCBcb 
)
+
+inlinestatic
+
+ +

register a converter callback from cpp to python for given metatype

+ +

Definition at line 192 of file PythonQtConversion.h.

+
193 {
+
194 _metaTypeToPythonConverters.insert(metaTypeId, cb);
+
195 }
+
static QHash< int, PythonQtConvertMetaTypeToPythonCB * > _metaTypeToPythonConverters
+
+
+
+ +

◆ registerPythonToMetaTypeConverter()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static void PythonQtConv::registerPythonToMetaTypeConverter (int metaTypeId,
PythonQtConvertPythonToMetaTypeCBcb 
)
+
+inlinestatic
+
+ +

register a converter callback from python to cpp for given metatype

+ +

Definition at line 186 of file PythonQtConversion.h.

+
187 {
+
188 _pythonToMetaTypeConverters.insert(metaTypeId, cb);
+
189 }
+
static QHash< int, PythonQtConvertPythonToMetaTypeCB * > _pythonToMetaTypeConverters
+
+
+
+ +

◆ registerStringViewTypes()

+ +
+
+ + + + + +
+ + + + + + + +
static void PythonQtConv::registerStringViewTypes ()
+
+static
+
+ +

Register QStringView like types, that need to be handled specially.

+ +
+
+ +

◆ setPythonSequenceToQVariantListCallback()

+ +
+
+ + + + + +
+ + + + + + + + +
static void PythonQtConv::setPythonSequenceToQVariantListCallback (PythonQtConvertPythonSequenceToQVariantListCBcb)
+
+inlinestatic
+
+

set a callback that is called when a Python sequence should be converted to a QVariantList to allow special conversion.

+ +

Definition at line 199 of file PythonQtConversion.h.

+
200 {
+ +
202 }
+
static PythonQtConvertPythonSequenceToQVariantListCB * _pythonSequenceToQVariantListCB
+
+
+
+

Member Data Documentation

+ +

◆ _metaTypeToPythonConverters

+ +
+
+ + + + + +
+ + + + +
QHash<int, PythonQtConvertMetaTypeToPythonCB*> PythonQtConv::_metaTypeToPythonConverters
+
+staticprotected
+
+ +

Definition at line 241 of file PythonQtConversion.h.

+ +
+
+ +

◆ _pythonSequenceToQVariantListCB

+ +
+
+ + + + + +
+ + + + +
PythonQtConvertPythonSequenceToQVariantListCB* PythonQtConv::_pythonSequenceToQVariantListCB
+
+staticprotected
+
+ +

Definition at line 243 of file PythonQtConversion.h.

+ +
+
+ +

◆ _pythonToMetaTypeConverters

+ +
+
+ + + + + +
+ + + + +
QHash<int, PythonQtConvertPythonToMetaTypeCB*> PythonQtConv::_pythonToMetaTypeConverters
+
+staticprotected
+
+ +

Definition at line 242 of file PythonQtConversion.h.

+ +
+
+ +

◆ stringRefTypeId

+ +
+
+ + + + + +
+ + + + +
int PythonQtConv::stringRefTypeId
+
+staticprotected
+
+ +

Definition at line 264 of file PythonQtConversion.h.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtCppWrapperFactory-members.html b/classPythonQtCppWrapperFactory-members.html new file mode 100644 index 000000000..b8f797caf --- /dev/null +++ b/classPythonQtCppWrapperFactory-members.html @@ -0,0 +1,57 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtCppWrapperFactory Member List
+
+
+ +

This is the complete list of members for PythonQtCppWrapperFactory, including all inherited members.

+ + + + +
create(const QByteArray &classname, void *ptr)=0PythonQtCppWrapperFactorypure virtual
PythonQtCppWrapperFactory()PythonQtCppWrapperFactoryinline
~PythonQtCppWrapperFactory()PythonQtCppWrapperFactoryinlinevirtual
+ + + + diff --git a/classPythonQtCppWrapperFactory.html b/classPythonQtCppWrapperFactory.html new file mode 100644 index 000000000..cb50150b1 --- /dev/null +++ b/classPythonQtCppWrapperFactory.html @@ -0,0 +1,174 @@ + + + + + + + +PythonQt: PythonQtCppWrapperFactory Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtCppWrapperFactory Class Referenceabstract
+
+
+ +

Factory interface for C++ classes that can be wrapped by QObject objects. + More...

+ +

#include <PythonQtCppWrapperFactory.h>

+ + + + + + + + + +

+Public Member Functions

 PythonQtCppWrapperFactory ()
 
virtual ~PythonQtCppWrapperFactory ()
 
virtual QObject * create (const QByteArray &classname, void *ptr)=0
 create a wrapper for the given object
 
+

Detailed Description

+

Factory interface for C++ classes that can be wrapped by QObject objects.

+

To create your own factory, derive PythonQtCppWrapperFactory and implement the create() method. A factory can be added to PythonQt by PythonQt::addCppWrapperFactory().

+ +

Definition at line 56 of file PythonQtCppWrapperFactory.h.

+

Constructor & Destructor Documentation

+ +

◆ PythonQtCppWrapperFactory()

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtCppWrapperFactory::PythonQtCppWrapperFactory ()
+
+inline
+
+ +

Definition at line 60 of file PythonQtCppWrapperFactory.h.

+
60{};
+
+
+
+ +

◆ ~PythonQtCppWrapperFactory()

+ +
+
+ + + + + +
+ + + + + + + +
virtual PythonQtCppWrapperFactory::~PythonQtCppWrapperFactory ()
+
+inlinevirtual
+
+ +

Definition at line 61 of file PythonQtCppWrapperFactory.h.

+
61{};
+
+
+
+

Member Function Documentation

+ +

◆ create()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual QObject * PythonQtCppWrapperFactory::create (const QByteArrayclassname,
voidptr 
)
+
+pure virtual
+
+ +

create a wrapper for the given object

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtDebugAPI-members.html b/classPythonQtDebugAPI-members.html new file mode 100644 index 000000000..8bd5a4ffc --- /dev/null +++ b/classPythonQtDebugAPI-members.html @@ -0,0 +1,62 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtDebugAPI Member List
+
+
+ +

This is the complete list of members for PythonQtDebugAPI, including all inherited members.

+ + + + + + + + + +
hasExtraShellRefCount(PyObject *object)PythonQtDebugAPIslot
isDerivedShellInstance(PyObject *object)PythonQtDebugAPIslot
isOwnedByPython(PyObject *object)PythonQtDebugAPIslot
isPythonQtClassWrapper(PyObject *object)PythonQtDebugAPIslot
isPythonQtInstanceWrapper(PyObject *object)PythonQtDebugAPIslot
passOwnershipToCPP(PyObject *object)PythonQtDebugAPIslot
passOwnershipToPython(PyObject *object)PythonQtDebugAPIslot
PythonQtDebugAPI(QObject *parent)PythonQtDebugAPIinline
+ + + + diff --git a/classPythonQtDebugAPI.html b/classPythonQtDebugAPI.html new file mode 100644 index 000000000..583624adf --- /dev/null +++ b/classPythonQtDebugAPI.html @@ -0,0 +1,330 @@ + + + + + + + +PythonQt: PythonQtDebugAPI Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtDebugAPI Class Reference
+
+
+ +

Some helper methods that allow testing of the ownership. + More...

+ +

#include <PythonQtStdDecorators.h>

+
+Inheritance diagram for PythonQtDebugAPI:
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +

+Public Slots

bool isOwnedByPython (PyObject *object)
 Returns if the C++ object is owned by PythonQt and will be deleted when the reference goes away.
 
bool isDerivedShellInstance (PyObject *object)
 Returns if the C++ object is an instance of a Python class that derives a C++ class.
 
bool hasExtraShellRefCount (PyObject *object)
 Returns if the shell instance has an extra ref count from the C++ side.
 
bool passOwnershipToCPP (PyObject *object)
 Pass the ownership of the given object to CPP (so that it will not be deleted by Python if the reference goes away)
 
bool passOwnershipToPython (PyObject *object)
 Pass the ownership of the given object to Python (so that the C++ object will be deleted when the Python reference goes away)
 
bool isPythonQtInstanceWrapper (PyObject *object)
 Returns if the given object is a PythonQt instance wrapper (or derived class)
 
bool isPythonQtClassWrapper (PyObject *object)
 Returns if the given object is a PythonQt class wrapper (or derived class)
 
+ + + +

+Public Member Functions

 PythonQtDebugAPI (QObject *parent)
 
+

Detailed Description

+

Some helper methods that allow testing of the ownership.

+ +

Definition at line 239 of file PythonQtStdDecorators.h.

+

Constructor & Destructor Documentation

+ +

◆ PythonQtDebugAPI()

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtDebugAPI::PythonQtDebugAPI (QObject * parent)
+
+inline
+
+ +

Definition at line 243 of file PythonQtStdDecorators.h.

+
244 : QObject(parent) {};
+
+
+
+

Member Function Documentation

+ +

◆ hasExtraShellRefCount

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtDebugAPI::hasExtraShellRefCount (PyObjectobject)
+
+slot
+
+ +

Returns if the shell instance has an extra ref count from the C++ side.

+ +
+
+ +

◆ isDerivedShellInstance

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtDebugAPI::isDerivedShellInstance (PyObjectobject)
+
+slot
+
+ +

Returns if the C++ object is an instance of a Python class that derives a C++ class.

+ +
+
+ +

◆ isOwnedByPython

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtDebugAPI::isOwnedByPython (PyObjectobject)
+
+slot
+
+ +

Returns if the C++ object is owned by PythonQt and will be deleted when the reference goes away.

+ +
+
+ +

◆ isPythonQtClassWrapper

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtDebugAPI::isPythonQtClassWrapper (PyObjectobject)
+
+slot
+
+ +

Returns if the given object is a PythonQt class wrapper (or derived class)

+ +
+
+ +

◆ isPythonQtInstanceWrapper

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtDebugAPI::isPythonQtInstanceWrapper (PyObjectobject)
+
+slot
+
+ +

Returns if the given object is a PythonQt instance wrapper (or derived class)

+ +
+
+ +

◆ passOwnershipToCPP

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtDebugAPI::passOwnershipToCPP (PyObjectobject)
+
+slot
+
+ +

Pass the ownership of the given object to CPP (so that it will not be deleted by Python if the reference goes away)

+ +
+
+ +

◆ passOwnershipToPython

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtDebugAPI::passOwnershipToPython (PyObjectobject)
+
+slot
+
+ +

Pass the ownership of the given object to Python (so that the C++ object will be deleted when the Python reference goes away)

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtDebugAPI.png b/classPythonQtDebugAPI.png new file mode 100644 index 000000000..e47550578 Binary files /dev/null and b/classPythonQtDebugAPI.png differ diff --git a/classPythonQtForeignWrapperFactory-members.html b/classPythonQtForeignWrapperFactory-members.html new file mode 100644 index 000000000..5f6b10f01 --- /dev/null +++ b/classPythonQtForeignWrapperFactory-members.html @@ -0,0 +1,58 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtForeignWrapperFactory Member List
+
+
+ +

This is the complete list of members for PythonQtForeignWrapperFactory, including all inherited members.

+ + + + + +
PythonQtForeignWrapperFactory()PythonQtForeignWrapperFactoryinline
unwrap(const QByteArray &classname, PyObject *object)=0PythonQtForeignWrapperFactorypure virtual
wrap(const QByteArray &classname, void *ptr)=0PythonQtForeignWrapperFactorypure virtual
~PythonQtForeignWrapperFactory()PythonQtForeignWrapperFactoryinlinevirtual
+ + + + diff --git a/classPythonQtForeignWrapperFactory.html b/classPythonQtForeignWrapperFactory.html new file mode 100644 index 000000000..a2101dc55 --- /dev/null +++ b/classPythonQtForeignWrapperFactory.html @@ -0,0 +1,207 @@ + + + + + + + +PythonQt: PythonQtForeignWrapperFactory Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtForeignWrapperFactory Class Referenceabstract
+
+
+ +

#include <PythonQtCppWrapperFactory.h>

+ + + + + + + + + + +

+Public Member Functions

 PythonQtForeignWrapperFactory ()
 
virtual ~PythonQtForeignWrapperFactory ()
 
virtual PyObjectwrap (const QByteArray &classname, void *ptr)=0
 
virtual voidunwrap (const QByteArray &classname, PyObject *object)=0
 
+

Detailed Description

+

Factory interface for C++ classes that can be mapped directly from/to Python with other means than PythonQt/QObjects.

+ +

Definition at line 69 of file PythonQtCppWrapperFactory.h.

+

Constructor & Destructor Documentation

+ +

◆ PythonQtForeignWrapperFactory()

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtForeignWrapperFactory::PythonQtForeignWrapperFactory ()
+
+inline
+
+ +

Definition at line 73 of file PythonQtCppWrapperFactory.h.

+
73{}
+
+
+
+ +

◆ ~PythonQtForeignWrapperFactory()

+ +
+
+ + + + + +
+ + + + + + + +
virtual PythonQtForeignWrapperFactory::~PythonQtForeignWrapperFactory ()
+
+inlinevirtual
+
+ +

Definition at line 74 of file PythonQtCppWrapperFactory.h.

+
74{}
+
+
+
+

Member Function Documentation

+ +

◆ unwrap()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual void * PythonQtForeignWrapperFactory::unwrap (const QByteArrayclassname,
PyObjectobject 
)
+
+pure virtual
+
+

unwrap the given object to a C++ object of type classname if possible Return NULL otherwise.

+ +
+
+ +

◆ wrap()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual PyObject * PythonQtForeignWrapperFactory::wrap (const QByteArrayclassname,
voidptr 
)
+
+pure virtual
+
+

create a Python object (with new reference count), wrapping the given ptr as class of type classname Return NULL (and not Py_None) if the object could not be wrapped.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtGILScope-members.html b/classPythonQtGILScope-members.html new file mode 100644 index 000000000..5983351b9 --- /dev/null +++ b/classPythonQtGILScope-members.html @@ -0,0 +1,59 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtGILScope Member List
+
+
+ +

This is the complete list of members for PythonQtGILScope, including all inherited members.

+ + + + + + +
isGILScopeEnabled()PythonQtGILScopestatic
PythonQtGILScope()PythonQtGILScope
release()PythonQtGILScope
setGILScopeEnabled(bool flag)PythonQtGILScopestatic
~PythonQtGILScope()PythonQtGILScope
+ + + + diff --git a/classPythonQtGILScope.html b/classPythonQtGILScope.html new file mode 100644 index 000000000..a281c083a --- /dev/null +++ b/classPythonQtGILScope.html @@ -0,0 +1,189 @@ + + + + + + + +PythonQt: PythonQtGILScope Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtGILScope Class Reference
+
+
+ +

#include <PythonQtThreadSupport.h>

+ + + + + + + + +

+Public Member Functions

 PythonQtGILScope ()
 
 ~PythonQtGILScope ()
 
void release ()
 
+ + + + + + +

+Static Public Member Functions

static void setGILScopeEnabled (bool flag)
 
static bool isGILScopeEnabled ()
 Check if GIL scopes are enabled.
 
+

Detailed Description

+

Ensures/releases the Python GIL An instance of this class can be used to allow access to the Python API from C++ code.

+ +

Definition at line 60 of file PythonQtThreadSupport.h.

+

Constructor & Destructor Documentation

+ +

◆ PythonQtGILScope()

+ +
+
+ + + + + + + +
PythonQtGILScope::PythonQtGILScope ()
+
+ +
+
+ +

◆ ~PythonQtGILScope()

+ +
+
+ + + + + + + +
PythonQtGILScope::~PythonQtGILScope ()
+
+ +
+
+

Member Function Documentation

+ +

◆ isGILScopeEnabled()

+ +
+
+ + + + + +
+ + + + + + + +
static bool PythonQtGILScope::isGILScopeEnabled ()
+
+static
+
+ +

Check if GIL scopes are enabled.

+ +
+
+ +

◆ release()

+ +
+
+ + + + + + + +
void PythonQtGILScope::release ()
+
+ +
+
+ +

◆ setGILScopeEnabled()

+ +
+
+ + + + + +
+ + + + + + + + +
static void PythonQtGILScope::setGILScopeEnabled (bool flag)
+
+static
+
+

This allows to globally enable/disable the GIL scopes. Make sure to only call this early in the PythonQt setup, or when you are holding the GIL.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtImport-members.html b/classPythonQtImport-members.html new file mode 100644 index 000000000..d23d3bb08 --- /dev/null +++ b/classPythonQtImport-members.html @@ -0,0 +1,73 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtImport Member List
+
+
+ +

This is the complete list of members for PythonQtImport, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + +
compileSource(const QString &path, const QByteArray &data)PythonQtImportstatic
getCacheFilename(const QString &sourceFile, bool isOptimizedFilename)PythonQtImportstatic
getCodeFromData(const QString &path, int isbytecode=0, int ispackage=0, time_t mtime=0)PythonQtImportstatic
getCodeFromPyc(const QString &file)PythonQtImportstatic
getLong(unsigned char *buf)PythonQtImportstatic
getModuleCode(PythonQtImporter *self, const char *fullname, QString &modpath, QString &cachemodpath)PythonQtImportstatic
getModuleInfo(PythonQtImporter *self, const QString &fullname)PythonQtImportstatic
getMTimeOfSource(const QString &path)PythonQtImportstatic
getSourceFilename(const QString &cacheFile)PythonQtImportstatic
getSubName(const QString &str)PythonQtImportstatic
init()PythonQtImportstatic
MI_MODULE enum valuePythonQtImport
MI_NOT_FOUND enum valuePythonQtImport
MI_PACKAGE enum valuePythonQtImport
MI_SHAREDLIBRARY enum valuePythonQtImport
ModuleType enum namePythonQtImport
replaceExtension(const QString &str, const QString &ext)PythonQtImportstatic
unmarshalCode(const QString &path, const QByteArray &data, time_t mtime)PythonQtImportstatic
writeCompiledModule(PyCodeObject *co, const QString &filename, long mtime, long sourceSize)PythonQtImportstatic
+ + + + diff --git a/classPythonQtImport.html b/classPythonQtImport.html new file mode 100644 index 000000000..0ba2d030a --- /dev/null +++ b/classPythonQtImport.html @@ -0,0 +1,661 @@ + + + + + + + +PythonQt: PythonQtImport Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtImport Class Reference
+
+
+ +

implements importing of python files into PythonQt + More...

+ +

#include <PythonQtImporter.h>

+ + + + +

+Classes

struct  ModuleInfo
 
+ + + +

+Public Types

enum  ModuleType { MI_NOT_FOUND +, MI_MODULE +, MI_PACKAGE +, MI_SHAREDLIBRARY + }
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Static Public Member Functions

static void init ()
 initialize
 
static void writeCompiledModule (PyCodeObject *co, const QString &filename, long mtime, long sourceSize)
 writes the python code to disk, marshalling and writing the time stamp
 
static PyObjectunmarshalCode (const QString &path, const QByteArray &data, time_t mtime)
 
static PyObjectcompileSource (const QString &path, const QByteArray &data)
 
static PyObjectgetCodeFromData (const QString &path, int isbytecode=0, int ispackage=0, time_t mtime=0)
 
static PyObjectgetModuleCode (PythonQtImporter *self, const char *fullname, QString &modpath, QString &cachemodpath)
 
static PyObjectgetCodeFromPyc (const QString &file)
 gets the compiled code for the given *.py file if there is a valid pyc file, otherwise compiles the file and writes the pyc
 
static ModuleInfo getModuleInfo (PythonQtImporter *self, const QString &fullname)
 Return if module exists and is a package or a module.
 
static QString getSubName (const QString &str)
 get the last name of a dot chain (first.second.last)
 
static long getLong (unsigned char *buf)
 
static time_t getMTimeOfSource (const QString &path)
 get time stamp of file
 
static QString replaceExtension (const QString &str, const QString &ext)
 replace extension of file
 
static QString getCacheFilename (const QString &sourceFile, bool isOptimizedFilename)
 Returns the filename of the cache file for the given source file, e.g. test.pyc for test.py.
 
static QString getSourceFilename (const QString &cacheFile)
 Returns the filename of the source file for the given cache file, e.g. test.py for test.pyc.
 
+

Detailed Description

+

implements importing of python files into PythonQt

+

also compiles/marshalls/unmarshalls py/pyc files and handles time stamps correctly

+ +

Definition at line 65 of file PythonQtImporter.h.

+

Member Enumeration Documentation

+ +

◆ ModuleType

+ +
+
+ + + + + +
Enumerator
MI_NOT_FOUND 
MI_MODULE 
MI_PACKAGE 
MI_SHAREDLIBRARY 
+ +

Definition at line 69 of file PythonQtImporter.h.

+ +
+
+

Member Function Documentation

+ +

◆ compileSource()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtImport::compileSource (const QStringpath,
const QByteArraydata 
)
+
+static
+
+

Given a string buffer containing Python source code, compile it return and return a code object as a new reference.

+ +
+
+ +

◆ getCacheFilename()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static QString PythonQtImport::getCacheFilename (const QStringsourceFile,
bool isOptimizedFilename 
)
+
+static
+
+ +

Returns the filename of the cache file for the given source file, e.g. test.pyc for test.py.

+ +
+
+ +

◆ getCodeFromData()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtImport::getCodeFromData (const QStringpath,
int isbytecode = 0,
int ispackage = 0,
time_t mtime = 0 
)
+
+static
+
+

Return the code object for the module named by 'fullname' from the Zip archive as a new reference.

+ +
+
+ +

◆ getCodeFromPyc()

+ +
+
+ + + + + +
+ + + + + + + + +
static PyObject * PythonQtImport::getCodeFromPyc (const QStringfile)
+
+static
+
+ +

gets the compiled code for the given *.py file if there is a valid pyc file, otherwise compiles the file and writes the pyc

+ +
+
+ +

◆ getLong()

+ +
+
+ + + + + +
+ + + + + + + + +
static long PythonQtImport::getLong (unsigned charbuf)
+
+static
+
+

Given a buffer, return the long that is represented by the first 4 bytes, encoded as little endian. This partially reimplements marshal.c:r_long()

+ +
+
+ +

◆ getModuleCode()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtImport::getModuleCode (PythonQtImporterself,
const charfullname,
QStringmodpath,
QStringcachemodpath 
)
+
+static
+
+

Get the code object associated with the module specified by 'fullname'. In Python3, modpath will always be the path to the *.py file and cachemodpath the path to the *.pyc file (if it exists).

+ +
+
+ +

◆ getModuleInfo()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static ModuleInfo PythonQtImport::getModuleInfo (PythonQtImporterself,
const QStringfullname 
)
+
+static
+
+ +

Return if module exists and is a package or a module.

+ +
+
+ +

◆ getMTimeOfSource()

+ +
+
+ + + + + +
+ + + + + + + + +
static time_t PythonQtImport::getMTimeOfSource (const QStringpath)
+
+static
+
+ +

get time stamp of file

+ +
+
+ +

◆ getSourceFilename()

+ +
+
+ + + + + +
+ + + + + + + + +
static QString PythonQtImport::getSourceFilename (const QStringcacheFile)
+
+static
+
+ +

Returns the filename of the source file for the given cache file, e.g. test.py for test.pyc.

+ +
+
+ +

◆ getSubName()

+ +
+
+ + + + + +
+ + + + + + + + +
static QString PythonQtImport::getSubName (const QStringstr)
+
+static
+
+ +

get the last name of a dot chain (first.second.last)

+ +
+
+ +

◆ init()

+ +
+
+ + + + + +
+ + + + + + + +
static void PythonQtImport::init ()
+
+static
+
+ +

initialize

+ +
+
+ +

◆ replaceExtension()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static QString PythonQtImport::replaceExtension (const QStringstr,
const QStringext 
)
+
+static
+
+ +

replace extension of file

+ +
+
+ +

◆ unmarshalCode()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtImport::unmarshalCode (const QStringpath,
const QByteArraydata,
time_t mtime 
)
+
+static
+
+

Given the contents of a .py[co] file in a buffer, unmarshal the data and return the code object. Return None if it the magic word doesn't match (we do this instead of raising an exception as we fall back to .py if available and we don't want to mask other errors). Returns a new reference.

+ +
+
+ +

◆ writeCompiledModule()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static void PythonQtImport::writeCompiledModule (PyCodeObjectco,
const QStringfilename,
long mtime,
long sourceSize 
)
+
+static
+
+ +

writes the python code to disk, marshalling and writing the time stamp

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtImportFileInterface-members.html b/classPythonQtImportFileInterface-members.html new file mode 100644 index 000000000..bb232806b --- /dev/null +++ b/classPythonQtImportFileInterface-members.html @@ -0,0 +1,63 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtImportFileInterface Member List
+
+
+ +

This is the complete list of members for PythonQtImportFileInterface, including all inherited members.

+ + + + + + + + + + +
exists(const QString &filename)=0PythonQtImportFileInterfacepure virtual
ignoreUpdatedPythonSourceFiles()PythonQtImportFileInterfaceinlinevirtual
importedModule(const QString &)PythonQtImportFileInterfaceinlinevirtual
isEggArchive(const QString &filename)=0PythonQtImportFileInterfacepure virtual
lastModifiedDate(const QString &filename)=0PythonQtImportFileInterfacepure virtual
PythonQtImportFileInterface()PythonQtImportFileInterfaceinline
readFileAsBytes(const QString &filename)=0PythonQtImportFileInterfacepure virtual
readSourceFile(const QString &filename, bool &ok)=0PythonQtImportFileInterfacepure virtual
~PythonQtImportFileInterface()PythonQtImportFileInterfaceinlinevirtual
+ + + + diff --git a/classPythonQtImportFileInterface.html b/classPythonQtImportFileInterface.html new file mode 100644 index 000000000..9cbdb314d --- /dev/null +++ b/classPythonQtImportFileInterface.html @@ -0,0 +1,372 @@ + + + + + + + +PythonQt: PythonQtImportFileInterface Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtImportFileInterface Class Referenceabstract
+
+
+ +

#include <PythonQtImportFileInterface.h>

+
+Inheritance diagram for PythonQtImportFileInterface:
+
+
+ + +PythonQtQFileImporter + +
+ + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

virtual ~PythonQtImportFileInterface ()
 
 PythonQtImportFileInterface ()
 
virtual QByteArray readFileAsBytes (const QString &filename)=0
 read the given file as byte array, without doing any linefeed translations
 
virtual QByteArray readSourceFile (const QString &filename, bool &ok)=0
 
virtual bool exists (const QString &filename)=0
 returns if the file exists
 
virtual bool isEggArchive (const QString &filename)=0
 
virtual QDateTime lastModifiedDate (const QString &filename)=0
 get the last modified data of a file
 
virtual bool ignoreUpdatedPythonSourceFiles ()
 
virtual void importedModule (const QString &)
 
+

Detailed Description

+

Defines an abstract interface to file access for the Python import statement. see PythonQt::setImporter()

+ +

Definition at line 52 of file PythonQtImportFileInterface.h.

+

Constructor & Destructor Documentation

+ +

◆ ~PythonQtImportFileInterface()

+ +
+
+ + + + + +
+ + + + + + + +
virtual PythonQtImportFileInterface::~PythonQtImportFileInterface ()
+
+inlinevirtual
+
+ +

Definition at line 57 of file PythonQtImportFileInterface.h.

+
57{}
+
+
+
+ +

◆ PythonQtImportFileInterface()

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtImportFileInterface::PythonQtImportFileInterface ()
+
+inline
+
+ +

Definition at line 58 of file PythonQtImportFileInterface.h.

+
58{}
+
+
+
+

Member Function Documentation

+ +

◆ exists()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual bool PythonQtImportFileInterface::exists (const QStringfilename)
+
+pure virtual
+
+ +

returns if the file exists

+ +

Implemented in PythonQtQFileImporter.

+ +
+
+ +

◆ ignoreUpdatedPythonSourceFiles()

+ +
+
+ + + + + +
+ + + + + + + +
virtual bool PythonQtImportFileInterface::ignoreUpdatedPythonSourceFiles ()
+
+inlinevirtual
+
+

indicates that *.py files which are newer than their corresponding *.pyc files are ignored

+ +

Definition at line 79 of file PythonQtImportFileInterface.h.

+
79{ return false; }
+
+
+
+ +

◆ importedModule()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual void PythonQtImportFileInterface::importedModule (const QString)
+
+inlinevirtual
+
+

called by PythonQt after successful import to allow recording of imports

+ +

Definition at line 83 of file PythonQtImportFileInterface.h.

+
83{}
+
+
+
+ +

◆ isEggArchive()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual bool PythonQtImportFileInterface::isEggArchive (const QStringfilename)
+
+pure virtual
+
+

returns true if the given file is an egg archive (e.g. zip). If the egg is a directory then false is returned.

+ +

Implemented in PythonQtQFileImporter.

+ +
+
+ +

◆ lastModifiedDate()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual QDateTime PythonQtImportFileInterface::lastModifiedDate (const QStringfilename)
+
+pure virtual
+
+ +

get the last modified data of a file

+ +

Implemented in PythonQtQFileImporter.

+ +
+
+ +

◆ readFileAsBytes()

+ +
+
+ + + + + +
+ + + + + + + + +
virtual QByteArray PythonQtImportFileInterface::readFileAsBytes (const QStringfilename)
+
+pure virtual
+
+ +

read the given file as byte array, without doing any linefeed translations

+ +

Implemented in PythonQtQFileImporter.

+ +
+
+ +

◆ readSourceFile()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
virtual QByteArray PythonQtImportFileInterface::readSourceFile (const QStringfilename,
boolok 
)
+
+pure virtual
+
+

read a source file, expects a readable Python text file with translated line feeds. If the file can not be load OR it can not be verified, ok is set to false

+ +

Implemented in PythonQtQFileImporter.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtImportFileInterface.png b/classPythonQtImportFileInterface.png new file mode 100644 index 000000000..4b01255ff Binary files /dev/null and b/classPythonQtImportFileInterface.png differ diff --git a/classPythonQtMethodInfo-members.html b/classPythonQtMethodInfo-members.html new file mode 100644 index 000000000..52fb768ad --- /dev/null +++ b/classPythonQtMethodInfo-members.html @@ -0,0 +1,82 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtMethodInfo Member List
+
+
+ +

This is the complete list of members for PythonQtMethodInfo, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
_cachedParameterInfosPythonQtMethodInfoprotectedstatic
_cachedSignaturesPythonQtMethodInfoprotectedstatic
_parameterNameAliasesPythonQtMethodInfoprotectedstatic
_parametersPythonQtMethodInfoprotected
_parameterTypeDictPythonQtMethodInfoprotectedstatic
_shouldAllowThreadsPythonQtMethodInfoprotected
addParameterTypeAlias(const QByteArray &alias, const QByteArray &name)PythonQtMethodInfostatic
cleanupCachedMethodInfos()PythonQtMethodInfostatic
fillParameterInfo(ParameterInfo &type, const QByteArray &name, PythonQtClassInfo *classInfo=nullptr)PythonQtMethodInfostatic
getCachedMethodInfo(const QMetaMethod &method, PythonQtClassInfo *classInfo)PythonQtMethodInfostatic
getCachedMethodInfoFromArgumentList(int numArgs, const char **args)PythonQtMethodInfostatic
getInnerListTypeName(const QByteArray &typeName)PythonQtMethodInfostatic
getInnerTemplateMetaType(const QByteArray &typeName)PythonQtMethodInfostatic
getInnerTemplateTypeName(const QByteArray &typeName)PythonQtMethodInfostatic
getParameterInfoForMetaType(int type)PythonQtMethodInfostatic
nameToType(const char *name)PythonQtMethodInfostatic
parameterCount() constPythonQtMethodInfoinline
parameters() constPythonQtMethodInfoinline
ParameterType enum namePythonQtMethodInfo
PythonQtMethodInfo()PythonQtMethodInfoinline
PythonQtMethodInfo(const QMetaMethod &meta, PythonQtClassInfo *classInfo)PythonQtMethodInfo
PythonQtMethodInfo(const QByteArray &typeName, const QList< QByteArray > &args)PythonQtMethodInfo
PythonQtMethodInfo(const PythonQtMethodInfo &other)PythonQtMethodInfoinline
setupAllowThreads()PythonQtMethodInfoprotected
shouldAllowThreads() constPythonQtMethodInfoinline
Unknown enum valuePythonQtMethodInfo
Variant enum valuePythonQtMethodInfo
~PythonQtMethodInfo()PythonQtMethodInfoinline
+ + + + diff --git a/classPythonQtMethodInfo.html b/classPythonQtMethodInfo.html new file mode 100644 index 000000000..a1f448f8d --- /dev/null +++ b/classPythonQtMethodInfo.html @@ -0,0 +1,940 @@ + + + + + + + +PythonQt: PythonQtMethodInfo Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+ +
+ +

stores information about a specific signal/slot/method + More...

+ +

#include <PythonQtMethodInfo.h>

+
+Inheritance diagram for PythonQtMethodInfo:
+
+
+ + +PythonQtSlotInfo + +
+ + + + + +

+Classes

struct  ParameterInfo
 stores various informations about a parameter/type name More...
 
+ + + +

+Public Types

enum  ParameterType { Unknown = -1 +, Variant = -2 + }
 
+ + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 PythonQtMethodInfo ()
 
 ~PythonQtMethodInfo ()
 
 PythonQtMethodInfo (const QMetaMethod &meta, PythonQtClassInfo *classInfo)
 
 PythonQtMethodInfo (const QByteArray &typeName, const QList< QByteArray > &args)
 
 PythonQtMethodInfo (const PythonQtMethodInfo &other)
 
int parameterCount () const
 returns the number of parameters including the return value
 
const QList< ParameterInfo > & parameters () const
 get the parameter infos
 
bool shouldAllowThreads () const
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Static Public Member Functions

static const PythonQtMethodInfogetCachedMethodInfo (const QMetaMethod &method, PythonQtClassInfo *classInfo)
 
static const PythonQtMethodInfogetCachedMethodInfoFromArgumentList (int numArgs, const char **args)
 get the cached method info using the passed in list of return value and arguments, return value needs to be passed as first arg
 
static void cleanupCachedMethodInfos ()
 cleanup the cache
 
static int nameToType (const char *name)
 returns the id for the given type (using an internal dictionary)
 
static void addParameterTypeAlias (const QByteArray &alias, const QByteArray &name)
 add an alias for a typename, e.g. QObjectList and QList<QObject*>.
 
static void fillParameterInfo (ParameterInfo &type, const QByteArray &name, PythonQtClassInfo *classInfo=nullptr)
 fill the parameter info for the given type name
 
static const ParameterInfogetParameterInfoForMetaType (int type)
 returns a parameter info for the given metatype (and creates and caches one if it is not yet present)
 
static int getInnerTemplateMetaType (const QByteArray &typeName)
 returns the inner type id of a simple template of the form SomeObject<InnerType>
 
static QByteArray getInnerTemplateTypeName (const QByteArray &typeName)
 returns the inner type name of a simple template of the form SomeObject<InnerType>
 
static QByteArray getInnerListTypeName (const QByteArray &typeName)
 returns the inner type name of a simple template or the typename without appended "List".
 
+ + + +

+Protected Member Functions

void setupAllowThreads ()
 
+ + + + + +

+Protected Attributes

QList< ParameterInfo_parameters
 
bool _shouldAllowThreads
 
+ + + + + + + + + + +

+Static Protected Attributes

static QHash< QByteArray, int_parameterTypeDict
 
static QHash< QByteArray, QByteArray_parameterNameAliases
 
static QHash< QByteArray, PythonQtMethodInfo * > _cachedSignatures
 stores the cached signatures of methods to speedup mapping from Qt to Python types
 
static QHash< int, ParameterInfo_cachedParameterInfos
 
+

Detailed Description

+

stores information about a specific signal/slot/method

+ +

Definition at line 58 of file PythonQtMethodInfo.h.

+

Member Enumeration Documentation

+ +

◆ ParameterType

+ +
+
+ + + +
Enumerator
Unknown 
Variant 
+ +

Definition at line 61 of file PythonQtMethodInfo.h.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ PythonQtMethodInfo() [1/4]

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtMethodInfo::PythonQtMethodInfo ()
+
+inline
+
+ +

Definition at line 79 of file PythonQtMethodInfo.h.

+
79{ _shouldAllowThreads = true; };
+ +
+
+
+ +

◆ ~PythonQtMethodInfo()

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtMethodInfo::~PythonQtMethodInfo ()
+
+inline
+
+ +

Definition at line 80 of file PythonQtMethodInfo.h.

+
80{};
+
+
+
+ +

◆ PythonQtMethodInfo() [2/4]

+ +
+
+ + + + + + + + + + + + + + + + + + +
PythonQtMethodInfo::PythonQtMethodInfo (const QMetaMethodmeta,
PythonQtClassInfoclassInfo 
)
+
+ +
+
+ +

◆ PythonQtMethodInfo() [3/4]

+ +
+
+ + + + + + + + + + + + + + + + + + +
PythonQtMethodInfo::PythonQtMethodInfo (const QByteArraytypeName,
const QList< QByteArray > & args 
)
+
+ +
+
+ +

◆ PythonQtMethodInfo() [4/4]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtMethodInfo::PythonQtMethodInfo (const PythonQtMethodInfoother)
+
+inline
+
+ +

Definition at line 83 of file PythonQtMethodInfo.h.

+
84 {
+
85 _parameters = other._parameters;
+
86 _shouldAllowThreads = other._shouldAllowThreads;
+
87 }
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
QList< ParameterInfo > _parameters
+
+

References PythonQtConvertPairToPython().

+ +
+
+

Member Function Documentation

+ +

◆ addParameterTypeAlias()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static void PythonQtMethodInfo::addParameterTypeAlias (const QByteArrayalias,
const QByteArrayname 
)
+
+static
+
+ +

add an alias for a typename, e.g. QObjectList and QList<QObject*>.

+ +
+
+ +

◆ cleanupCachedMethodInfos()

+ +
+
+ + + + + +
+ + + + + + + +
static void PythonQtMethodInfo::cleanupCachedMethodInfos ()
+
+static
+
+ +

cleanup the cache

+ +
+
+ +

◆ fillParameterInfo()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static void PythonQtMethodInfo::fillParameterInfo (ParameterInfotype,
const QByteArrayname,
PythonQtClassInfoclassInfo = nullptr 
)
+
+static
+
+ +

fill the parameter info for the given type name

+ +
+
+ +

◆ getCachedMethodInfo()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static const PythonQtMethodInfo * PythonQtMethodInfo::getCachedMethodInfo (const QMetaMethodmethod,
PythonQtClassInfoclassInfo 
)
+
+static
+
+

returns the method info of the signature, uses a cache internally to speed up multiple requests for the same method, classInfo is passed to allow local enum resolution (if NULL is passed, no local enums are recognized)

+ +
+
+ +

◆ getCachedMethodInfoFromArgumentList()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static const PythonQtMethodInfo * PythonQtMethodInfo::getCachedMethodInfoFromArgumentList (int numArgs,
const char ** args 
)
+
+static
+
+ +

get the cached method info using the passed in list of return value and arguments, return value needs to be passed as first arg

+ +
+
+ +

◆ getInnerListTypeName()

+ +
+
+ + + + + +
+ + + + + + + + +
static QByteArray PythonQtMethodInfo::getInnerListTypeName (const QByteArraytypeName)
+
+static
+
+ +

returns the inner type name of a simple template or the typename without appended "List".

+ +

Referenced by PythonQtConvertListOfKnownClassToPythonList(), and PythonQtConvertPythonListToListOfKnownClass().

+ +
+
+ +

◆ getInnerTemplateMetaType()

+ +
+
+ + + + + +
+ + + + + + + + +
static int PythonQtMethodInfo::getInnerTemplateMetaType (const QByteArraytypeName)
+
+static
+
+ +

returns the inner type id of a simple template of the form SomeObject<InnerType>

+ +

Referenced by PythonQtConvertListOfPairToPythonList(), PythonQtConvertListOfValueTypeToPythonList(), PythonQtConvertPythonListToListOfPair(), and PythonQtConvertPythonListToListOfValueType().

+ +
+
+ +

◆ getInnerTemplateTypeName()

+ +
+
+ + + + + +
+ + + + + + + + +
static QByteArray PythonQtMethodInfo::getInnerTemplateTypeName (const QByteArraytypeName)
+
+static
+
+ +

returns the inner type name of a simple template of the form SomeObject<InnerType>

+ +

Referenced by PythonQtConvertIntegerMapToPython(), PythonQtConvertPairToPython(), PythonQtConvertPythonToIntegerMap(), and PythonQtConvertPythonToPair().

+ +
+
+ +

◆ getParameterInfoForMetaType()

+ +
+
+ + + + + +
+ + + + + + + + +
static const ParameterInfo & PythonQtMethodInfo::getParameterInfoForMetaType (int type)
+
+static
+
+ +

returns a parameter info for the given metatype (and creates and caches one if it is not yet present)

+ +
+
+ +

◆ nameToType()

+ +
+
+ + + + + +
+ + + + + + + + +
static int PythonQtMethodInfo::nameToType (const charname)
+
+static
+
+ +

returns the id for the given type (using an internal dictionary)

+ +
+
+ +

◆ parameterCount()

+ +
+
+ + + + + +
+ + + + + + + +
int PythonQtMethodInfo::parameterCount () const
+
+inline
+
+ +

returns the number of parameters including the return value

+ +

Definition at line 100 of file PythonQtMethodInfo.h.

+
100{ return _parameters.size(); };
+
+
+
+ +

◆ parameters()

+ +
+
+ + + + + +
+ + + + + + + +
const QList< ParameterInfo > & PythonQtMethodInfo::parameters () const
+
+inline
+
+ +

get the parameter infos

+ +

Definition at line 106 of file PythonQtMethodInfo.h.

+
106{ return _parameters; }
+
+
+
+ +

◆ setupAllowThreads()

+ +
+
+ + + + + +
+ + + + + + + +
void PythonQtMethodInfo::setupAllowThreads ()
+
+protected
+
+ +
+
+ +

◆ shouldAllowThreads()

+ +
+
+ + + + + +
+ + + + + + + +
bool PythonQtMethodInfo::shouldAllowThreads () const
+
+inline
+
+

returns if the GIL should be released when calling this method. This is the default, but it will return false if any of the parameters is a PythonQtObjectPtr or PyObject*.

+ +

Definition at line 129 of file PythonQtMethodInfo.h.

+
129{ return _shouldAllowThreads; }
+
+
+
+

Member Data Documentation

+ +

◆ _cachedParameterInfos

+ +
+
+ + + + + +
+ + + + +
QHash<int, ParameterInfo> PythonQtMethodInfo::_cachedParameterInfos
+
+staticprotected
+
+ +

Definition at line 140 of file PythonQtMethodInfo.h.

+ +
+
+ +

◆ _cachedSignatures

+ +
+
+ + + + + +
+ + + + +
QHash<QByteArray, PythonQtMethodInfo*> PythonQtMethodInfo::_cachedSignatures
+
+staticprotected
+
+ +

stores the cached signatures of methods to speedup mapping from Qt to Python types

+ +

Definition at line 138 of file PythonQtMethodInfo.h.

+ +
+
+ +

◆ _parameterNameAliases

+ +
+
+ + + + + +
+ + + + +
QHash<QByteArray, QByteArray> PythonQtMethodInfo::_parameterNameAliases
+
+staticprotected
+
+ +

Definition at line 135 of file PythonQtMethodInfo.h.

+ +
+
+ +

◆ _parameters

+ +
+
+ + + + + +
+ + + + +
QList<ParameterInfo> PythonQtMethodInfo::_parameters
+
+protected
+
+ +

Definition at line 142 of file PythonQtMethodInfo.h.

+ +

Referenced by PythonQtSlotInfo::PythonQtSlotInfo().

+ +
+
+ +

◆ _parameterTypeDict

+ +
+
+ + + + + +
+ + + + +
QHash<QByteArray, int> PythonQtMethodInfo::_parameterTypeDict
+
+staticprotected
+
+ +

Definition at line 134 of file PythonQtMethodInfo.h.

+ +
+
+ +

◆ _shouldAllowThreads

+ +
+
+ + + + + +
+ + + + +
bool PythonQtMethodInfo::_shouldAllowThreads
+
+protected
+
+ +

Definition at line 143 of file PythonQtMethodInfo.h.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtMethodInfo.png b/classPythonQtMethodInfo.png new file mode 100644 index 000000000..9c6ee7f29 Binary files /dev/null and b/classPythonQtMethodInfo.png differ diff --git a/classPythonQtNewOwnerOfThis-members.html b/classPythonQtNewOwnerOfThis-members.html new file mode 100644 index 000000000..74f6121be --- /dev/null +++ b/classPythonQtNewOwnerOfThis-members.html @@ -0,0 +1,57 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtNewOwnerOfThis< T > Member List
+
+
+ +

This is the complete list of members for PythonQtNewOwnerOfThis< T >, including all inherited members.

+ + + + +
_tPythonQtNewOwnerOfThis< T >
operator T() constPythonQtNewOwnerOfThis< T >inline
PythonQtNewOwnerOfThis(const T &t)PythonQtNewOwnerOfThis< T >inline
+ + + + diff --git a/classPythonQtNewOwnerOfThis.html b/classPythonQtNewOwnerOfThis.html new file mode 100644 index 000000000..4335a1a33 --- /dev/null +++ b/classPythonQtNewOwnerOfThis.html @@ -0,0 +1,175 @@ + + + + + + + +PythonQt: PythonQtNewOwnerOfThis< T > Class Template Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtNewOwnerOfThis< T > Class Template Reference
+
+
+ +

#include <PythonQt.h>

+ + + + + + + + +

+Public Member Functions

 PythonQtNewOwnerOfThis (const T &t)
 Allow conversion from T to PythonQtNewOwnerOfThis<T>
 
 operator T () const
 Allow conversion from PythonQtNewOwnerOfThis<T> to T.
 
+ + + +

+Public Attributes

T _t
 
+

Detailed Description

+
template<class T>
+class PythonQtNewOwnerOfThis< T >

Helper template that allows to pass the ownership of a C++ instance between C++ and Python (it is used as a slot return type or parameter type so that it can be detected by the PythonQt slot calling code).

+ +

Definition at line 130 of file PythonQt.h.

+

Constructor & Destructor Documentation

+ +

◆ PythonQtNewOwnerOfThis()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + + +
PythonQtNewOwnerOfThis< T >::PythonQtNewOwnerOfThis (const Tt)
+
+inline
+
+ +

Allow conversion from T to PythonQtNewOwnerOfThis<T>

+ +

Definition at line 134 of file PythonQt.h.

+
135 : _t(t)
+
136 {
+
137 }
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+ +
+
+
+

Member Function Documentation

+ +

◆ operator T()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + +
PythonQtNewOwnerOfThis< T >::operator T () const
+
+inline
+
+ +

Allow conversion from PythonQtNewOwnerOfThis<T> to T.

+ +

Definition at line 139 of file PythonQt.h.

+
139{ return _t; }
+
+

References PythonQtNewOwnerOfThis< T >::_t.

+ +
+
+

Member Data Documentation

+ +

◆ _t

+ +
+
+
+template<class T >
+ + + + +
T PythonQtNewOwnerOfThis< T >::_t
+
+

Stored value. This is important so that it has the same memory layout as a pointer if T is a pointer type (which is the typical use case for this class).

+ +

Definition at line 143 of file PythonQt.h.

+ +

Referenced by PythonQtNewOwnerOfThis< T >::operator T().

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtObjectPtr-members.html b/classPythonQtObjectPtr-members.html new file mode 100644 index 000000000..2ee00e2e9 --- /dev/null +++ b/classPythonQtObjectPtr-members.html @@ -0,0 +1,90 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtObjectPtr Member List
+
+
+ +

This is the complete list of members for PythonQtObjectPtr, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
addObject(const QString &name, QObject *object)PythonQtObjectPtr
addVariable(const QString &name, const QVariant &v)PythonQtObjectPtr
call(const QString &callable, const QVariantList &args=QVariantList(), const QVariantMap &kwargs=QVariantMap())PythonQtObjectPtr
call(const QVariantList &args=QVariantList(), const QVariantMap &kwargs=QVariantMap())PythonQtObjectPtr
evalCode(PyObject *pycode)PythonQtObjectPtr
evalFile(const QString &filename)PythonQtObjectPtr
evalScript(const QString &script, int start=Py_file_input)PythonQtObjectPtr
fromVariant(const QVariant &variant)PythonQtObjectPtr
getVariable(const QString &name)PythonQtObjectPtr
isNull() constPythonQtObjectPtrinline
object() constPythonQtObjectPtrinline
operator PyObject *() constPythonQtObjectPtrinline
operator!=(const PythonQtObjectPtr &p) constPythonQtObjectPtrinline
operator!=(PyObject *p) constPythonQtObjectPtrinline
operator*() constPythonQtObjectPtrinline
operator->() constPythonQtObjectPtrinline
operator=(const PythonQtObjectPtr &p)PythonQtObjectPtrinline
operator=(PythonQtObjectPtr &&p) noexceptPythonQtObjectPtrinline
operator=(PythonQtSafeObjectPtr &&p)PythonQtObjectPtr
operator=(PyObject *o)PythonQtObjectPtrinline
operator=(const QVariant &variant)PythonQtObjectPtrinline
operator==(const PythonQtObjectPtr &p) constPythonQtObjectPtrinline
operator==(PyObject *p) constPythonQtObjectPtrinline
PythonQtObjectPtr()PythonQtObjectPtrinline
PythonQtObjectPtr(const PythonQtObjectPtr &p)PythonQtObjectPtrinline
PythonQtObjectPtr(PythonQtObjectPtr &&p) noexceptPythonQtObjectPtrinline
PythonQtObjectPtr(PythonQtSafeObjectPtr &&p)PythonQtObjectPtr
PythonQtObjectPtr(const QVariant &variant)PythonQtObjectPtrinline
PythonQtObjectPtr(PyObject *o)PythonQtObjectPtr
removeVariable(const QString &name)PythonQtObjectPtr
setNewRef(PyObject *o)PythonQtObjectPtr
setObject(PyObject *o)PythonQtObjectPtrprotected
takeObject()PythonQtObjectPtrinline
toLocalVariant()PythonQtObjectPtr
toVariant()PythonQtObjectPtr
~PythonQtObjectPtr()PythonQtObjectPtr
+ + + + diff --git a/classPythonQtObjectPtr.html b/classPythonQtObjectPtr.html new file mode 100644 index 000000000..6108b0ab3 --- /dev/null +++ b/classPythonQtObjectPtr.html @@ -0,0 +1,1157 @@ + + + + + + + +PythonQt: PythonQtObjectPtr Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtObjectPtr Class Reference
+
+
+ +

a smart pointer that stores a PyObject pointer and that handles reference counting automatically + More...

+ +

#include <PythonQtObjectPtr.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 PythonQtObjectPtr ()
 
 PythonQtObjectPtr (const PythonQtObjectPtr &p)
 
 PythonQtObjectPtr (PythonQtObjectPtr &&p) noexcept
 rvalue copy constructor, does not need any incref/decref.
 
 PythonQtObjectPtr (PythonQtSafeObjectPtr &&p)
 rvalue copy constructor, does not need any incref/decref.
 
 PythonQtObjectPtr (const QVariant &variant)
 If the given variant holds a PythonQtObjectPtr, extract the value from it and hold onto the reference. This results in an increment of the reference count.
 
 PythonQtObjectPtr (PyObject *o)
 
 ~PythonQtObjectPtr ()
 
bool fromVariant (const QVariant &variant)
 If the given variant holds a PythonQtObjectPtr, extract the value from it and hold onto the reference. This results in an increment of the reference count.
 
QVariant toVariant ()
 Returns a PythonQtSafeObjectPtr as a QVariant. It does not return a PythonQtObjectPtr, because that would be unsafe regarding the GIL.
 
QVariant toLocalVariant ()
 Returns a PythonQtObjectPtr as a QVariant. Only use this when you know that the variant is only used locally and not stored outside of the current GIL scope.
 
PythonQtObjectPtroperator= (const PythonQtObjectPtr &p)
 
PythonQtObjectPtroperator= (PythonQtObjectPtr &&p) noexcept
 rvalue assignment operator that steals the reference from p
 
PythonQtObjectPtroperator= (PythonQtSafeObjectPtr &&p)
 rvalue assignment operator that steals the reference from p
 
PythonQtObjectPtroperator= (PyObject *o)
 
PythonQtObjectPtroperator= (const QVariant &variant)
 
bool operator== (const PythonQtObjectPtr &p) const
 
bool operator!= (const PythonQtObjectPtr &p) const
 
bool operator== (PyObject *p) const
 
bool operator!= (PyObject *p) const
 
bool isNull () const
 
PyObjectoperator-> () const
 
PyObjectoperator* () const
 
 operator PyObject * () const
 
void setNewRef (PyObject *o)
 sets the object and passes the ownership (stealing the reference, in Python slang)
 
PyObjectobject () const
 
QVariant evalScript (const QString &script, int start=Py_file_input)
 evaluates the given script code in the context of this object and returns the result value
 
QVariant evalCode (PyObject *pycode)
 
void evalFile (const QString &filename)
 evaluates the given code in the context
 
void addObject (const QString &name, QObject *object)
 add the given object to the module as a variable with name (it can be removed via clearVariable)
 
void addVariable (const QString &name, const QVariant &v)
 add the given variable to the module
 
void removeVariable (const QString &name)
 remove the given variable
 
QVariant getVariable (const QString &name)
 get the variable with the name of the module, returns an invalid QVariant on error
 
QVariant call (const QString &callable, const QVariantList &args=QVariantList(), const QVariantMap &kwargs=QVariantMap())
 call the given python object (in the scope of the current object), returns the result converted to a QVariant
 
QVariant call (const QVariantList &args=QVariantList(), const QVariantMap &kwargs=QVariantMap())
 call the contained python object directly, returns the result converted to a QVariant
 
PyObjecttakeObject ()
 
+ + + +

+Protected Member Functions

void setObject (PyObject *o)
 
+

Detailed Description

+

a smart pointer that stores a PyObject pointer and that handles reference counting automatically

+ +

Definition at line 56 of file PythonQtObjectPtr.h.

+

Constructor & Destructor Documentation

+ +

◆ PythonQtObjectPtr() [1/6]

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtObjectPtr::PythonQtObjectPtr ()
+
+inline
+
+ +

Definition at line 59 of file PythonQtObjectPtr.h.

+
60 : _object(nullptr)
+
61 {
+
62 }
+
+
+
+ +

◆ PythonQtObjectPtr() [2/6]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtObjectPtr::PythonQtObjectPtr (const PythonQtObjectPtrp)
+
+inline
+
+ +

Definition at line 64 of file PythonQtObjectPtr.h.

+
65 : _object(nullptr)
+
66 {
+
67 setObject(p.object());
+
68 }
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
void setObject(PyObject *o)
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ PythonQtObjectPtr() [3/6]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtObjectPtr::PythonQtObjectPtr (PythonQtObjectPtr && p)
+
+inlinenoexcept
+
+ +

rvalue copy constructor, does not need any incref/decref.

+ +

Definition at line 71 of file PythonQtObjectPtr.h.

+
72 : _object(p.takeObject())
+
73 {
+
74 }
+
+
+
+ +

◆ PythonQtObjectPtr() [4/6]

+ +
+
+ + + + + + + + +
PythonQtObjectPtr::PythonQtObjectPtr (PythonQtSafeObjectPtr && p)
+
+ +

rvalue copy constructor, does not need any incref/decref.

+ +
+
+ +

◆ PythonQtObjectPtr() [5/6]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtObjectPtr::PythonQtObjectPtr (const QVariantvariant)
+
+inline
+
+ +

If the given variant holds a PythonQtObjectPtr, extract the value from it and hold onto the reference. This results in an increment of the reference count.

+ +

Definition at line 80 of file PythonQtObjectPtr.h.

+
81 : _object(nullptr)
+
82 {
+ +
84 }
+
bool fromVariant(const QVariant &variant)
If the given variant holds a PythonQtObjectPtr, extract the value from it and hold onto the reference...
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ PythonQtObjectPtr() [6/6]

+ +
+
+ + + + + + + + +
PythonQtObjectPtr::PythonQtObjectPtr (PyObjecto)
+
+ +
+
+ +

◆ ~PythonQtObjectPtr()

+ +
+
+ + + + + + + +
PythonQtObjectPtr::~PythonQtObjectPtr ()
+
+ +
+
+

Member Function Documentation

+ +

◆ addObject()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void PythonQtObjectPtr::addObject (const QStringname,
QObject * object 
)
+
+ +

add the given object to the module as a variable with name (it can be removed via clearVariable)

+ +
+
+ +

◆ addVariable()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void PythonQtObjectPtr::addVariable (const QStringname,
const QVariantv 
)
+
+ +

add the given variable to the module

+ +
+
+ +

◆ call() [1/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
QVariant PythonQtObjectPtr::call (const QStringcallable,
const QVariantListargs = QVariantList(),
const QVariantMapkwargs = QVariantMap() 
)
+
+ +

call the given python object (in the scope of the current object), returns the result converted to a QVariant

+ +
+
+ +

◆ call() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + + + +
QVariant PythonQtObjectPtr::call (const QVariantListargs = QVariantList(),
const QVariantMapkwargs = QVariantMap() 
)
+
+ +

call the contained python object directly, returns the result converted to a QVariant

+ +
+
+ +

◆ evalCode()

+ +
+
+ + + + + + + + +
QVariant PythonQtObjectPtr::evalCode (PyObjectpycode)
+
+

evaluates the given code and returns the result value (use Py_Compile etc. to create pycode from string) If pycode is NULL, a python error is printed.

+ +
+
+ +

◆ evalFile()

+ +
+
+ + + + + + + + +
void PythonQtObjectPtr::evalFile (const QStringfilename)
+
+ +

evaluates the given code in the context

+ +
+
+ +

◆ evalScript()

+ +
+
+ + + + + + + + + + + + + + + + + + +
QVariant PythonQtObjectPtr::evalScript (const QStringscript,
int start = Py_file_input 
)
+
+ +

evaluates the given script code in the context of this object and returns the result value

+ +
+
+ +

◆ fromVariant()

+ +
+
+ + + + + + + + +
bool PythonQtObjectPtr::fromVariant (const QVariantvariant)
+
+ +

If the given variant holds a PythonQtObjectPtr, extract the value from it and hold onto the reference. This results in an increment of the reference count.

+ +
+
+ +

◆ getVariable()

+ +
+
+ + + + + + + + +
QVariant PythonQtObjectPtr::getVariable (const QStringname)
+
+ +

get the variable with the name of the module, returns an invalid QVariant on error

+ +
+
+ +

◆ isNull()

+ +
+
+ + + + + +
+ + + + + + + +
bool PythonQtObjectPtr::isNull () const
+
+inline
+
+ +

Definition at line 138 of file PythonQtObjectPtr.h.

+
138{ return !object(); }
+
PyObject * object() const
+
+
+
+ +

◆ object()

+ +
+
+ + + + + +
+ + + + + + + +
PyObject * PythonQtObjectPtr::object () const
+
+inline
+
+ +

Definition at line 149 of file PythonQtObjectPtr.h.

+
149{ return _object; }
+
+
+
+ +

◆ operator PyObject *()

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtObjectPtr::operator PyObject * () const
+
+inline
+
+ +

Definition at line 144 of file PythonQtObjectPtr.h.

+
144{ return object(); }
+
+
+
+ +

◆ operator!=() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtObjectPtr::operator!= (const PythonQtObjectPtrp) const
+
+inline
+
+ +

Definition at line 132 of file PythonQtObjectPtr.h.

+
132{ return !(*this == p); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ operator!=() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtObjectPtr::operator!= (PyObjectp) const
+
+inline
+
+ +

Definition at line 136 of file PythonQtObjectPtr.h.

+
136{ return object() != p; }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ operator*()

+ +
+
+ + + + + +
+ + + + + + + +
PyObject & PythonQtObjectPtr::operator* () const
+
+inline
+
+ +

Definition at line 142 of file PythonQtObjectPtr.h.

+
142{ return *(object()); }
+
+
+
+ +

◆ operator->()

+ +
+
+ + + + + +
+ + + + + + + +
PyObject * PythonQtObjectPtr::operator-> () const
+
+inline
+
+ +

Definition at line 140 of file PythonQtObjectPtr.h.

+
140{ return object(); }
+
+
+
+ +

◆ operator=() [1/5]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtObjectPtr & PythonQtObjectPtr::operator= (const PythonQtObjectPtrp)
+
+inline
+
+ +

Definition at line 99 of file PythonQtObjectPtr.h.

+
100 {
+
101 setObject(p.object());
+
102 return *this;
+
103 }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ operator=() [2/5]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtObjectPtr & PythonQtObjectPtr::operator= (const QVariantvariant)
+
+inline
+
+ +

Definition at line 124 of file PythonQtObjectPtr.h.

+
125 {
+ +
127 return *this;
+
128 }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ operator=() [3/5]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtObjectPtr & PythonQtObjectPtr::operator= (PyObjecto)
+
+inline
+
+ +

Definition at line 118 of file PythonQtObjectPtr.h.

+
119 {
+
120 setObject(o);
+
121 return *this;
+
122 }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ operator=() [4/5]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtObjectPtr & PythonQtObjectPtr::operator= (PythonQtObjectPtr && p)
+
+inlinenoexcept
+
+ +

rvalue assignment operator that steals the reference from p

+ +

Definition at line 106 of file PythonQtObjectPtr.h.

+
107 {
+
108 if (_object) {
+
109 setObject(nullptr);
+
110 }
+
111 _object = p.takeObject();
+
112 return *this;
+
113 }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ operator=() [5/5]

+ +
+
+ + + + + + + + +
PythonQtObjectPtr & PythonQtObjectPtr::operator= (PythonQtSafeObjectPtr && p)
+
+ +

rvalue assignment operator that steals the reference from p

+ +
+
+ +

◆ operator==() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtObjectPtr::operator== (const PythonQtObjectPtrp) const
+
+inline
+
+ +

Definition at line 130 of file PythonQtObjectPtr.h.

+
130{ return object() == p.object(); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ operator==() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtObjectPtr::operator== (PyObjectp) const
+
+inline
+
+ +

Definition at line 134 of file PythonQtObjectPtr.h.

+
134{ return object() == p; }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ removeVariable()

+ +
+
+ + + + + + + + +
void PythonQtObjectPtr::removeVariable (const QStringname)
+
+ +

remove the given variable

+ +
+
+ +

◆ setNewRef()

+ +
+
+ + + + + + + + +
void PythonQtObjectPtr::setNewRef (PyObjecto)
+
+ +

sets the object and passes the ownership (stealing the reference, in Python slang)

+ +
+
+ +

◆ setObject()

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQtObjectPtr::setObject (PyObjecto)
+
+protected
+
+ +
+
+ +

◆ takeObject()

+ +
+
+ + + + + +
+ + + + + + + +
PyObject * PythonQtObjectPtr::takeObject ()
+
+inline
+
+

takes the object from the pointer, leaving the pointer empty. the caller has to take care about the decref of the taken object!

+ +

Definition at line 182 of file PythonQtObjectPtr.h.

+
183 {
+
184 PyObject* o = _object;
+
185 _object = nullptr;
+
186 return o;
+
187 }
+
struct _object PyObject
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ toLocalVariant()

+ +
+
+ + + + + + + +
QVariant PythonQtObjectPtr::toLocalVariant ()
+
+ +

Returns a PythonQtObjectPtr as a QVariant. Only use this when you know that the variant is only used locally and not stored outside of the current GIL scope.

+ +
+
+ +

◆ toVariant()

+ +
+
+ + + + + + + +
QVariant PythonQtObjectPtr::toVariant ()
+
+ +

Returns a PythonQtSafeObjectPtr as a QVariant. It does not return a PythonQtObjectPtr, because that would be unsafe regarding the GIL.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtPassOwnershipToCPP-members.html b/classPythonQtPassOwnershipToCPP-members.html new file mode 100644 index 000000000..39a1c0aa7 --- /dev/null +++ b/classPythonQtPassOwnershipToCPP-members.html @@ -0,0 +1,57 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtPassOwnershipToCPP< T > Member List
+
+
+ +

This is the complete list of members for PythonQtPassOwnershipToCPP< T >, including all inherited members.

+ + + + +
_tPythonQtPassOwnershipToCPP< T >
operator T() constPythonQtPassOwnershipToCPP< T >inline
PythonQtPassOwnershipToCPP(const T &t)PythonQtPassOwnershipToCPP< T >inline
+ + + + diff --git a/classPythonQtPassOwnershipToCPP.html b/classPythonQtPassOwnershipToCPP.html new file mode 100644 index 000000000..d4363b5f1 --- /dev/null +++ b/classPythonQtPassOwnershipToCPP.html @@ -0,0 +1,175 @@ + + + + + + + +PythonQt: PythonQtPassOwnershipToCPP< T > Class Template Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtPassOwnershipToCPP< T > Class Template Reference
+
+
+ +

#include <PythonQt.h>

+ + + + + + + + +

+Public Member Functions

 PythonQtPassOwnershipToCPP (const T &t)
 Allow conversion from T to PythonQtPassOwnershipToCPP<T>
 
 operator T () const
 Allow conversion from PythonQtPassOwnershipToCPP<T> to T.
 
+ + + +

+Public Attributes

T _t
 
+

Detailed Description

+
template<class T>
+class PythonQtPassOwnershipToCPP< T >

Helper template that allows to pass the ownership of a C++ instance between C++ and Python (it is used as a slot return type or parameter type so that it can be detected by the PythonQt slot calling code).

+ +

Definition at line 90 of file PythonQt.h.

+

Constructor & Destructor Documentation

+ +

◆ PythonQtPassOwnershipToCPP()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + + +
PythonQtPassOwnershipToCPP< T >::PythonQtPassOwnershipToCPP (const Tt)
+
+inline
+
+ +

Allow conversion from T to PythonQtPassOwnershipToCPP<T>

+ +

Definition at line 94 of file PythonQt.h.

+
95 : _t(t)
+
96 {
+
97 }
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+ +
+
+
+

Member Function Documentation

+ +

◆ operator T()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + +
PythonQtPassOwnershipToCPP< T >::operator T () const
+
+inline
+
+ +

Allow conversion from PythonQtPassOwnershipToCPP<T> to T.

+ +

Definition at line 99 of file PythonQt.h.

+
99{ return _t; }
+
+

References PythonQtPassOwnershipToCPP< T >::_t.

+ +
+
+

Member Data Documentation

+ +

◆ _t

+ +
+
+
+template<class T >
+ + + + +
T PythonQtPassOwnershipToCPP< T >::_t
+
+

Stored value. This is important so that it has the same memory layout as a pointer if T is a pointer type (which is the typical use case for this class).

+ +

Definition at line 103 of file PythonQt.h.

+ +

Referenced by PythonQtPassOwnershipToCPP< T >::operator T().

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtPassOwnershipToPython-members.html b/classPythonQtPassOwnershipToPython-members.html new file mode 100644 index 000000000..b15d9593a --- /dev/null +++ b/classPythonQtPassOwnershipToPython-members.html @@ -0,0 +1,57 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtPassOwnershipToPython< T > Member List
+
+
+ +

This is the complete list of members for PythonQtPassOwnershipToPython< T >, including all inherited members.

+ + + + +
_tPythonQtPassOwnershipToPython< T >
operator T() constPythonQtPassOwnershipToPython< T >inline
PythonQtPassOwnershipToPython(const T &t)PythonQtPassOwnershipToPython< T >inline
+ + + + diff --git a/classPythonQtPassOwnershipToPython.html b/classPythonQtPassOwnershipToPython.html new file mode 100644 index 000000000..998947f12 --- /dev/null +++ b/classPythonQtPassOwnershipToPython.html @@ -0,0 +1,175 @@ + + + + + + + +PythonQt: PythonQtPassOwnershipToPython< T > Class Template Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtPassOwnershipToPython< T > Class Template Reference
+
+
+ +

#include <PythonQt.h>

+ + + + + + + + +

+Public Member Functions

 PythonQtPassOwnershipToPython (const T &t)
 Allow conversion from T to PythonQtPassOwnershipToPython<T>
 
 operator T () const
 Allow conversion from PythonQtPassOwnershipToPython<T> to T.
 
+ + + +

+Public Attributes

T _t
 
+

Detailed Description

+
template<class T>
+class PythonQtPassOwnershipToPython< T >

Helper template that allows to pass the ownership of a C++ instance between C++ and Python (it is used as a slot return type or parameter type so that it can be detected by the PythonQt slot calling code).

+ +

Definition at line 110 of file PythonQt.h.

+

Constructor & Destructor Documentation

+ +

◆ PythonQtPassOwnershipToPython()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + + +
PythonQtPassOwnershipToPython< T >::PythonQtPassOwnershipToPython (const Tt)
+
+inline
+
+ +

Allow conversion from T to PythonQtPassOwnershipToPython<T>

+ +

Definition at line 114 of file PythonQt.h.

+
115 : _t(t)
+
116 {
+
117 }
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+ +
+
+
+

Member Function Documentation

+ +

◆ operator T()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + +
PythonQtPassOwnershipToPython< T >::operator T () const
+
+inline
+
+ +

Allow conversion from PythonQtPassOwnershipToPython<T> to T.

+ +

Definition at line 119 of file PythonQt.h.

+
119{ return _t; }
+
+

References PythonQtPassOwnershipToPython< T >::_t.

+ +
+
+

Member Data Documentation

+ +

◆ _t

+ +
+
+
+template<class T >
+ + + + +
T PythonQtPassOwnershipToPython< T >::_t
+
+

Stored value. This is important so that it has the same memory layout as a pointer if T is a pointer type (which is the typical use case for this class).

+ +

Definition at line 123 of file PythonQt.h.

+ +

Referenced by PythonQtPassOwnershipToPython< T >::operator T().

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtPrivate-members.html b/classPythonQtPrivate-members.html new file mode 100644 index 000000000..698fc391c --- /dev/null +++ b/classPythonQtPrivate-members.html @@ -0,0 +1,107 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtPrivate Member List
+
+
+ +

This is the complete list of members for PythonQtPrivate, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
addDecorators(QObject *o, int decoTypes)PythonQtPrivate
addParentClass(const char *typeName, const char *parentTypeName, int upcastingOffset)PythonQtPrivate
addPolymorphicHandler(const char *typeName, PythonQtPolymorphicHandlerCB *cb)PythonQtPrivate
addWrapperPointer(void *obj, PythonQtInstanceWrapper *wrapper)PythonQtPrivate
AllDecorators enum valuePythonQtPrivate
buildDynamicMetaObject(PythonQtClassWrapper *type, const QMetaObject *prototypeMetaObject)PythonQtPrivate
callMethodInPython(QMetaMethod &method, PythonQtInstanceWrapper *wrapper, void **args)PythonQtPrivate
checkAndRunCoroutine(const PythonQtObjectPtr &object)PythonQtPrivate
ConstructorDecorator enum valuePythonQtPrivate
createAsyncioFuture()PythonQtPrivate
createEnumValueInstance(PyObject *enumType, unsigned int enumValue)PythonQtPrivatestatic
createModule(const QString &name, PyObject *pycode)PythonQtPrivate
createNewPythonQtClassWrapper(PythonQtClassInfo *info, PyObject *module, const QByteArray &pythonClassName)PythonQtPrivate
createNewPythonQtEnumWrapper(const char *enumName, PyObject *parentObject)PythonQtPrivatestatic
createNewPythonQtInstanceWrapper(QObject *obj, PythonQtClassInfo *info, void *wrappedPtr=nullptr)PythonQtPrivate
currentClassInfoForClassWrapperCreation()PythonQtPrivate
DecoratorTypes enum namePythonQtPrivate
DestructorDecorator enum valuePythonQtPrivate
dummyTuple()PythonQtPrivatestatic
getClassInfo(const QMetaObject *meta)PythonQtPrivate
getClassInfo(const QByteArray &className)PythonQtPrivate
getDynamicMetaObject(PythonQtInstanceWrapper *wrapper, const QMetaObject *prototypeMetaObject)PythonQtPrivate
getSignature(PyObject *object)PythonQtPrivate
handleMetaCall(QObject *object, PythonQtInstanceWrapper *wrapper, QMetaObject::Call call, int id, void **args)PythonQtPrivate
handleVirtualOverloadReturnError(const char *signature, const PythonQtMethodInfo *methodInfo, PyObject *result)PythonQtPrivate
InstanceDecorator enum valuePythonQtPrivate
isMethodDescriptor(PyObject *object) constPythonQtPrivate
isPythonQtAnyObjectPtrMetaId(int id)PythonQtPrivateinline
isPythonQtObjectPtrMetaId(int id)PythonQtPrivateinline
isPythonQtSafeObjectPtrMetaId(int id)PythonQtPrivateinline
lookupClassInfoAndCreateIfNotPresent(const char *typeName)PythonQtPrivate
profilingCB() constPythonQtPrivateinline
PythonQtPythonQtPrivatefriend
pythonQtModule() constPythonQtPrivateinline
PythonQtPrivate()PythonQtPrivate
registerClass(const QMetaObject *metaobject, const char *package=nullptr, PythonQtQObjectCreatorFunctionCB *wrapperCreator=nullptr, PythonQtShellSetInstanceWrapperCB *shell=nullptr, PyObject *module=nullptr, int typeSlots=0)PythonQtPrivate
registerCPPClass(const char *typeName, const char *parentTypeName=nullptr, const char *package=nullptr, PythonQtQObjectCreatorFunctionCB *wrapperCreator=nullptr, PythonQtShellSetInstanceWrapperCB *shell=nullptr, PyObject *module=nullptr, int typeSlots=0)PythonQtPrivate
registerGlobalNamespace(const char *typeName, const char *package, PythonQtQObjectCreatorFunctionCB *wrapperCreator, const QMetaObject &metaObject, PyObject *module=nullptr)PythonQtPrivate
registerLazyClass(const QByteArray &name, const QByteArray &moduleToImport)PythonQtPrivate
registerQObjectClassNames(const QStringList &names)PythonQtPrivate
removeSignalEmitter(QObject *obj)PythonQtPrivate
removeWrapperPointer(void *obj)PythonQtPrivate
setTaskDoneCallback(const PythonQtObjectPtr &callable)PythonQtPrivate
setupDynamicMetaObjectChain(PythonQtClassWrapper *type, const QMetaObject *prototypeMetaObject)PythonQtPrivate
sharedLibrarySuffixes()PythonQtPrivateinline
shellClassDeleted(void *shellClass)PythonQtPrivate
StaticDecorator enum valuePythonQtPrivate
unwrapForeignWrapper(const QByteArray &classname, PyObject *obj)PythonQtPrivate
wrapMemoryAsBuffer(const void *data, Py_ssize_t size)PythonQtPrivatestatic
wrapMemoryAsBuffer(void *data, Py_ssize_t size)PythonQtPrivatestatic
wrapPtr(void *ptr, const QByteArray &name, bool passOwnership=false)PythonQtPrivate
wrapQObject(QObject *obj)PythonQtPrivate
~PythonQtPrivate() overridePythonQtPrivate
+ + + + diff --git a/classPythonQtPrivate.html b/classPythonQtPrivate.html new file mode 100644 index 000000000..83322c307 --- /dev/null +++ b/classPythonQtPrivate.html @@ -0,0 +1,1676 @@ + + + + + + + +PythonQt: PythonQtPrivate Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+ +
+ +

internal PythonQt details + More...

+ +

#include <PythonQt.h>

+
+Inheritance diagram for PythonQtPrivate:
+
+
+ +
+ + + + +

+Public Types

enum  DecoratorTypes {
+  StaticDecorator = 1 +, ConstructorDecorator = 2 +, DestructorDecorator = 4 +, InstanceDecorator = 8 +,
+  AllDecorators = 0xffff +
+ }
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 PythonQtPrivate ()
 
 ~PythonQtPrivate () override
 
void setTaskDoneCallback (const PythonQtObjectPtr &callable)
 
PythonQtObjectPtr checkAndRunCoroutine (const PythonQtObjectPtr &object)
 Runs the given coroutine (via asyncio), returns a scheduled task if it object is a coroutine.
 
PythonQtObjectPtr createAsyncioFuture ()
 Creates a new asyncio.Future object.
 
const QStringListsharedLibrarySuffixes ()
 get the suffixes that are used for shared libraries
 
bool isPythonQtObjectPtrMetaId (int id)
 returns if the id is the id for PythonQtObjectPtr
 
bool isPythonQtSafeObjectPtrMetaId (int id)
 returns if the id is the id for PythonQtSafeObjectPtr
 
bool isPythonQtAnyObjectPtrMetaId (int id)
 returns if the id is either PythonQtObjectPtr or PythonQtSafeObjectPtr
 
void addWrapperPointer (void *obj, PythonQtInstanceWrapper *wrapper)
 add the wrapper pointer (for reuse if the same obj appears while wrapper still exists)
 
void removeWrapperPointer (void *obj)
 remove the wrapper ptr again
 
void shellClassDeleted (void *shellClass)
 called by destructor of shells to allow invalidation of the Python wrapper
 
voidunwrapForeignWrapper (const QByteArray &classname, PyObject *obj)
 try to unwrap the given object to a C++ pointer using the foreign wrapper factories
 
bool addParentClass (const char *typeName, const char *parentTypeName, int upcastingOffset)
 add parent class relation
 
void addPolymorphicHandler (const char *typeName, PythonQtPolymorphicHandlerCB *cb)
 add a handler for polymorphic downcasting
 
PythonQtClassInfolookupClassInfoAndCreateIfNotPresent (const char *typeName)
 lookup existing classinfo and return new if not yet present
 
void removeSignalEmitter (QObject *obj)
 called when a signal emitting QObject is destroyed to remove the signal handler from the hash map
 
PyObjectwrapQObject (QObject *obj)
 wrap the given QObject into a Python object (or return existing wrapper!)
 
PyObjectwrapPtr (void *ptr, const QByteArray &name, bool passOwnership=false)
 
void registerClass (const QMetaObject *metaobject, const char *package=nullptr, PythonQtQObjectCreatorFunctionCB *wrapperCreator=nullptr, PythonQtShellSetInstanceWrapperCB *shell=nullptr, PyObject *module=nullptr, int typeSlots=0)
 registers a QObject derived class to PythonQt (this is implicitly called by addObject as well)
 
void registerCPPClass (const char *typeName, const char *parentTypeName=nullptr, const char *package=nullptr, PythonQtQObjectCreatorFunctionCB *wrapperCreator=nullptr, PythonQtShellSetInstanceWrapperCB *shell=nullptr, PyObject *module=nullptr, int typeSlots=0)
 
void registerGlobalNamespace (const char *typeName, const char *package, PythonQtQObjectCreatorFunctionCB *wrapperCreator, const QMetaObject &metaObject, PyObject *module=nullptr)
 Same as above, but all enums of the created wrapper will also be added to the given package and to the "Qt" package.
 
void registerQObjectClassNames (const QStringList &names)
 
void addDecorators (QObject *o, int decoTypes)
 add a decorator object
 
PythonQtClassWrappercreateNewPythonQtClassWrapper (PythonQtClassInfo *info, PyObject *module, const QByteArray &pythonClassName)
 helper method that creates a PythonQtClassWrapper object (returns a new reference)
 
PythonQtInstanceWrappercreateNewPythonQtInstanceWrapper (QObject *obj, PythonQtClassInfo *info, void *wrappedPtr=nullptr)
 helper method that creates a PythonQtInstanceWrapper object and registers it in the object map
 
PythonQtClassInfogetClassInfo (const QMetaObject *meta)
 get the class info for a meta object (if available)
 
PythonQtClassInfogetClassInfo (const QByteArray &className)
 get the class info for a meta object (if available)
 
void registerLazyClass (const QByteArray &name, const QByteArray &moduleToImport)
 
PythonQtObjectPtr createModule (const QString &name, PyObject *pycode)
 creates the new module from the given pycode
 
PythonQtClassInfocurrentClassInfoForClassWrapperCreation ()
 get the current class info (for the next PythonQtClassWrapper that is created) and reset it to NULL again
 
void handleVirtualOverloadReturnError (const char *signature, const PythonQtMethodInfo *methodInfo, PyObject *result)
 called by virtual overloads when a python return value can not be converted to the required Qt type
 
PythonQtObjectPtr pythonQtModule () const
 get access to the PythonQt module
 
PythonQt::ProfilingCBprofilingCB () const
 returns the profiling callback, which may be NULL
 
QString getSignature (PyObject *object)
 determines the signature of the given callable object (similar as pydoc)
 
bool isMethodDescriptor (PyObject *object) const
 returns true if the object is a method descriptor (same as inspect.ismethoddescriptor() in inspect.py)
 
const QMetaObjectgetDynamicMetaObject (PythonQtInstanceWrapper *wrapper, const QMetaObject *prototypeMetaObject)
 get the dynamic meta object for the given wrapper. It will contain the signals/slots that have been added in Python
 
const QMetaObjectsetupDynamicMetaObjectChain (PythonQtClassWrapper *type, const QMetaObject *prototypeMetaObject)
 recursively creates the dynamic meta object chain down to the Qt class wrapper.
 
const QMetaObjectbuildDynamicMetaObject (PythonQtClassWrapper *type, const QMetaObject *prototypeMetaObject)
 builds and returns the dynamic meta object for the given type, derived from prototypeMetaObject.
 
int handleMetaCall (QObject *object, PythonQtInstanceWrapper *wrapper, QMetaObject::Call call, int id, void **args)
 redirected from shell classes, tries to call the given meta call on the Python wrapper.
 
void callMethodInPython (QMetaMethod &method, PythonQtInstanceWrapper *wrapper, void **args)
 calls the given method on Python function with same name.
 
+ + + + + + + + + + + + + + + + +

+Static Public Member Functions

static PyObjectwrapMemoryAsBuffer (const void *data, Py_ssize_t size)
 create a read-only buffer object from the given memory
 
static PyObjectwrapMemoryAsBuffer (void *data, Py_ssize_t size)
 create a read-write buffer object from the given memory
 
static PyObjectcreateEnumValueInstance (PyObject *enumType, unsigned int enumValue)
 create a new instance of the given enum type with given value (returns a new reference)
 
static PyObjectcreateNewPythonQtEnumWrapper (const char *enumName, PyObject *parentObject)
 helper that creates a new int derived class that represents the enum of the given name (returns a new reference)
 
static PyObjectdummyTuple ()
 the dummy tuple (which is empty and may be used to detected that a wrapper is called from internal wrapper creation
 
+ + + +

+Friends

class PythonQt
 
+

Detailed Description

+

internal PythonQt details

+ +

Definition at line 672 of file PythonQt.h.

+

Member Enumeration Documentation

+ +

◆ DecoratorTypes

+ +
+
+ + + + + + +
Enumerator
StaticDecorator 
ConstructorDecorator 
DestructorDecorator 
InstanceDecorator 
AllDecorators 
+ +

Definition at line 681 of file PythonQt.h.

+
681 {
+
682 StaticDecorator = 1,
+ + + +
686 AllDecorators = 0xffff
+
687 };
+ + + + + +
+
+
+

Constructor & Destructor Documentation

+ +

◆ PythonQtPrivate()

+ +
+
+ + + + + + + +
PythonQtPrivate::PythonQtPrivate ()
+
+ +
+
+ +

◆ ~PythonQtPrivate()

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtPrivate::~PythonQtPrivate ()
+
+override
+
+ +
+
+

Member Function Documentation

+ +

◆ addDecorators()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void PythonQtPrivate::addDecorators (QObject * o,
int decoTypes 
)
+
+ +

add a decorator object

+ +
+
+ +

◆ addParentClass()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQtPrivate::addParentClass (const chartypeName,
const charparentTypeName,
int upcastingOffset 
)
+
+ +

add parent class relation

+ +
+
+ +

◆ addPolymorphicHandler()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void PythonQtPrivate::addPolymorphicHandler (const chartypeName,
PythonQtPolymorphicHandlerCBcb 
)
+
+ +

add a handler for polymorphic downcasting

+ +
+
+ +

◆ addWrapperPointer()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void PythonQtPrivate::addWrapperPointer (voidobj,
PythonQtInstanceWrapperwrapper 
)
+
+ +

add the wrapper pointer (for reuse if the same obj appears while wrapper still exists)

+ +
+
+ +

◆ buildDynamicMetaObject()

+ +
+
+ + + + + + + + + + + + + + + + + + +
const QMetaObject * PythonQtPrivate::buildDynamicMetaObject (PythonQtClassWrappertype,
const QMetaObjectprototypeMetaObject 
)
+
+ +

builds and returns the dynamic meta object for the given type, derived from prototypeMetaObject.

+ +
+
+ +

◆ callMethodInPython()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void PythonQtPrivate::callMethodInPython (QMetaMethodmethod,
PythonQtInstanceWrapperwrapper,
void ** args 
)
+
+ +

calls the given method on Python function with same name.

+ +
+
+ +

◆ checkAndRunCoroutine()

+ +
+
+ + + + + + + + +
PythonQtObjectPtr PythonQtPrivate::checkAndRunCoroutine (const PythonQtObjectPtrobject)
+
+ +

Runs the given coroutine (via asyncio), returns a scheduled task if it object is a coroutine.

+ +
+
+ +

◆ createAsyncioFuture()

+ +
+
+ + + + + + + +
PythonQtObjectPtr PythonQtPrivate::createAsyncioFuture ()
+
+ +

Creates a new asyncio.Future object.

+ +
+
+ +

◆ createEnumValueInstance()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtPrivate::createEnumValueInstance (PyObjectenumType,
unsigned int enumValue 
)
+
+static
+
+ +

create a new instance of the given enum type with given value (returns a new reference)

+ +
+
+ +

◆ createModule()

+ +
+
+ + + + + + + + + + + + + + + + + + +
PythonQtObjectPtr PythonQtPrivate::createModule (const QStringname,
PyObjectpycode 
)
+
+ +

creates the new module from the given pycode

+ +
+
+ +

◆ createNewPythonQtClassWrapper()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
PythonQtClassWrapper * PythonQtPrivate::createNewPythonQtClassWrapper (PythonQtClassInfoinfo,
PyObjectmodule,
const QByteArraypythonClassName 
)
+
+ +

helper method that creates a PythonQtClassWrapper object (returns a new reference)

+ +
+
+ +

◆ createNewPythonQtEnumWrapper()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtPrivate::createNewPythonQtEnumWrapper (const charenumName,
PyObjectparentObject 
)
+
+static
+
+ +

helper that creates a new int derived class that represents the enum of the given name (returns a new reference)

+ +
+
+ +

◆ createNewPythonQtInstanceWrapper()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
PythonQtInstanceWrapper * PythonQtPrivate::createNewPythonQtInstanceWrapper (QObject * obj,
PythonQtClassInfoinfo,
voidwrappedPtr = nullptr 
)
+
+ +

helper method that creates a PythonQtInstanceWrapper object and registers it in the object map

+ +
+
+ +

◆ currentClassInfoForClassWrapperCreation()

+ +
+
+ + + + + + + +
PythonQtClassInfo * PythonQtPrivate::currentClassInfoForClassWrapperCreation ()
+
+ +

get the current class info (for the next PythonQtClassWrapper that is created) and reset it to NULL again

+ +
+
+ +

◆ dummyTuple()

+ +
+
+ + + + + +
+ + + + + + + +
static PyObject * PythonQtPrivate::dummyTuple ()
+
+static
+
+ +

the dummy tuple (which is empty and may be used to detected that a wrapper is called from internal wrapper creation

+ +
+
+ +

◆ getClassInfo() [1/2]

+ +
+
+ + + + + + + + +
PythonQtClassInfo * PythonQtPrivate::getClassInfo (const QByteArrayclassName)
+
+ +

get the class info for a meta object (if available)

+ +
+
+ +

◆ getClassInfo() [2/2]

+ +
+
+ + + + + + + + +
PythonQtClassInfo * PythonQtPrivate::getClassInfo (const QMetaObjectmeta)
+
+ +

get the class info for a meta object (if available)

+ +

Referenced by PythonQtConvertListOfKnownClassToPythonList(), and PythonQtConvertPythonListToListOfKnownClass().

+ +
+
+ +

◆ getDynamicMetaObject()

+ +
+
+ + + + + + + + + + + + + + + + + + +
const QMetaObject * PythonQtPrivate::getDynamicMetaObject (PythonQtInstanceWrapperwrapper,
const QMetaObjectprototypeMetaObject 
)
+
+ +

get the dynamic meta object for the given wrapper. It will contain the signals/slots that have been added in Python

+ +
+
+ +

◆ getSignature()

+ +
+
+ + + + + + + + +
QString PythonQtPrivate::getSignature (PyObjectobject)
+
+ +

determines the signature of the given callable object (similar as pydoc)

+ +
+
+ +

◆ handleMetaCall()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int PythonQtPrivate::handleMetaCall (QObject * object,
PythonQtInstanceWrapperwrapper,
QMetaObject::Call call,
int id,
void ** args 
)
+
+ +

redirected from shell classes, tries to call the given meta call on the Python wrapper.

+ +
+
+ +

◆ handleVirtualOverloadReturnError()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void PythonQtPrivate::handleVirtualOverloadReturnError (const charsignature,
const PythonQtMethodInfomethodInfo,
PyObjectresult 
)
+
+ +

called by virtual overloads when a python return value can not be converted to the required Qt type

+ +
+
+ +

◆ isMethodDescriptor()

+ +
+
+ + + + + + + + +
bool PythonQtPrivate::isMethodDescriptor (PyObjectobject) const
+
+ +

returns true if the object is a method descriptor (same as inspect.ismethoddescriptor() in inspect.py)

+ +
+
+ +

◆ isPythonQtAnyObjectPtrMetaId()

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtPrivate::isPythonQtAnyObjectPtrMetaId (int id)
+
+inline
+
+ +

returns if the id is either PythonQtObjectPtr or PythonQtSafeObjectPtr

+ +

Definition at line 707 of file PythonQt.h.

+
708 {
+
709 return _PythonQtObjectPtr_metaId == id || _PythonQtSafeObjectPtr_metaId == id;
+
710 }
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
+
+
+ +

◆ isPythonQtObjectPtrMetaId()

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtPrivate::isPythonQtObjectPtrMetaId (int id)
+
+inline
+
+ +

returns if the id is the id for PythonQtObjectPtr

+ +

Definition at line 703 of file PythonQt.h.

+
703{ return _PythonQtObjectPtr_metaId == id; }
+
+
+
+ +

◆ isPythonQtSafeObjectPtrMetaId()

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtPrivate::isPythonQtSafeObjectPtrMetaId (int id)
+
+inline
+
+ +

returns if the id is the id for PythonQtSafeObjectPtr

+ +

Definition at line 705 of file PythonQt.h.

+
705{ return _PythonQtSafeObjectPtr_metaId == id; }
+
+
+
+ +

◆ lookupClassInfoAndCreateIfNotPresent()

+ +
+
+ + + + + + + + +
PythonQtClassInfo * PythonQtPrivate::lookupClassInfoAndCreateIfNotPresent (const chartypeName)
+
+ +

lookup existing classinfo and return new if not yet present

+ +
+
+ +

◆ profilingCB()

+ +
+
+ + + + + +
+ + + + + + + +
PythonQt::ProfilingCB * PythonQtPrivate::profilingCB () const
+
+inline
+
+ +

returns the profiling callback, which may be NULL

+ +

Definition at line 819 of file PythonQt.h.

+
819{ return _profilingCB; }
+
+
+
+ +

◆ pythonQtModule()

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtObjectPtr PythonQtPrivate::pythonQtModule () const
+
+inline
+
+ +

get access to the PythonQt module

+ +

Definition at line 816 of file PythonQt.h.

+
816{ return _pythonQtModule; }
+
+
+
+ +

◆ registerClass()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void PythonQtPrivate::registerClass (const QMetaObjectmetaobject,
const charpackage = nullptr,
PythonQtQObjectCreatorFunctionCBwrapperCreator = nullptr,
PythonQtShellSetInstanceWrapperCBshell = nullptr,
PyObjectmodule = nullptr,
int typeSlots = 0 
)
+
+ +

registers a QObject derived class to PythonQt (this is implicitly called by addObject as well)

+ +
+
+ +

◆ registerCPPClass()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void PythonQtPrivate::registerCPPClass (const chartypeName,
const charparentTypeName = nullptr,
const charpackage = nullptr,
PythonQtQObjectCreatorFunctionCBwrapperCreator = nullptr,
PythonQtShellSetInstanceWrapperCBshell = nullptr,
PyObjectmodule = nullptr,
int typeSlots = 0 
)
+
+

add a wrapper object for the given QMetaType typeName, also does an addClassDecorators() to add constructors for variants (ownership of wrapper is passed to PythonQt)

+

Make sure that you have done a qRegisterMetaType first, if typeName is a user type!

+

This will add a wrapper object that is used to make calls to the given classname typeName. All slots that take a pointer to typeName as the first argument will be callable from Python on a variant object that contains such a type.

+ +
+
+ +

◆ registerGlobalNamespace()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void PythonQtPrivate::registerGlobalNamespace (const chartypeName,
const charpackage,
PythonQtQObjectCreatorFunctionCBwrapperCreator,
const QMetaObjectmetaObject,
PyObjectmodule = nullptr 
)
+
+ +

Same as above, but all enums of the created wrapper will also be added to the given package and to the "Qt" package.

+ +
+
+ +

◆ registerLazyClass()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void PythonQtPrivate::registerLazyClass (const QByteArrayname,
const QByteArraymoduleToImport 
)
+
+

register a class name that causes lazy loading of the moduleToImport when PythonQt encounters the type

+ +
+
+ +

◆ registerQObjectClassNames()

+ +
+
+ + + + + + + + +
void PythonQtPrivate::registerQObjectClassNames (const QStringListnames)
+
+

as an alternative to registerClass, you can tell PythonQt the names of QObject derived classes and it will register the classes when it first sees a pointer to such a derived class

+ +
+
+ +

◆ removeSignalEmitter()

+ +
+
+ + + + + + + + +
void PythonQtPrivate::removeSignalEmitter (QObject * obj)
+
+ +

called when a signal emitting QObject is destroyed to remove the signal handler from the hash map

+ +
+
+ +

◆ removeWrapperPointer()

+ +
+
+ + + + + + + + +
void PythonQtPrivate::removeWrapperPointer (voidobj)
+
+ +

remove the wrapper ptr again

+ +
+
+ +

◆ setTaskDoneCallback()

+ +
+
+ + + + + + + + +
void PythonQtPrivate::setTaskDoneCallback (const PythonQtObjectPtrcallable)
+
+

Set a callable that is used as the argument for the add_done_callback for the Task created by checkAndRunCoroutine

+ +
+
+ +

◆ setupDynamicMetaObjectChain()

+ +
+
+ + + + + + + + + + + + + + + + + + +
const QMetaObject * PythonQtPrivate::setupDynamicMetaObjectChain (PythonQtClassWrappertype,
const QMetaObjectprototypeMetaObject 
)
+
+ +

recursively creates the dynamic meta object chain down to the Qt class wrapper.

+ +
+
+ +

◆ sharedLibrarySuffixes()

+ +
+
+ + + + + +
+ + + + + + + +
const QStringList & PythonQtPrivate::sharedLibrarySuffixes ()
+
+inline
+
+ +

get the suffixes that are used for shared libraries

+ +

Definition at line 700 of file PythonQt.h.

+
700{ return _sharedLibrarySuffixes; }
+
+
+
+ +

◆ shellClassDeleted()

+ +
+
+ + + + + + + + +
void PythonQtPrivate::shellClassDeleted (voidshellClass)
+
+ +

called by destructor of shells to allow invalidation of the Python wrapper

+ +
+
+ +

◆ unwrapForeignWrapper()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void * PythonQtPrivate::unwrapForeignWrapper (const QByteArrayclassname,
PyObjectobj 
)
+
+ +

try to unwrap the given object to a C++ pointer using the foreign wrapper factories

+ +
+
+ +

◆ wrapMemoryAsBuffer() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtPrivate::wrapMemoryAsBuffer (const voiddata,
Py_ssize_t size 
)
+
+static
+
+ +

create a read-only buffer object from the given memory

+ +
+
+ +

◆ wrapMemoryAsBuffer() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtPrivate::wrapMemoryAsBuffer (voiddata,
Py_ssize_t size 
)
+
+static
+
+ +

create a read-write buffer object from the given memory

+ +
+
+ +

◆ wrapPtr()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
PyObject * PythonQtPrivate::wrapPtr (voidptr,
const QByteArrayname,
bool passOwnership = false 
)
+
+

wrap the given ptr into a Python object (or return existing wrapper!) if there is a known QObject of that name or a known wrapper in the factory. If passOwnership == true, the ownership is passed to PythonQt, so the object will be deleted by PythonQt when the Python wrapper goes away.

+ +

Referenced by PythonQtConvertListOfKnownClassToPythonList().

+ +
+
+ +

◆ wrapQObject()

+ +
+
+ + + + + + + + +
PyObject * PythonQtPrivate::wrapQObject (QObject * obj)
+
+ +

wrap the given QObject into a Python object (or return existing wrapper!)

+ +
+
+

Friends And Related Symbol Documentation

+ +

◆ PythonQt

+ +
+
+ + + + + +
+ + + + +
friend class PythonQt
+
+friend
+
+ +

Definition at line 917 of file PythonQt.h.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtPrivate.png b/classPythonQtPrivate.png new file mode 100644 index 000000000..c0df8ccaf Binary files /dev/null and b/classPythonQtPrivate.png differ diff --git a/classPythonQtQFileImporter-members.html b/classPythonQtQFileImporter-members.html new file mode 100644 index 000000000..7c4e6f693 --- /dev/null +++ b/classPythonQtQFileImporter-members.html @@ -0,0 +1,65 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtQFileImporter Member List
+
+
+ +

This is the complete list of members for PythonQtQFileImporter, including all inherited members.

+ + + + + + + + + + + + +
exists(const QString &filename) overridePythonQtQFileImportervirtual
ignoreUpdatedPythonSourceFiles()PythonQtImportFileInterfaceinlinevirtual
importedModule(const QString &)PythonQtImportFileInterfaceinlinevirtual
isEggArchive(const QString &filename) overridePythonQtQFileImportervirtual
lastModifiedDate(const QString &filename) overridePythonQtQFileImportervirtual
PythonQtImportFileInterface()PythonQtImportFileInterfaceinline
PythonQtQFileImporter()PythonQtQFileImporter
readFileAsBytes(const QString &filename) overridePythonQtQFileImportervirtual
readSourceFile(const QString &filename, bool &ok) overridePythonQtQFileImportervirtual
~PythonQtImportFileInterface()PythonQtImportFileInterfaceinlinevirtual
~PythonQtQFileImporter() overridePythonQtQFileImporter
+ + + + diff --git a/classPythonQtQFileImporter.html b/classPythonQtQFileImporter.html new file mode 100644 index 000000000..85dcedb4a --- /dev/null +++ b/classPythonQtQFileImporter.html @@ -0,0 +1,307 @@ + + + + + + + +PythonQt: PythonQtQFileImporter Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtQFileImporter Class Reference
+
+
+ +

default importer implementation using QFile to load python code + More...

+ +

#include <PythonQtQFileImporter.h>

+
+Inheritance diagram for PythonQtQFileImporter:
+
+
+ + +PythonQtImportFileInterface + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 PythonQtQFileImporter ()
 
 ~PythonQtQFileImporter () override
 
QByteArray readFileAsBytes (const QString &filename) override
 read the given file as byte array, without doing any linefeed translations
 
QByteArray readSourceFile (const QString &filename, bool &ok) override
 
bool exists (const QString &filename) override
 returns if the file exists
 
bool isEggArchive (const QString &filename) override
 
QDateTime lastModifiedDate (const QString &filename) override
 get the last modified data of a file
 
- Public Member Functions inherited from PythonQtImportFileInterface
virtual ~PythonQtImportFileInterface ()
 
 PythonQtImportFileInterface ()
 
virtual bool ignoreUpdatedPythonSourceFiles ()
 
virtual void importedModule (const QString &)
 
+

Detailed Description

+

default importer implementation using QFile to load python code

+ +

Definition at line 49 of file PythonQtQFileImporter.h.

+

Constructor & Destructor Documentation

+ +

◆ PythonQtQFileImporter()

+ +
+
+ + + + + + + +
PythonQtQFileImporter::PythonQtQFileImporter ()
+
+ +
+
+ +

◆ ~PythonQtQFileImporter()

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtQFileImporter::~PythonQtQFileImporter ()
+
+override
+
+ +
+
+

Member Function Documentation

+ +

◆ exists()

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtQFileImporter::exists (const QStringfilename)
+
+overridevirtual
+
+ +

returns if the file exists

+ +

Implements PythonQtImportFileInterface.

+ +
+
+ +

◆ isEggArchive()

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtQFileImporter::isEggArchive (const QStringfilename)
+
+overridevirtual
+
+

returns true if the given file is an egg archive (e.g. zip). If the egg is a directory then false is returned.

+ +

Implements PythonQtImportFileInterface.

+ +
+
+ +

◆ lastModifiedDate()

+ +
+
+ + + + + +
+ + + + + + + + +
QDateTime PythonQtQFileImporter::lastModifiedDate (const QStringfilename)
+
+overridevirtual
+
+ +

get the last modified data of a file

+ +

Implements PythonQtImportFileInterface.

+ +
+
+ +

◆ readFileAsBytes()

+ +
+
+ + + + + +
+ + + + + + + + +
QByteArray PythonQtQFileImporter::readFileAsBytes (const QStringfilename)
+
+overridevirtual
+
+ +

read the given file as byte array, without doing any linefeed translations

+ +

Implements PythonQtImportFileInterface.

+ +
+
+ +

◆ readSourceFile()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
QByteArray PythonQtQFileImporter::readSourceFile (const QStringfilename,
boolok 
)
+
+overridevirtual
+
+

read a source file, expects a readable Python text file with translated line feeds. If the file can not be load OR it can not be verified, ok is set to false

+ +

Implements PythonQtImportFileInterface.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtQFileImporter.png b/classPythonQtQFileImporter.png new file mode 100644 index 000000000..e31ca54e6 Binary files /dev/null and b/classPythonQtQFileImporter.png differ diff --git a/classPythonQtSafeObjectPtr-members.html b/classPythonQtSafeObjectPtr-members.html new file mode 100644 index 000000000..55d84f468 --- /dev/null +++ b/classPythonQtSafeObjectPtr-members.html @@ -0,0 +1,78 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtSafeObjectPtr Member List
+
+
+ +

This is the complete list of members for PythonQtSafeObjectPtr, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
isNull() constPythonQtSafeObjectPtrinline
object() constPythonQtSafeObjectPtrinline
operator PyObject *() constPythonQtSafeObjectPtrinline
operator!=(const PythonQtSafeObjectPtr &p) constPythonQtSafeObjectPtrinline
operator!=(PyObject *p) constPythonQtSafeObjectPtrinline
operator*() constPythonQtSafeObjectPtrinline
operator->() constPythonQtSafeObjectPtrinline
operator=(const PythonQtSafeObjectPtr &p)PythonQtSafeObjectPtrinline
operator=(const PythonQtObjectPtr &p)PythonQtSafeObjectPtrinline
operator=(PythonQtSafeObjectPtr &&p) noexceptPythonQtSafeObjectPtrinline
operator=(PythonQtObjectPtr &&p)PythonQtSafeObjectPtrinline
operator=(PyObject *o)PythonQtSafeObjectPtrinline
operator==(const PythonQtSafeObjectPtr &p) constPythonQtSafeObjectPtrinline
operator==(PyObject *p) constPythonQtSafeObjectPtrinline
PythonQtSafeObjectPtr()PythonQtSafeObjectPtrinline
PythonQtSafeObjectPtr(const PythonQtSafeObjectPtr &p)PythonQtSafeObjectPtrinline
PythonQtSafeObjectPtr(const PythonQtObjectPtr &p)PythonQtSafeObjectPtrinline
PythonQtSafeObjectPtr(PythonQtSafeObjectPtr &&p) noexceptPythonQtSafeObjectPtrinline
PythonQtSafeObjectPtr(PythonQtObjectPtr &&p)PythonQtSafeObjectPtrinline
PythonQtSafeObjectPtr(PyObject *o)PythonQtSafeObjectPtr
setObject(PyObject *o)PythonQtSafeObjectPtrprotected
setObjectUnsafe(PyObject *o)PythonQtSafeObjectPtrprotected
takeObject()PythonQtSafeObjectPtrinline
~PythonQtSafeObjectPtr()PythonQtSafeObjectPtr
+ + + + diff --git a/classPythonQtSafeObjectPtr.html b/classPythonQtSafeObjectPtr.html new file mode 100644 index 000000000..254c25204 --- /dev/null +++ b/classPythonQtSafeObjectPtr.html @@ -0,0 +1,867 @@ + + + + + + + +PythonQt: PythonQtSafeObjectPtr Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtSafeObjectPtr Class Reference
+
+
+ +

a smart pointer that stores a PyObject pointer and that handles reference counting automatically + More...

+ +

#include <PythonQtObjectPtr.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 PythonQtSafeObjectPtr ()
 
 PythonQtSafeObjectPtr (const PythonQtSafeObjectPtr &p)
 
 PythonQtSafeObjectPtr (const PythonQtObjectPtr &p)
 
 PythonQtSafeObjectPtr (PythonQtSafeObjectPtr &&p) noexcept
 rvalue copy constructor, does not need any incref/decref.
 
 PythonQtSafeObjectPtr (PythonQtObjectPtr &&p)
 rvalue copy constructor, does not need any incref/decref.
 
 PythonQtSafeObjectPtr (PyObject *o)
 
 ~PythonQtSafeObjectPtr ()
 
PythonQtSafeObjectPtroperator= (const PythonQtSafeObjectPtr &p)
 
PythonQtSafeObjectPtroperator= (const PythonQtObjectPtr &p)
 
PythonQtSafeObjectPtroperator= (PythonQtSafeObjectPtr &&p) noexcept
 rvalue assignment operator that steals the reference from p
 
PythonQtSafeObjectPtroperator= (PythonQtObjectPtr &&p)
 rvalue assignment operator that steals the reference from p
 
PythonQtSafeObjectPtroperator= (PyObject *o)
 
bool operator== (const PythonQtSafeObjectPtr &p) const
 
bool operator!= (const PythonQtSafeObjectPtr &p) const
 
bool operator== (PyObject *p) const
 
bool operator!= (PyObject *p) const
 
bool isNull () const
 
PyObjectoperator-> () const
 
PyObjectoperator* () const
 
 operator PyObject * () const
 
PyObjectobject () const
 
PyObjecttakeObject ()
 
+ + + + + +

+Protected Member Functions

void setObject (PyObject *o)
 
void setObjectUnsafe (PyObject *o)
 
+

Detailed Description

+

a smart pointer that stores a PyObject pointer and that handles reference counting automatically

+ +

Definition at line 198 of file PythonQtObjectPtr.h.

+

Constructor & Destructor Documentation

+ +

◆ PythonQtSafeObjectPtr() [1/6]

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtSafeObjectPtr::PythonQtSafeObjectPtr ()
+
+inline
+
+ +

Definition at line 201 of file PythonQtObjectPtr.h.

+
202 : _object(nullptr)
+
203 {
+
204 }
+
+
+
+ +

◆ PythonQtSafeObjectPtr() [2/6]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtSafeObjectPtr::PythonQtSafeObjectPtr (const PythonQtSafeObjectPtrp)
+
+inline
+
+ +

Definition at line 206 of file PythonQtObjectPtr.h.

+
207 : _object(nullptr)
+
208 {
+
209 setObject(p.object());
+
210 }
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
void setObject(PyObject *o)
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ PythonQtSafeObjectPtr() [3/6]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtSafeObjectPtr::PythonQtSafeObjectPtr (const PythonQtObjectPtrp)
+
+inline
+
+ +

Definition at line 212 of file PythonQtObjectPtr.h.

+
213 : _object(nullptr)
+
214 {
+
215 setObject(p.object());
+
216 }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ PythonQtSafeObjectPtr() [4/6]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtSafeObjectPtr::PythonQtSafeObjectPtr (PythonQtSafeObjectPtr && p)
+
+inlinenoexcept
+
+ +

rvalue copy constructor, does not need any incref/decref.

+ +

Definition at line 219 of file PythonQtObjectPtr.h.

+
220 : _object(p._object)
+
221 {
+
222 p._object = nullptr;
+
223 }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ PythonQtSafeObjectPtr() [5/6]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtSafeObjectPtr::PythonQtSafeObjectPtr (PythonQtObjectPtr && p)
+
+inline
+
+ +

rvalue copy constructor, does not need any incref/decref.

+ +

Definition at line 226 of file PythonQtObjectPtr.h.

+
227 : _object(p.takeObject())
+
228 {
+
229 }
+
+
+
+ +

◆ PythonQtSafeObjectPtr() [6/6]

+ +
+
+ + + + + + + + +
PythonQtSafeObjectPtr::PythonQtSafeObjectPtr (PyObjecto)
+
+ +
+
+ +

◆ ~PythonQtSafeObjectPtr()

+ +
+
+ + + + + + + +
PythonQtSafeObjectPtr::~PythonQtSafeObjectPtr ()
+
+ +
+
+

Member Function Documentation

+ +

◆ isNull()

+ +
+
+ + + + + +
+ + + + + + + +
bool PythonQtSafeObjectPtr::isNull () const
+
+inline
+
+ +

Definition at line 282 of file PythonQtObjectPtr.h.

+
282{ return !object(); }
+
PyObject * object() const
+
+
+
+ +

◆ object()

+ +
+
+ + + + + +
+ + + + + + + +
PyObject * PythonQtSafeObjectPtr::object () const
+
+inline
+
+ +

Definition at line 290 of file PythonQtObjectPtr.h.

+
290{ return _object; }
+
+
+
+ +

◆ operator PyObject *()

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtSafeObjectPtr::operator PyObject * () const
+
+inline
+
+ +

Definition at line 288 of file PythonQtObjectPtr.h.

+
288{ return object(); }
+
+
+
+ +

◆ operator!=() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtSafeObjectPtr::operator!= (const PythonQtSafeObjectPtrp) const
+
+inline
+
+ +

Definition at line 276 of file PythonQtObjectPtr.h.

+
276{ return !(*this == p); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ operator!=() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtSafeObjectPtr::operator!= (PyObjectp) const
+
+inline
+
+ +

Definition at line 280 of file PythonQtObjectPtr.h.

+
280{ return object() != p; }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ operator*()

+ +
+
+ + + + + +
+ + + + + + + +
PyObject & PythonQtSafeObjectPtr::operator* () const
+
+inline
+
+ +

Definition at line 286 of file PythonQtObjectPtr.h.

+
286{ return *(object()); }
+
+
+
+ +

◆ operator->()

+ +
+
+ + + + + +
+ + + + + + + +
PyObject * PythonQtSafeObjectPtr::operator-> () const
+
+inline
+
+ +

Definition at line 284 of file PythonQtObjectPtr.h.

+
284{ return object(); }
+
+
+
+ +

◆ operator=() [1/5]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtSafeObjectPtr & PythonQtSafeObjectPtr::operator= (const PythonQtObjectPtrp)
+
+inline
+
+ +

Definition at line 241 of file PythonQtObjectPtr.h.

+
242 {
+
243 setObjectUnsafe(p.object());
+
244 return *this;
+
245 }
+
void setObjectUnsafe(PyObject *o)
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ operator=() [2/5]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtSafeObjectPtr & PythonQtSafeObjectPtr::operator= (const PythonQtSafeObjectPtrp)
+
+inline
+
+ +

Definition at line 235 of file PythonQtObjectPtr.h.

+
236 {
+
237 setObject(p.object());
+
238 return *this;
+
239 }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ operator=() [3/5]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtSafeObjectPtr & PythonQtSafeObjectPtr::operator= (PyObjecto)
+
+inline
+
+ +

Definition at line 268 of file PythonQtObjectPtr.h.

+
269 {
+
270 setObject(o);
+
271 return *this;
+
272 }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ operator=() [4/5]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtSafeObjectPtr & PythonQtSafeObjectPtr::operator= (PythonQtObjectPtr && p)
+
+inline
+
+ +

rvalue assignment operator that steals the reference from p

+ +

Definition at line 259 of file PythonQtObjectPtr.h.

+
260 {
+
261 if (_object) {
+
262 setObjectUnsafe(nullptr);
+
263 }
+
264 _object = p.takeObject();
+
265 return *this;
+
266 }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ operator=() [5/5]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtSafeObjectPtr & PythonQtSafeObjectPtr::operator= (PythonQtSafeObjectPtr && p)
+
+inlinenoexcept
+
+ +

rvalue assignment operator that steals the reference from p

+ +

Definition at line 248 of file PythonQtObjectPtr.h.

+
249 {
+
250 if (_object) {
+
251 setObject(nullptr);
+
252 }
+
253 _object = p._object;
+
254 p._object = nullptr;
+
255 return *this;
+
256 }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ operator==() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtSafeObjectPtr::operator== (const PythonQtSafeObjectPtrp) const
+
+inline
+
+ +

Definition at line 274 of file PythonQtObjectPtr.h.

+
274{ return object() == p.object(); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ operator==() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
bool PythonQtSafeObjectPtr::operator== (PyObjectp) const
+
+inline
+
+ +

Definition at line 278 of file PythonQtObjectPtr.h.

+
278{ return object() == p; }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ setObject()

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQtSafeObjectPtr::setObject (PyObjecto)
+
+protected
+
+ +
+
+ +

◆ setObjectUnsafe()

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQtSafeObjectPtr::setObjectUnsafe (PyObjecto)
+
+protected
+
+ +
+
+ +

◆ takeObject()

+ +
+
+ + + + + +
+ + + + + + + +
PyObject * PythonQtSafeObjectPtr::takeObject ()
+
+inline
+
+

takes the object from the pointer, leaving the pointer empty. the caller has to take care about the decref of the taken object!

+ +

Definition at line 294 of file PythonQtObjectPtr.h.

+
295 {
+
296 PyObject* o = _object;
+
297 _object = nullptr;
+
298 return o;
+
299 }
+
struct _object PyObject
+
+

References PythonQtConvertPairToPython().

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtSignalReceiver-members.html b/classPythonQtSignalReceiver-members.html new file mode 100644 index 000000000..c42769bc3 --- /dev/null +++ b/classPythonQtSignalReceiver-members.html @@ -0,0 +1,60 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtSignalReceiver Member List
+
+
+ +

This is the complete list of members for PythonQtSignalReceiver, including all inherited members.

+ + + + + + + +
addSignalHandler(const char *signal, PyObject *callable)PythonQtSignalReceiver
PythonQtSignalReceiver(QObject *obj)PythonQtSignalReceiver
PythonQtSignalReceiverBase(QObject *obj)PythonQtSignalReceiverBaseinline
qt_metacall(QMetaObject::Call c, int id, void **arguments) overridePythonQtSignalReceiver
removeSignalHandler(const char *signal, PyObject *callable=nullptr)PythonQtSignalReceiver
~PythonQtSignalReceiver() overridePythonQtSignalReceiver
+ + + + diff --git a/classPythonQtSignalReceiver.html b/classPythonQtSignalReceiver.html new file mode 100644 index 000000000..559c2fbf8 --- /dev/null +++ b/classPythonQtSignalReceiver.html @@ -0,0 +1,245 @@ + + + + + + + +PythonQt: PythonQtSignalReceiver Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtSignalReceiver Class Reference
+
+
+ +

receives all signals for one QObject + More...

+ +

#include <PythonQtSignalReceiver.h>

+
+Inheritance diagram for PythonQtSignalReceiver:
+
+
+ + +PythonQtSignalReceiverBase + +
+ + + + + + + + + + + + + + + + + + +

+Public Member Functions

 PythonQtSignalReceiver (QObject *obj)
 
 ~PythonQtSignalReceiver () override
 
bool addSignalHandler (const char *signal, PyObject *callable)
 add a signal handler
 
bool removeSignalHandler (const char *signal, PyObject *callable=nullptr)
 remove a signal handler for given callable (or all callables on that signal if callable is NULL)
 
int qt_metacall (QMetaObject::Call c, int id, void **arguments) override
 we implement this method to simulate a number of slots that match the ids in _targets
 
- Public Member Functions inherited from PythonQtSignalReceiverBase
 PythonQtSignalReceiverBase (QObject *obj)
 
+

Detailed Description

+

receives all signals for one QObject

+

we derive from our base but do not declare the QObject macro because we want to reimplement qt_metacall only.

+ +

Definition at line 116 of file PythonQtSignalReceiver.h.

+

Constructor & Destructor Documentation

+ +

◆ PythonQtSignalReceiver()

+ +
+
+ + + + + + + + +
PythonQtSignalReceiver::PythonQtSignalReceiver (QObject * obj)
+
+ +
+
+ +

◆ ~PythonQtSignalReceiver()

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtSignalReceiver::~PythonQtSignalReceiver ()
+
+override
+
+ +
+
+

Member Function Documentation

+ +

◆ addSignalHandler()

+ +
+
+ + + + + + + + + + + + + + + + + + +
bool PythonQtSignalReceiver::addSignalHandler (const charsignal,
PyObjectcallable 
)
+
+ +

add a signal handler

+ +
+
+ +

◆ qt_metacall()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
int PythonQtSignalReceiver::qt_metacall (QMetaObject::Call c,
int id,
void ** arguments 
)
+
+override
+
+ +

we implement this method to simulate a number of slots that match the ids in _targets

+ +
+
+ +

◆ removeSignalHandler()

+ +
+
+ + + + + + + + + + + + + + + + + + +
bool PythonQtSignalReceiver::removeSignalHandler (const charsignal,
PyObjectcallable = nullptr 
)
+
+ +

remove a signal handler for given callable (or all callables on that signal if callable is NULL)

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtSignalReceiver.png b/classPythonQtSignalReceiver.png new file mode 100644 index 000000000..bc574cd7a Binary files /dev/null and b/classPythonQtSignalReceiver.png differ diff --git a/classPythonQtSignalReceiverBase-members.html b/classPythonQtSignalReceiverBase-members.html new file mode 100644 index 000000000..3a8ad92f3 --- /dev/null +++ b/classPythonQtSignalReceiverBase-members.html @@ -0,0 +1,55 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtSignalReceiverBase Member List
+
+
+ +

This is the complete list of members for PythonQtSignalReceiverBase, including all inherited members.

+ + +
PythonQtSignalReceiverBase(QObject *obj)PythonQtSignalReceiverBaseinline
+ + + + diff --git a/classPythonQtSignalReceiverBase.html b/classPythonQtSignalReceiverBase.html new file mode 100644 index 000000000..46ad8d461 --- /dev/null +++ b/classPythonQtSignalReceiverBase.html @@ -0,0 +1,112 @@ + + + + + + + +PythonQt: PythonQtSignalReceiverBase Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtSignalReceiverBase Class Reference
+
+
+ +

base class for signal receivers + More...

+ +

#include <PythonQtSignalReceiver.h>

+
+Inheritance diagram for PythonQtSignalReceiverBase:
+
+
+ + +PythonQtSignalReceiver + +
+ + + + +

+Public Member Functions

 PythonQtSignalReceiverBase (QObject *obj)
 
+

Detailed Description

+

base class for signal receivers

+ +

Definition at line 105 of file PythonQtSignalReceiver.h.

+

Constructor & Destructor Documentation

+ +

◆ PythonQtSignalReceiverBase()

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtSignalReceiverBase::PythonQtSignalReceiverBase (QObject * obj)
+
+inline
+
+ +

Definition at line 109 of file PythonQtSignalReceiver.h.

+
110 : QObject(obj) {};
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
+
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtSignalReceiverBase.png b/classPythonQtSignalReceiverBase.png new file mode 100644 index 000000000..aa467605c Binary files /dev/null and b/classPythonQtSignalReceiverBase.png differ diff --git a/classPythonQtSignalTarget-members.html b/classPythonQtSignalTarget-members.html new file mode 100644 index 000000000..ac70fc59d --- /dev/null +++ b/classPythonQtSignalTarget-members.html @@ -0,0 +1,63 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtSignalTarget Member List
+
+
+ +

This is the complete list of members for PythonQtSignalTarget, including all inherited members.

+ + + + + + + + + + +
call(void **arguments) constPythonQtSignalTarget
call(PyObject *callable, const PythonQtMethodInfo *methodInfo, void **arguments, bool skipFirstArgumentOfMethodInfo=false)PythonQtSignalTargetstatic
isSame(int signalId, PyObject *callable) constPythonQtSignalTarget
methodInfo() constPythonQtSignalTargetinline
PythonQtSignalTarget()PythonQtSignalTargetinline
PythonQtSignalTarget(int signalId, const PythonQtMethodInfo *methodInfo, int slotId, PyObject *callable)PythonQtSignalTargetinline
signalId() constPythonQtSignalTargetinline
slotId() constPythonQtSignalTargetinline
~PythonQtSignalTarget()PythonQtSignalTargetinline
+ + + + diff --git a/classPythonQtSignalTarget.html b/classPythonQtSignalTarget.html new file mode 100644 index 000000000..e9a5cce80 --- /dev/null +++ b/classPythonQtSignalTarget.html @@ -0,0 +1,413 @@ + + + + + + + +PythonQt: PythonQtSignalTarget Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtSignalTarget Class Reference
+
+
+ +

stores information about a signal target + More...

+ +

#include <PythonQtSignalReceiver.h>

+ + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 PythonQtSignalTarget ()
 
 PythonQtSignalTarget (int signalId, const PythonQtMethodInfo *methodInfo, int slotId, PyObject *callable)
 
 ~PythonQtSignalTarget ()
 
int signalId () const
 get the id of the original signal
 
int slotId () const
 get the id that was assigned to this simulated slot
 
const PythonQtMethodInfomethodInfo () const
 get the signals parameter info
 
void call (void **arguments) const
 call the python callable with the given arguments (as defined in methodInfo)
 
bool isSame (int signalId, PyObject *callable) const
 check if it is the same signal target
 
+ + + + +

+Static Public Member Functions

static PyObjectcall (PyObject *callable, const PythonQtMethodInfo *methodInfo, void **arguments, bool skipFirstArgumentOfMethodInfo=false)
 call the given callable with arguments described by PythonQtMethodInfo, returns a new reference as result value (or NULL)
 
+

Detailed Description

+

stores information about a signal target

+

copy construction and assignment works fine with the C++ standard behavior and are thus not implemented

+ +

Definition at line 56 of file PythonQtSignalReceiver.h.

+

Constructor & Destructor Documentation

+ +

◆ PythonQtSignalTarget() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtSignalTarget::PythonQtSignalTarget ()
+
+inline
+
+ +

Definition at line 59 of file PythonQtSignalReceiver.h.

+
60 {
+
61 _signalId = -1;
+
62 _methodInfo = nullptr;
+
63 _slotId = -1;
+
64 }
+
+
+
+ +

◆ PythonQtSignalTarget() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PythonQtSignalTarget::PythonQtSignalTarget (int signalId,
const PythonQtMethodInfomethodInfo,
int slotId,
PyObjectcallable 
)
+
+inline
+
+ +

Definition at line 66 of file PythonQtSignalReceiver.h.

+
67 {
+
68 _signalId = signalId;
+
69 _slotId = slotId;
+
70 _methodInfo = methodInfo;
+
71 _callable = callable;
+
72 };
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
int slotId() const
get the id that was assigned to this simulated slot
+
const PythonQtMethodInfo * methodInfo() const
get the signals parameter info
+
int signalId() const
get the id of the original signal
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ ~PythonQtSignalTarget()

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtSignalTarget::~PythonQtSignalTarget ()
+
+inline
+
+ +

Definition at line 74 of file PythonQtSignalReceiver.h.

+
74{};
+
+
+
+

Member Function Documentation

+ +

◆ call() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static PyObject * PythonQtSignalTarget::call (PyObjectcallable,
const PythonQtMethodInfomethodInfo,
void ** arguments,
bool skipFirstArgumentOfMethodInfo = false 
)
+
+static
+
+ +

call the given callable with arguments described by PythonQtMethodInfo, returns a new reference as result value (or NULL)

+ +
+
+ +

◆ call() [2/2]

+ +
+
+ + + + + + + + +
void PythonQtSignalTarget::call (void ** arguments) const
+
+ +

call the python callable with the given arguments (as defined in methodInfo)

+ +
+
+ +

◆ isSame()

+ +
+
+ + + + + + + + + + + + + + + + + + +
bool PythonQtSignalTarget::isSame (int signalId,
PyObjectcallable 
) const
+
+ +

check if it is the same signal target

+ +
+
+ +

◆ methodInfo()

+ +
+
+ + + + + +
+ + + + + + + +
const PythonQtMethodInfo * PythonQtSignalTarget::methodInfo () const
+
+inline
+
+ +

get the signals parameter info

+ +

Definition at line 83 of file PythonQtSignalReceiver.h.

+
83{ return _methodInfo; }
+
+
+
+ +

◆ signalId()

+ +
+
+ + + + + +
+ + + + + + + +
int PythonQtSignalTarget::signalId () const
+
+inline
+
+ +

get the id of the original signal

+ +

Definition at line 77 of file PythonQtSignalReceiver.h.

+
77{ return _signalId; }
+
+
+
+ +

◆ slotId()

+ +
+
+ + + + + +
+ + + + + + + +
int PythonQtSignalTarget::slotId () const
+
+inline
+
+ +

get the id that was assigned to this simulated slot

+ +

Definition at line 80 of file PythonQtSignalReceiver.h.

+
80{ return _slotId; }
+
+
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtSingleShotTimer-members.html b/classPythonQtSingleShotTimer-members.html new file mode 100644 index 000000000..2f9f51335 --- /dev/null +++ b/classPythonQtSingleShotTimer-members.html @@ -0,0 +1,57 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtSingleShotTimer Member List
+
+
+ +

This is the complete list of members for PythonQtSingleShotTimer, including all inherited members.

+ + + + +
PythonQtSingleShotTimer(int msec, const PythonQtObjectPtr &callable)PythonQtSingleShotTimer
slotTimeout()PythonQtSingleShotTimerslot
~PythonQtSingleShotTimer() overridePythonQtSingleShotTimer
+ + + + diff --git a/classPythonQtSingleShotTimer.html b/classPythonQtSingleShotTimer.html new file mode 100644 index 000000000..fd6775ea2 --- /dev/null +++ b/classPythonQtSingleShotTimer.html @@ -0,0 +1,162 @@ + + + + + + + +PythonQt: PythonQtSingleShotTimer Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtSingleShotTimer Class Reference
+
+
+ +

#include <PythonQtStdDecorators.h>

+
+Inheritance diagram for PythonQtSingleShotTimer:
+
+
+ +
+ + + + +

+Public Slots

void slotTimeout ()
 
+ + + + + +

+Public Member Functions

 PythonQtSingleShotTimer (int msec, const PythonQtObjectPtr &callable)
 
 ~PythonQtSingleShotTimer () override
 
+

Detailed Description

+
+

Definition at line 161 of file PythonQtStdDecorators.h.

+

Constructor & Destructor Documentation

+ +

◆ PythonQtSingleShotTimer()

+ +
+
+ + + + + + + + + + + + + + + + + + +
PythonQtSingleShotTimer::PythonQtSingleShotTimer (int msec,
const PythonQtObjectPtrcallable 
)
+
+ +
+
+ +

◆ ~PythonQtSingleShotTimer()

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtSingleShotTimer::~PythonQtSingleShotTimer ()
+
+override
+
+ +
+
+

Member Function Documentation

+ +

◆ slotTimeout

+ +
+
+ + + + + +
+ + + + + + + +
void PythonQtSingleShotTimer::slotTimeout ()
+
+slot
+
+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtSingleShotTimer.png b/classPythonQtSingleShotTimer.png new file mode 100644 index 000000000..c9f1be609 Binary files /dev/null and b/classPythonQtSingleShotTimer.png differ diff --git a/classPythonQtSlotInfo-members.html b/classPythonQtSlotInfo-members.html new file mode 100644 index 000000000..6e7de2dfb --- /dev/null +++ b/classPythonQtSlotInfo-members.html @@ -0,0 +1,107 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtSlotInfo Member List
+
+
+ +

This is the complete list of members for PythonQtSlotInfo, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
_cachedParameterInfosPythonQtMethodInfoprotectedstatic
_cachedSignaturesPythonQtMethodInfoprotectedstatic
_parameterNameAliasesPythonQtMethodInfoprotectedstatic
_parametersPythonQtMethodInfoprotected
_parameterTypeDictPythonQtMethodInfoprotectedstatic
_shouldAllowThreadsPythonQtMethodInfoprotected
addParameterTypeAlias(const QByteArray &alias, const QByteArray &name)PythonQtMethodInfostatic
arguments() constPythonQtSlotInfo
ClassDecorator enum valuePythonQtSlotInfo
cleanupCachedMethodInfos()PythonQtMethodInfostatic
decorator() constPythonQtSlotInfoinline
deleteOverloadsAndThis()PythonQtSlotInfo
fillParameterInfo(ParameterInfo &type, const QByteArray &name, PythonQtClassInfo *classInfo=nullptr)PythonQtMethodInfostatic
fullSignature(bool skipReturnValue=false, int optionalArgsIndex=-1) constPythonQtSlotInfo
getCachedMethodInfo(const QMetaMethod &method, PythonQtClassInfo *classInfo)PythonQtMethodInfostatic
getCachedMethodInfoFromArgumentList(int numArgs, const char **args)PythonQtMethodInfostatic
getGlobalShouldAllowThreads()PythonQtSlotInfostatic
getImplementingClassName() constPythonQtSlotInfo
getInnerListTypeName(const QByteArray &typeName)PythonQtMethodInfostatic
getInnerTemplateMetaType(const QByteArray &typeName)PythonQtMethodInfostatic
getInnerTemplateTypeName(const QByteArray &typeName)PythonQtMethodInfostatic
getParameterInfoForMetaType(int type)PythonQtMethodInfostatic
InstanceDecorator enum valuePythonQtSlotInfo
invokeQtMethod(QObject *obj, PythonQtSlotInfo *slot, void **argList)PythonQtSlotInfostatic
isClassDecorator() constPythonQtSlotInfoinline
isInstanceDecorator() constPythonQtSlotInfoinline
MemberSlot enum valuePythonQtSlotInfo
metaMethod() constPythonQtSlotInfoinline
nameToType(const char *name)PythonQtMethodInfostatic
nextInfo() constPythonQtSlotInfoinline
overloads(bool skipReturnValue=false) constPythonQtSlotInfo
parameterCount() constPythonQtMethodInfoinline
parameters() constPythonQtMethodInfoinline
ParameterType enum namePythonQtMethodInfo
PythonQtMethodInfo()PythonQtMethodInfoinline
PythonQtMethodInfo(const QMetaMethod &meta, PythonQtClassInfo *classInfo)PythonQtMethodInfo
PythonQtMethodInfo(const QByteArray &typeName, const QList< QByteArray > &args)PythonQtMethodInfo
PythonQtMethodInfo(const PythonQtMethodInfo &other)PythonQtMethodInfoinline
PythonQtSlotInfo(const PythonQtSlotInfo &info)PythonQtSlotInfoinline
PythonQtSlotInfo(PythonQtClassInfo *classInfo, const QMetaMethod &meta, int slotIndex, QObject *decorator=nullptr, Type type=MemberSlot)PythonQtSlotInfoinline
setGlobalShouldAllowThreads(bool flag)PythonQtSlotInfostatic
setNextInfo(PythonQtSlotInfo *next)PythonQtSlotInfoinline
setupAllowThreads()PythonQtMethodInfoprotected
setUpcastingOffset(int upcastingOffset)PythonQtSlotInfoinline
shouldAllowThreads() constPythonQtMethodInfoinline
signature() constPythonQtSlotInfo
slotIndex() constPythonQtSlotInfoinline
slotName(bool removeDecorators=false) constPythonQtSlotInfo
Type enum namePythonQtSlotInfo
Unknown enum valuePythonQtMethodInfo
upcastingOffset() constPythonQtSlotInfoinline
Variant enum valuePythonQtMethodInfo
~PythonQtMethodInfo()PythonQtMethodInfoinline
+ + + + diff --git a/classPythonQtSlotInfo.html b/classPythonQtSlotInfo.html new file mode 100644 index 000000000..2dfe7c0bf --- /dev/null +++ b/classPythonQtSlotInfo.html @@ -0,0 +1,876 @@ + + + + + + + +PythonQt: PythonQtSlotInfo Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+ +
+ +

stores information about a slot, including a next pointer to overloaded slots + More...

+ +

#include <PythonQtMethodInfo.h>

+
+Inheritance diagram for PythonQtSlotInfo:
+
+
+ + +PythonQtMethodInfo + +
+ + + + + + + +

+Public Types

enum  Type { MemberSlot +, InstanceDecorator +, ClassDecorator + }
 
- Public Types inherited from PythonQtMethodInfo
enum  ParameterType { Unknown = -1 +, Variant = -2 + }
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 PythonQtSlotInfo (const PythonQtSlotInfo &info)
 
 PythonQtSlotInfo (PythonQtClassInfo *classInfo, const QMetaMethod &meta, int slotIndex, QObject *decorator=nullptr, Type type=MemberSlot)
 
QList< ParameterInfoarguments () const
 get the parameter infos for the arguments, without return type and instance decorator.
 
void deleteOverloadsAndThis ()
 
const QMetaMethodmetaMethod () const
 
void setUpcastingOffset (int upcastingOffset)
 
int upcastingOffset () const
 
int slotIndex () const
 get the index of the slot (needed for qt_metacall)
 
PythonQtSlotInfonextInfo () const
 get next overloaded slot (which has the same name)
 
void setNextInfo (PythonQtSlotInfo *next)
 set the next overloaded slot
 
bool isInstanceDecorator () const
 returns if the slot is a decorator slot
 
bool isClassDecorator () const
 returns if the slot is a constructor slot
 
QObject * decorator () const
 
QString fullSignature (bool skipReturnValue=false, int optionalArgsIndex=-1) const
 get the full signature including return type
 
QByteArray signature () const
 get the Qt signature of the slot
 
QByteArray slotName (bool removeDecorators=false) const
 get the short slot name
 
QStringList overloads (bool skipReturnValue=false) const
 
QByteArray getImplementingClassName () const
 
- Public Member Functions inherited from PythonQtMethodInfo
 PythonQtMethodInfo ()
 
 ~PythonQtMethodInfo ()
 
 PythonQtMethodInfo (const QMetaMethod &meta, PythonQtClassInfo *classInfo)
 
 PythonQtMethodInfo (const QByteArray &typeName, const QList< QByteArray > &args)
 
 PythonQtMethodInfo (const PythonQtMethodInfo &other)
 
int parameterCount () const
 returns the number of parameters including the return value
 
const QList< ParameterInfo > & parameters () const
 get the parameter infos
 
bool shouldAllowThreads () const
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Static Public Member Functions

static void invokeQtMethod (QObject *obj, PythonQtSlotInfo *slot, void **argList)
 Invoke the given slot on obj, save/restore thread state if needed.
 
static void setGlobalShouldAllowThreads (bool flag)
 Sets if calling slots should release the GIL to allow other Python threads while being inside of C++.
 
static bool getGlobalShouldAllowThreads ()
 Returns if calling slots should release the GIL to allow Python threads while being inside of C++.
 
- Static Public Member Functions inherited from PythonQtMethodInfo
static const PythonQtMethodInfogetCachedMethodInfo (const QMetaMethod &method, PythonQtClassInfo *classInfo)
 
static const PythonQtMethodInfogetCachedMethodInfoFromArgumentList (int numArgs, const char **args)
 get the cached method info using the passed in list of return value and arguments, return value needs to be passed as first arg
 
static void cleanupCachedMethodInfos ()
 cleanup the cache
 
static int nameToType (const char *name)
 returns the id for the given type (using an internal dictionary)
 
static void addParameterTypeAlias (const QByteArray &alias, const QByteArray &name)
 add an alias for a typename, e.g. QObjectList and QList<QObject*>.
 
static void fillParameterInfo (ParameterInfo &type, const QByteArray &name, PythonQtClassInfo *classInfo=nullptr)
 fill the parameter info for the given type name
 
static const ParameterInfogetParameterInfoForMetaType (int type)
 returns a parameter info for the given metatype (and creates and caches one if it is not yet present)
 
static int getInnerTemplateMetaType (const QByteArray &typeName)
 returns the inner type id of a simple template of the form SomeObject<InnerType>
 
static QByteArray getInnerTemplateTypeName (const QByteArray &typeName)
 returns the inner type name of a simple template of the form SomeObject<InnerType>
 
static QByteArray getInnerListTypeName (const QByteArray &typeName)
 returns the inner type name of a simple template or the typename without appended "List".
 
+ + + + + + + + + + + + + + + + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from PythonQtMethodInfo
void setupAllowThreads ()
 
- Protected Attributes inherited from PythonQtMethodInfo
QList< ParameterInfo_parameters
 
bool _shouldAllowThreads
 
- Static Protected Attributes inherited from PythonQtMethodInfo
static QHash< QByteArray, int_parameterTypeDict
 
static QHash< QByteArray, QByteArray_parameterNameAliases
 
static QHash< QByteArray, PythonQtMethodInfo * > _cachedSignatures
 stores the cached signatures of methods to speedup mapping from Qt to Python types
 
static QHash< int, ParameterInfo_cachedParameterInfos
 
+

Detailed Description

+

stores information about a slot, including a next pointer to overloaded slots

+ +

Definition at line 147 of file PythonQtMethodInfo.h.

+

Member Enumeration Documentation

+ +

◆ Type

+ +
+
+ + + + +
Enumerator
MemberSlot 
InstanceDecorator 
ClassDecorator 
+ +

Definition at line 150 of file PythonQtMethodInfo.h.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ PythonQtSlotInfo() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
PythonQtSlotInfo::PythonQtSlotInfo (const PythonQtSlotInfoinfo)
+
+inline
+
+ +

Definition at line 152 of file PythonQtMethodInfo.h.

+
+
154 {
+
155 _meta = info._meta;
+
156 _parameters = info._parameters;
+
157 _shouldAllowThreads = info._shouldAllowThreads;
+
158 _slotIndex = info._slotIndex;
+
159 _next = nullptr;
+
160 _decorator = info._decorator;
+
161 _type = info._type;
+
162 _upcastingOffset = 0;
+
163 }
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+ +
QList< ParameterInfo > _parameters
+ +
+

References PythonQtMethodInfo::_parameters, and PythonQtConvertPairToPython().

+ +
+
+ +

◆ PythonQtSlotInfo() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PythonQtSlotInfo::PythonQtSlotInfo (PythonQtClassInfoclassInfo,
const QMetaMethodmeta,
int slotIndex,
QObject * decorator = nullptr,
Type type = MemberSlot 
)
+
+inline
+
+ +

Definition at line 165 of file PythonQtMethodInfo.h.

+
+
168 {
+
169 const PythonQtMethodInfo* info = getCachedMethodInfo(meta, classInfo);
+
170 _meta = meta;
+
171 _parameters = info->parameters();
+
172 _shouldAllowThreads = info->shouldAllowThreads();
+
173 _slotIndex = slotIndex;
+
174 _next = nullptr;
+
175 _decorator = decorator;
+
176 _type = type;
+
177 _upcastingOffset = 0;
+
178 }
+
stores information about a specific signal/slot/method
+
static const PythonQtMethodInfo * getCachedMethodInfo(const QMetaMethod &method, PythonQtClassInfo *classInfo)
+
int slotIndex() const
get the index of the slot (needed for qt_metacall)
+
QObject * decorator() const
+
+

References PythonQtConvertPairToPython().

+ +
+
+

Member Function Documentation

+ +

◆ arguments()

+ +
+
+ + + + + + + +
QList< ParameterInfo > PythonQtSlotInfo::arguments () const
+
+ +

get the parameter infos for the arguments, without return type and instance decorator.

+ +
+
+ +

◆ decorator()

+ +
+
+ + + + + +
+ + + + + + + +
QObject * PythonQtSlotInfo::decorator () const
+
+inline
+
+ +

Definition at line 207 of file PythonQtMethodInfo.h.

+
207{ return _decorator; }
+
+
+
+ +

◆ deleteOverloadsAndThis()

+ +
+
+ + + + + + + +
void PythonQtSlotInfo::deleteOverloadsAndThis ()
+
+ +
+
+ +

◆ fullSignature()

+ +
+
+ + + + + + + + + + + + + + + + + + +
QString PythonQtSlotInfo::fullSignature (bool skipReturnValue = false,
int optionalArgsIndex = -1 
) const
+
+ +

get the full signature including return type

+ +
+
+ +

◆ getGlobalShouldAllowThreads()

+ +
+
+ + + + + +
+ + + + + + + +
static bool PythonQtSlotInfo::getGlobalShouldAllowThreads ()
+
+static
+
+ +

Returns if calling slots should release the GIL to allow Python threads while being inside of C++.

+ +
+
+ +

◆ getImplementingClassName()

+ +
+
+ + + + + + + +
QByteArray PythonQtSlotInfo::getImplementingClassName () const
+
+

Returns the class name that originally implements this method, regardless where the wrapper is located/implemented.

+ +
+
+ +

◆ invokeQtMethod()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
static void PythonQtSlotInfo::invokeQtMethod (QObject * obj,
PythonQtSlotInfoslot,
void ** argList 
)
+
+static
+
+ +

Invoke the given slot on obj, save/restore thread state if needed.

+ +
+
+ +

◆ isClassDecorator()

+ +
+
+ + + + + +
+ + + + + + + +
bool PythonQtSlotInfo::isClassDecorator () const
+
+inline
+
+ +

returns if the slot is a constructor slot

+ +

Definition at line 205 of file PythonQtMethodInfo.h.

+
205{ return _decorator != nullptr && _type == ClassDecorator; }
+
+
+
+ +

◆ isInstanceDecorator()

+ +
+
+ + + + + +
+ + + + + + + +
bool PythonQtSlotInfo::isInstanceDecorator () const
+
+inline
+
+ +

returns if the slot is a decorator slot

+ +

Definition at line 202 of file PythonQtMethodInfo.h.

+
202{ return _decorator != nullptr && _type == InstanceDecorator; }
+
+
+
+ +

◆ metaMethod()

+ +
+
+ + + + + +
+ + + + + + + +
const QMetaMethod * PythonQtSlotInfo::metaMethod () const
+
+inline
+
+ +

Definition at line 186 of file PythonQtMethodInfo.h.

+
186{ return &_meta; }
+
+
+
+ +

◆ nextInfo()

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtSlotInfo * PythonQtSlotInfo::nextInfo () const
+
+inline
+
+ +

get next overloaded slot (which has the same name)

+ +

Definition at line 196 of file PythonQtMethodInfo.h.

+
196{ return _next; }
+
+
+
+ +

◆ overloads()

+ +
+
+ + + + + + + + +
QStringList PythonQtSlotInfo::overloads (bool skipReturnValue = false) const
+
+

gets a list of all overload signatures. Signatures which only differ because of default values are joined using "[]" to indicate the optional arguments.

+ +
+
+ +

◆ setGlobalShouldAllowThreads()

+ +
+
+ + + + + +
+ + + + + + + + +
static void PythonQtSlotInfo::setGlobalShouldAllowThreads (bool flag)
+
+static
+
+ +

Sets if calling slots should release the GIL to allow other Python threads while being inside of C++.

+ +
+
+ +

◆ setNextInfo()

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQtSlotInfo::setNextInfo (PythonQtSlotInfonext)
+
+inline
+
+ +

set the next overloaded slot

+ +

Definition at line 199 of file PythonQtMethodInfo.h.

+
199{ _next = next; }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ setUpcastingOffset()

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQtSlotInfo::setUpcastingOffset (int upcastingOffset)
+
+inline
+
+ +

Definition at line 188 of file PythonQtMethodInfo.h.

+
188{ _upcastingOffset = upcastingOffset; }
+
int upcastingOffset() const
+
+
+
+ +

◆ signature()

+ +
+
+ + + + + + + +
QByteArray PythonQtSlotInfo::signature () const
+
+ +

get the Qt signature of the slot

+ +
+
+ +

◆ slotIndex()

+ +
+
+ + + + + +
+ + + + + + + +
int PythonQtSlotInfo::slotIndex () const
+
+inline
+
+ +

get the index of the slot (needed for qt_metacall)

+ +

Definition at line 193 of file PythonQtMethodInfo.h.

+
193{ return _slotIndex; }
+
+
+
+ +

◆ slotName()

+ +
+
+ + + + + + + + +
QByteArray PythonQtSlotInfo::slotName (bool removeDecorators = false) const
+
+ +

get the short slot name

+ +
+
+ +

◆ upcastingOffset()

+ +
+
+ + + + + +
+ + + + + + + +
int PythonQtSlotInfo::upcastingOffset () const
+
+inline
+
+ +

Definition at line 190 of file PythonQtMethodInfo.h.

+
190{ return _upcastingOffset; }
+
+
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtSlotInfo.png b/classPythonQtSlotInfo.png new file mode 100644 index 000000000..72b3553bd Binary files /dev/null and b/classPythonQtSlotInfo.png differ diff --git a/classPythonQtStdDecorators-members.html b/classPythonQtStdDecorators-members.html new file mode 100644 index 000000000..b2e423704 --- /dev/null +++ b/classPythonQtStdDecorators-members.html @@ -0,0 +1,90 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtStdDecorators Member List
+
+
+ +

This is the complete list of members for PythonQtStdDecorators, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
children(QObject *o)PythonQtStdDecoratorsslot
connect(QObject *sender, const QByteArray &signal, PyObject *callable)PythonQtStdDecoratorsslot
connect(QObject *sender, const QByteArray &signal, QObject *receiver, const QByteArray &slot, Qt::ConnectionType type=Qt::AutoConnection)PythonQtStdDecoratorsslot
connect(QObject *receiver, QObject *sender, const QByteArray &signal, const QByteArray &slot, Qt::ConnectionType type=Qt::AutoConnection)PythonQtStdDecoratorsinlineslot
disconnect(QObject *sender, const QByteArray &signal, PyObject *callable=nullptr)PythonQtStdDecoratorsslot
disconnect(QObject *sender, const QByteArray &signal, QObject *receiver, const QByteArray &slot)PythonQtStdDecoratorsslot
findChild(QObject *parent, PyObject *type, const QString &name=QString())PythonQtStdDecoratorsslot
findChildren(QObject *parent, PyObject *type, const QString &name=QString())PythonQtStdDecoratorsslot
findChildren(QObject *parent, PyObject *type, const QRegularExpression &regExp)PythonQtStdDecoratorsslot
metaObject(QObject *obj)PythonQtStdDecoratorsslot
parent(QObject *o)PythonQtStdDecoratorsslot
property(QObject *o, const char *name)PythonQtStdDecoratorsslot
setParent(QObject *o, PythonQtNewOwnerOfThis< QObject * > parent)PythonQtStdDecoratorsslot
setProperty(QObject *o, const char *name, const QVariant &value)PythonQtStdDecoratorsslot
static_QObject_connect(QObject *sender, const QByteArray &signal, PyObject *callable)PythonQtStdDecoratorsinlineslot
static_QObject_connect(QObject *sender, const QByteArray &signal, QObject *receiver, const QByteArray &slot, Qt::ConnectionType type=Qt::AutoConnection)PythonQtStdDecoratorsinlineslot
static_QObject_disconnect(QObject *sender, const QByteArray &signal, PyObject *callable=nullptr)PythonQtStdDecoratorsinlineslot
static_QObject_disconnect(QObject *sender, const QByteArray &signal, QObject *receiver, const QByteArray &slot)PythonQtStdDecoratorsinlineslot
static_Qt_qAbs(double a)PythonQtStdDecoratorsinlineslot
static_Qt_qBound(double a, double b, double c)PythonQtStdDecoratorsinlineslot
static_Qt_qCritical(const QByteArray &msg)PythonQtStdDecoratorsinlineslot
static_Qt_qDebug(const QByteArray &msg)PythonQtStdDecoratorsinlineslot
static_Qt_qFatal(const QByteArray &msg)PythonQtStdDecoratorsinlineslot
static_Qt_qFuzzyCompare(double a, double b)PythonQtStdDecoratorsinlineslot
static_Qt_qMax(double a, double b)PythonQtStdDecoratorsinlineslot
static_Qt_qMin(double a, double b)PythonQtStdDecoratorsinlineslot
static_Qt_qrand()PythonQtStdDecoratorsinlineslot
static_Qt_qRound(double a)PythonQtStdDecoratorsinlineslot
static_Qt_qRound64(double a)PythonQtStdDecoratorsinlineslot
static_Qt_qsrand(uint a)PythonQtStdDecoratorsinlineslot
static_Qt_qVersion()PythonQtStdDecoratorsinlineslot
static_Qt_qWarning(const QByteArray &msg)PythonQtStdDecoratorsinlineslot
static_Qt_SIGNAL(const QString &s)PythonQtStdDecoratorsinlineslot
static_Qt_SLOT(const QString &s)PythonQtStdDecoratorsinlineslot
static_QTimer_singleShot(int msec, PyObject *callable)PythonQtStdDecoratorsslot
tr(QObject *obj, const QString &text, const QString &ambig=QString(), int n=-1)PythonQtStdDecoratorsslot
+ + + + diff --git a/classPythonQtStdDecorators.html b/classPythonQtStdDecorators.html new file mode 100644 index 000000000..cc4c3de13 --- /dev/null +++ b/classPythonQtStdDecorators.html @@ -0,0 +1,1563 @@ + + + + + + + +PythonQt: PythonQtStdDecorators Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtStdDecorators Class Reference
+
+
+ +

#include <PythonQtStdDecorators.h>

+
+Inheritance diagram for PythonQtStdDecorators:
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Slots

bool connect (QObject *sender, const QByteArray &signal, PyObject *callable)
 
bool connect (QObject *sender, const QByteArray &signal, QObject *receiver, const QByteArray &slot, Qt::ConnectionType type=Qt::AutoConnection)
 
bool connect (QObject *receiver, QObject *sender, const QByteArray &signal, const QByteArray &slot, Qt::ConnectionType type=Qt::AutoConnection)
 
bool static_QObject_connect (QObject *sender, const QByteArray &signal, PyObject *callable)
 
bool static_QObject_connect (QObject *sender, const QByteArray &signal, QObject *receiver, const QByteArray &slot, Qt::ConnectionType type=Qt::AutoConnection)
 
bool disconnect (QObject *sender, const QByteArray &signal, PyObject *callable=nullptr)
 
bool disconnect (QObject *sender, const QByteArray &signal, QObject *receiver, const QByteArray &slot)
 
bool static_QObject_disconnect (QObject *sender, const QByteArray &signal, PyObject *callable=nullptr)
 
bool static_QObject_disconnect (QObject *sender, const QByteArray &signal, QObject *receiver, const QByteArray &slot)
 
const QMetaObjectmetaObject (QObject *obj)
 
QObject * parent (QObject *o)
 
void setParent (QObject *o, PythonQtNewOwnerOfThis< QObject * > parent)
 
const QObjectListchildren (QObject *o)
 
QObject * findChild (QObject *parent, PyObject *type, const QString &name=QString())
 
QList< QObject * > findChildren (QObject *parent, PyObject *type, const QString &name=QString())
 
QList< QObject * > findChildren (QObject *parent, PyObject *type, const QRegularExpression &regExp)
 
bool setProperty (QObject *o, const char *name, const QVariant &value)
 
QVariant property (QObject *o, const char *name)
 
double static_Qt_qAbs (double a)
 
double static_Qt_qBound (double a, double b, double c)
 
void static_Qt_qDebug (const QByteArray &msg)
 
void static_Qt_qWarning (const QByteArray &msg)
 
void static_Qt_qCritical (const QByteArray &msg)
 
void static_Qt_qFatal (const QByteArray &msg)
 
bool static_Qt_qFuzzyCompare (double a, double b)
 
double static_Qt_qMax (double a, double b)
 
double static_Qt_qMin (double a, double b)
 
int static_Qt_qRound (double a)
 
qint64 static_Qt_qRound64 (double a)
 
const charstatic_Qt_qVersion ()
 
int static_Qt_qrand ()
 
void static_Qt_qsrand (uint a)
 
QString tr (QObject *obj, const QString &text, const QString &ambig=QString(), int n=-1)
 
QString static_Qt_SIGNAL (const QString &s)
 
QString static_Qt_SLOT (const QString &s)
 
void static_QTimer_singleShot (int msec, PyObject *callable)
 
+

Detailed Description

+
+

Definition at line 65 of file PythonQtStdDecorators.h.

+

Member Function Documentation

+ +

◆ children

+ +
+
+ + + + + +
+ + + + + + + + +
const QObjectList * PythonQtStdDecorators::children (QObject * o)
+
+slot
+
+ +
+
+ +

◆ connect [1/3]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQtStdDecorators::connect (QObject * receiver,
QObject * sender,
const QByteArraysignal,
const QByteArrayslot,
Qt::ConnectionType type = Qt::AutoConnection 
)
+
+inlineslot
+
+ +

Definition at line 73 of file PythonQtStdDecorators.h.

+
75 {
+
76 return connect(sender, signal, receiver, slot, type);
+
77 }
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
bool connect(QObject *sender, const QByteArray &signal, PyObject *callable)
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ connect [2/3]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQtStdDecorators::connect (QObject * sender,
const QByteArraysignal,
PyObjectcallable 
)
+
+slot
+
+ +
+
+ +

◆ connect [3/3]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQtStdDecorators::connect (QObject * sender,
const QByteArraysignal,
QObject * receiver,
const QByteArrayslot,
Qt::ConnectionType type = Qt::AutoConnection 
)
+
+slot
+
+ +
+
+ +

◆ disconnect [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQtStdDecorators::disconnect (QObject * sender,
const QByteArraysignal,
PyObjectcallable = nullptr 
)
+
+slot
+
+ +
+
+ +

◆ disconnect [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQtStdDecorators::disconnect (QObject * sender,
const QByteArraysignal,
QObject * receiver,
const QByteArrayslot 
)
+
+slot
+
+ +
+
+ +

◆ findChild

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
QObject * PythonQtStdDecorators::findChild (QObject * parent,
PyObjecttype,
const QStringname = QString() 
)
+
+slot
+
+ +
+
+ +

◆ findChildren [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
QList< QObject * > PythonQtStdDecorators::findChildren (QObject * parent,
PyObjecttype,
const QRegularExpressionregExp 
)
+
+slot
+
+ +
+
+ +

◆ findChildren [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
QList< QObject * > PythonQtStdDecorators::findChildren (QObject * parent,
PyObjecttype,
const QStringname = QString() 
)
+
+slot
+
+ +
+
+ +

◆ metaObject

+ +
+
+ + + + + +
+ + + + + + + + +
const QMetaObject * PythonQtStdDecorators::metaObject (QObject * obj)
+
+slot
+
+ +
+
+ +

◆ parent

+ +
+
+ + + + + +
+ + + + + + + + +
QObject * PythonQtStdDecorators::parent (QObject * o)
+
+slot
+
+ +
+
+ +

◆ property

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
QVariant PythonQtStdDecorators::property (QObject * o,
const charname 
)
+
+slot
+
+ +
+
+ +

◆ setParent

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void PythonQtStdDecorators::setParent (QObject * o,
PythonQtNewOwnerOfThis< QObject * > parent 
)
+
+slot
+
+ +
+
+ +

◆ setProperty

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQtStdDecorators::setProperty (QObject * o,
const charname,
const QVariantvalue 
)
+
+slot
+
+ +
+
+ +

◆ static_QObject_connect [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQtStdDecorators::static_QObject_connect (QObject * sender,
const QByteArraysignal,
PyObjectcallable 
)
+
+inlineslot
+
+ +

Definition at line 78 of file PythonQtStdDecorators.h.

+
79 {
+
80 return connect(sender, signal, callable);
+
81 }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_QObject_connect [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQtStdDecorators::static_QObject_connect (QObject * sender,
const QByteArraysignal,
QObject * receiver,
const QByteArrayslot,
Qt::ConnectionType type = Qt::AutoConnection 
)
+
+inlineslot
+
+ +

Definition at line 82 of file PythonQtStdDecorators.h.

+
84 {
+
85 return connect(sender, signal, receiver, slot, type);
+
86 }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_QObject_disconnect [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQtStdDecorators::static_QObject_disconnect (QObject * sender,
const QByteArraysignal,
PyObjectcallable = nullptr 
)
+
+inlineslot
+
+ +

Definition at line 89 of file PythonQtStdDecorators.h.

+
90 {
+ +
92 }
+
bool disconnect(QObject *sender, const QByteArray &signal, PyObject *callable=nullptr)
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_QObject_disconnect [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool PythonQtStdDecorators::static_QObject_disconnect (QObject * sender,
const QByteArraysignal,
QObject * receiver,
const QByteArrayslot 
)
+
+inlineslot
+
+ +

Definition at line 93 of file PythonQtStdDecorators.h.

+
94 {
+ +
96 }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_Qt_qAbs

+ +
+
+ + + + + +
+ + + + + + + + +
double PythonQtStdDecorators::static_Qt_qAbs (double a)
+
+inlineslot
+
+ +

Definition at line 111 of file PythonQtStdDecorators.h.

+
111{ return qAbs(a); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_Qt_qBound

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
double PythonQtStdDecorators::static_Qt_qBound (double a,
double b,
double c 
)
+
+inlineslot
+
+ +

Definition at line 112 of file PythonQtStdDecorators.h.

+
112{ return qBound(a, b, c); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_Qt_qCritical

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQtStdDecorators::static_Qt_qCritical (const QByteArraymsg)
+
+inlineslot
+
+ +

Definition at line 117 of file PythonQtStdDecorators.h.

+
117{ qCritical("%s", msg.constData()); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_Qt_qDebug

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQtStdDecorators::static_Qt_qDebug (const QByteArraymsg)
+
+inlineslot
+
+ +

Definition at line 113 of file PythonQtStdDecorators.h.

+
113{ qDebug("%s", msg.constData()); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_Qt_qFatal

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQtStdDecorators::static_Qt_qFatal (const QByteArraymsg)
+
+inlineslot
+
+ +

Definition at line 119 of file PythonQtStdDecorators.h.

+
119{ qFatal("%s", msg.constData()); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_Qt_qFuzzyCompare

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool PythonQtStdDecorators::static_Qt_qFuzzyCompare (double a,
double b 
)
+
+inlineslot
+
+ +

Definition at line 121 of file PythonQtStdDecorators.h.

+
121{ return qFuzzyCompare(a, b); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_Qt_qMax

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
double PythonQtStdDecorators::static_Qt_qMax (double a,
double b 
)
+
+inlineslot
+
+ +

Definition at line 122 of file PythonQtStdDecorators.h.

+
122{ return qMax(a, b); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_Qt_qMin

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
double PythonQtStdDecorators::static_Qt_qMin (double a,
double b 
)
+
+inlineslot
+
+ +

Definition at line 123 of file PythonQtStdDecorators.h.

+
123{ return qMin(a, b); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_Qt_qrand

+ +
+
+ + + + + +
+ + + + + + + +
int PythonQtStdDecorators::static_Qt_qrand ()
+
+inlineslot
+
+ +

Definition at line 128 of file PythonQtStdDecorators.h.

+
129 {
+
130#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
+
131 return qrand();
+
132#else
+
133 return QRandomGenerator::global()->generate();
+
134#endif
+
135 }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_Qt_qRound

+ +
+
+ + + + + +
+ + + + + + + + +
int PythonQtStdDecorators::static_Qt_qRound (double a)
+
+inlineslot
+
+ +

Definition at line 124 of file PythonQtStdDecorators.h.

+
124{ return qRound(a); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_Qt_qRound64

+ +
+
+ + + + + +
+ + + + + + + + +
qint64 PythonQtStdDecorators::static_Qt_qRound64 (double a)
+
+inlineslot
+
+ +

Definition at line 125 of file PythonQtStdDecorators.h.

+
125{ return qRound64(a); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_Qt_qsrand

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQtStdDecorators::static_Qt_qsrand (uint a)
+
+inlineslot
+
+ +

Definition at line 137 of file PythonQtStdDecorators.h.

+
138 {
+
139#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
+
140 qsrand(a);
+
141#else
+
142 QRandomGenerator::global()->seed(a);
+
143#endif
+
144 }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_Qt_qVersion

+ +
+
+ + + + + +
+ + + + + + + +
const char * PythonQtStdDecorators::static_Qt_qVersion ()
+
+inlineslot
+
+ +

Definition at line 126 of file PythonQtStdDecorators.h.

+
126{ return qVersion(); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_Qt_qWarning

+ +
+
+ + + + + +
+ + + + + + + + +
void PythonQtStdDecorators::static_Qt_qWarning (const QByteArraymsg)
+
+inlineslot
+
+ +

Definition at line 115 of file PythonQtStdDecorators.h.

+
115{ qWarning("%s", msg.constData()); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_Qt_SIGNAL

+ +
+
+ + + + + +
+ + + + + + + + +
QString PythonQtStdDecorators::static_Qt_SIGNAL (const QStrings)
+
+inlineslot
+
+ +

Definition at line 148 of file PythonQtStdDecorators.h.

+
148{ return QString("2") + s; }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_Qt_SLOT

+ +
+
+ + + + + +
+ + + + + + + + +
QString PythonQtStdDecorators::static_Qt_SLOT (const QStrings)
+
+inlineslot
+
+ +

Definition at line 149 of file PythonQtStdDecorators.h.

+
149{ return QString("1") + s; }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_QTimer_singleShot

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void PythonQtStdDecorators::static_QTimer_singleShot (int msec,
PyObjectcallable 
)
+
+slot
+
+ +
+
+ +

◆ tr

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QString PythonQtStdDecorators::tr (QObject * obj,
const QStringtext,
const QStringambig = QString(),
int n = -1 
)
+
+slot
+
+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtStdDecorators.png b/classPythonQtStdDecorators.png new file mode 100644 index 000000000..02416b0cc Binary files /dev/null and b/classPythonQtStdDecorators.png differ diff --git a/classPythonQtThreadStateSaver-members.html b/classPythonQtThreadStateSaver-members.html new file mode 100644 index 000000000..0ac0a9caf --- /dev/null +++ b/classPythonQtThreadStateSaver-members.html @@ -0,0 +1,58 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtThreadStateSaver Member List
+
+
+ +

This is the complete list of members for PythonQtThreadStateSaver, including all inherited members.

+ + + + + +
PythonQtThreadStateSaver()PythonQtThreadStateSaverinline
restore()PythonQtThreadStateSaverinline
save()PythonQtThreadStateSaverinline
~PythonQtThreadStateSaver()PythonQtThreadStateSaverinline
+ + + + diff --git a/classPythonQtThreadStateSaver.html b/classPythonQtThreadStateSaver.html new file mode 100644 index 000000000..281d7a815 --- /dev/null +++ b/classPythonQtThreadStateSaver.html @@ -0,0 +1,209 @@ + + + + + + + +PythonQt: PythonQtThreadStateSaver Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtThreadStateSaver Class Reference
+
+
+ +

#include <PythonQtThreadSupport.h>

+ + + + + + + + + + +

+Public Member Functions

 PythonQtThreadStateSaver ()
 
 ~PythonQtThreadStateSaver ()
 
void save ()
 
void restore ()
 
+

Detailed Description

+

This class wraps the Python save/restore thread state API. It can be used to allow other Python threads to run when entering C++ code from Python code.

+ +

Definition at line 104 of file PythonQtThreadSupport.h.

+

Constructor & Destructor Documentation

+ +

◆ PythonQtThreadStateSaver()

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtThreadStateSaver::PythonQtThreadStateSaver ()
+
+inline
+
+ +

Definition at line 108 of file PythonQtThreadSupport.h.

+ +

References save().

+ +
+
+ +

◆ ~PythonQtThreadStateSaver()

+ +
+
+ + + + + +
+ + + + + + + +
PythonQtThreadStateSaver::~PythonQtThreadStateSaver ()
+
+inline
+
+ +

Definition at line 110 of file PythonQtThreadSupport.h.

+ +

References restore().

+ +
+
+

Member Function Documentation

+ +

◆ restore()

+ +
+
+ + + + + +
+ + + + + + + +
void PythonQtThreadStateSaver::restore ()
+
+inline
+
+ +

Definition at line 114 of file PythonQtThreadSupport.h.

+
115 {
+
116 if (_state) {
+
117 PyEval_RestoreThread(_state);
+
118 _state = nullptr;
+
119 }
+
120 }
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
+

References PythonQtConvertPairToPython().

+ +

Referenced by ~PythonQtThreadStateSaver().

+ +
+
+ +

◆ save()

+ +
+
+ + + + + +
+ + + + + + + +
void PythonQtThreadStateSaver::save ()
+
+inline
+
+ +

Definition at line 112 of file PythonQtThreadSupport.h.

+
112{ _state = PyEval_SaveThread(); }
+
+

References PythonQtConvertPairToPython().

+ +

Referenced by PythonQtThreadStateSaver().

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtWrapper__QMetaObject-members.html b/classPythonQtWrapper__QMetaObject-members.html new file mode 100644 index 000000000..e40c0f019 --- /dev/null +++ b/classPythonQtWrapper__QMetaObject-members.html @@ -0,0 +1,81 @@ + + + + + + + +PythonQt: Member List + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
PythonQtWrapper_QMetaObject Member List
+
+
+ +

This is the complete list of members for PythonQtWrapper_QMetaObject, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
classInfo(QMetaObject *obj, int index) constPythonQtWrapper_QMetaObjectinlineslot
classInfoCount(QMetaObject *obj) constPythonQtWrapper_QMetaObjectinlineslot
classInfoOffset(QMetaObject *obj) constPythonQtWrapper_QMetaObjectinlineslot
constructor(QMetaObject *obj, int index) constPythonQtWrapper_QMetaObjectinlineslot
constructorCount(QMetaObject *obj) constPythonQtWrapper_QMetaObjectinlineslot
enumerator(QMetaObject *obj, int index) constPythonQtWrapper_QMetaObjectinlineslot
enumeratorCount(QMetaObject *obj) constPythonQtWrapper_QMetaObjectinlineslot
enumeratorOffset(QMetaObject *obj) constPythonQtWrapper_QMetaObjectinlineslot
getClassName(QMetaObject *obj) constPythonQtWrapper_QMetaObjectinlineslot
indexOfClassInfo(QMetaObject *obj, const char *name) constPythonQtWrapper_QMetaObjectinlineslot
indexOfConstructor(QMetaObject *obj, const char *constructor) constPythonQtWrapper_QMetaObjectinlineslot
indexOfEnumerator(QMetaObject *obj, const char *name) constPythonQtWrapper_QMetaObjectinlineslot
indexOfMethod(QMetaObject *obj, const char *method) constPythonQtWrapper_QMetaObjectinlineslot
indexOfProperty(QMetaObject *obj, const char *name) constPythonQtWrapper_QMetaObjectinlineslot
indexOfSignal(QMetaObject *obj, const char *signal) constPythonQtWrapper_QMetaObjectinlineslot
indexOfSlot(QMetaObject *obj, const char *slot) constPythonQtWrapper_QMetaObjectinlineslot
method(QMetaObject *obj, int index) constPythonQtWrapper_QMetaObjectinlineslot
methodCount(QMetaObject *obj) constPythonQtWrapper_QMetaObjectinlineslot
methodOffset(QMetaObject *obj) constPythonQtWrapper_QMetaObjectinlineslot
property(QMetaObject *obj, int index) constPythonQtWrapper_QMetaObjectinlineslot
propertyCount(QMetaObject *obj) constPythonQtWrapper_QMetaObjectinlineslot
propertyOffset(QMetaObject *obj) constPythonQtWrapper_QMetaObjectinlineslot
static_QMetaObject_checkConnectArgs(const char *signal, const char *method)PythonQtWrapper_QMetaObjectinlineslot
static_QMetaObject_normalizedSignature(const char *method)PythonQtWrapper_QMetaObjectinlineslot
static_QMetaObject_normalizedType(const char *type)PythonQtWrapper_QMetaObjectinlineslot
superClass(QMetaObject *obj) constPythonQtWrapper_QMetaObjectinlineslot
userProperty(QMetaObject *obj) constPythonQtWrapper_QMetaObjectinlineslot
+ + + + diff --git a/classPythonQtWrapper__QMetaObject.html b/classPythonQtWrapper__QMetaObject.html new file mode 100644 index 000000000..94e0e33eb --- /dev/null +++ b/classPythonQtWrapper__QMetaObject.html @@ -0,0 +1,1105 @@ + + + + + + + +PythonQt: PythonQtWrapper_QMetaObject Class Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+ +
PythonQtWrapper_QMetaObject Class Reference
+
+
+ +

#include <PythonQtStdDecorators.h>

+
+Inheritance diagram for PythonQtWrapper_QMetaObject:
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Slots

const chargetClassName (QMetaObject *obj) const
 
const QMetaObjectsuperClass (QMetaObject *obj) const
 
int methodOffset (QMetaObject *obj) const
 
int enumeratorOffset (QMetaObject *obj) const
 
int propertyOffset (QMetaObject *obj) const
 
int classInfoOffset (QMetaObject *obj) const
 
int constructorCount (QMetaObject *obj) const
 
int methodCount (QMetaObject *obj) const
 
int enumeratorCount (QMetaObject *obj) const
 
int propertyCount (QMetaObject *obj) const
 
int classInfoCount (QMetaObject *obj) const
 
int indexOfConstructor (QMetaObject *obj, const char *constructor) const
 
int indexOfMethod (QMetaObject *obj, const char *method) const
 
int indexOfSignal (QMetaObject *obj, const char *signal) const
 
int indexOfSlot (QMetaObject *obj, const char *slot) const
 
int indexOfEnumerator (QMetaObject *obj, const char *name) const
 
int indexOfProperty (QMetaObject *obj, const char *name) const
 
int indexOfClassInfo (QMetaObject *obj, const char *name) const
 
QMetaMethod constructor (QMetaObject *obj, int index) const
 
QMetaMethod method (QMetaObject *obj, int index) const
 
QMetaEnum enumerator (QMetaObject *obj, int index) const
 
QMetaProperty property (QMetaObject *obj, int index) const
 
QMetaClassInfo classInfo (QMetaObject *obj, int index) const
 
QMetaProperty userProperty (QMetaObject *obj) const
 
bool static_QMetaObject_checkConnectArgs (const char *signal, const char *method)
 
QByteArray static_QMetaObject_normalizedSignature (const char *method)
 
QByteArray static_QMetaObject_normalizedType (const char *type)
 
+

Detailed Description

+
+

Definition at line 175 of file PythonQtStdDecorators.h.

+

Member Function Documentation

+ +

◆ classInfo

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
QMetaClassInfo PythonQtWrapper_QMetaObject::classInfo (QMetaObjectobj,
int index 
) const
+
+inlineslot
+
+ +

Definition at line 210 of file PythonQtStdDecorators.h.

+
210{ return obj->classInfo(index); }
+
PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ classInfoCount

+ +
+
+ + + + + +
+ + + + + + + + +
int PythonQtWrapper_QMetaObject::classInfoCount (QMetaObjectobj) const
+
+inlineslot
+
+ +

Definition at line 193 of file PythonQtStdDecorators.h.

+
193{ return obj->classInfoCount(); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ classInfoOffset

+ +
+
+ + + + + +
+ + + + + + + + +
int PythonQtWrapper_QMetaObject::classInfoOffset (QMetaObjectobj) const
+
+inlineslot
+
+ +

Definition at line 187 of file PythonQtStdDecorators.h.

+
187{ return obj->classInfoOffset(); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ constructor

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
QMetaMethod PythonQtWrapper_QMetaObject::constructor (QMetaObjectobj,
int index 
) const
+
+inlineslot
+
+ +

Definition at line 206 of file PythonQtStdDecorators.h.

+
206{ return obj->constructor(index); }
+
+

References PythonQtConvertPairToPython().

+ +

Referenced by indexOfConstructor().

+ +
+
+ +

◆ constructorCount

+ +
+
+ + + + + +
+ + + + + + + + +
int PythonQtWrapper_QMetaObject::constructorCount (QMetaObjectobj) const
+
+inlineslot
+
+ +

Definition at line 189 of file PythonQtStdDecorators.h.

+
189{ return obj->constructorCount(); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ enumerator

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
QMetaEnum PythonQtWrapper_QMetaObject::enumerator (QMetaObjectobj,
int index 
) const
+
+inlineslot
+
+ +

Definition at line 208 of file PythonQtStdDecorators.h.

+
208{ return obj->enumerator(index); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ enumeratorCount

+ +
+
+ + + + + +
+ + + + + + + + +
int PythonQtWrapper_QMetaObject::enumeratorCount (QMetaObjectobj) const
+
+inlineslot
+
+ +

Definition at line 191 of file PythonQtStdDecorators.h.

+
191{ return obj->enumeratorCount(); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ enumeratorOffset

+ +
+
+ + + + + +
+ + + + + + + + +
int PythonQtWrapper_QMetaObject::enumeratorOffset (QMetaObjectobj) const
+
+inlineslot
+
+ +

Definition at line 185 of file PythonQtStdDecorators.h.

+
185{ return obj->enumeratorOffset(); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ getClassName

+ +
+
+ + + + + +
+ + + + + + + + +
const char * PythonQtWrapper_QMetaObject::getClassName (QMetaObjectobj) const
+
+inlineslot
+
+ +

Definition at line 181 of file PythonQtStdDecorators.h.

+
181{ return obj->className(); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ indexOfClassInfo

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
int PythonQtWrapper_QMetaObject::indexOfClassInfo (QMetaObjectobj,
const charname 
) const
+
+inlineslot
+
+ +

Definition at line 204 of file PythonQtStdDecorators.h.

+
204{ return obj->indexOfClassInfo(name); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ indexOfConstructor

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
int PythonQtWrapper_QMetaObject::indexOfConstructor (QMetaObjectobj,
const charconstructor 
) const
+
+inlineslot
+
+ +

Definition at line 195 of file PythonQtStdDecorators.h.

+
196 {
+
197 return obj->indexOfConstructor(constructor);
+
198 }
+
QMetaMethod constructor(QMetaObject *obj, int index) const
+
+

References constructor(), and PythonQtConvertPairToPython().

+ +
+
+ +

◆ indexOfEnumerator

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
int PythonQtWrapper_QMetaObject::indexOfEnumerator (QMetaObjectobj,
const charname 
) const
+
+inlineslot
+
+ +

Definition at line 202 of file PythonQtStdDecorators.h.

+
202{ return obj->indexOfEnumerator(name); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ indexOfMethod

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
int PythonQtWrapper_QMetaObject::indexOfMethod (QMetaObjectobj,
const charmethod 
) const
+
+inlineslot
+
+ +

Definition at line 199 of file PythonQtStdDecorators.h.

+
199{ return obj->indexOfMethod(method); }
+
QMetaMethod method(QMetaObject *obj, int index) const
+
+

References method(), and PythonQtConvertPairToPython().

+ +
+
+ +

◆ indexOfProperty

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
int PythonQtWrapper_QMetaObject::indexOfProperty (QMetaObjectobj,
const charname 
) const
+
+inlineslot
+
+ +

Definition at line 203 of file PythonQtStdDecorators.h.

+
203{ return obj->indexOfProperty(name); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ indexOfSignal

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
int PythonQtWrapper_QMetaObject::indexOfSignal (QMetaObjectobj,
const charsignal 
) const
+
+inlineslot
+
+ +

Definition at line 200 of file PythonQtStdDecorators.h.

+
200{ return obj->indexOfSignal(signal); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ indexOfSlot

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
int PythonQtWrapper_QMetaObject::indexOfSlot (QMetaObjectobj,
const charslot 
) const
+
+inlineslot
+
+ +

Definition at line 201 of file PythonQtStdDecorators.h.

+
201{ return obj->indexOfSlot(slot); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ method

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
QMetaMethod PythonQtWrapper_QMetaObject::method (QMetaObjectobj,
int index 
) const
+
+inlineslot
+
+ +

Definition at line 207 of file PythonQtStdDecorators.h.

+
207{ return obj->method(index); }
+
+

References PythonQtConvertPairToPython().

+ +

Referenced by indexOfMethod(), static_QMetaObject_checkConnectArgs(), and static_QMetaObject_normalizedSignature().

+ +
+
+ +

◆ methodCount

+ +
+
+ + + + + +
+ + + + + + + + +
int PythonQtWrapper_QMetaObject::methodCount (QMetaObjectobj) const
+
+inlineslot
+
+ +

Definition at line 190 of file PythonQtStdDecorators.h.

+
190{ return obj->methodCount(); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ methodOffset

+ +
+
+ + + + + +
+ + + + + + + + +
int PythonQtWrapper_QMetaObject::methodOffset (QMetaObjectobj) const
+
+inlineslot
+
+ +

Definition at line 184 of file PythonQtStdDecorators.h.

+
184{ return obj->methodOffset(); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ property

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
QMetaProperty PythonQtWrapper_QMetaObject::property (QMetaObjectobj,
int index 
) const
+
+inlineslot
+
+ +

Definition at line 209 of file PythonQtStdDecorators.h.

+
209{ return obj->property(index); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ propertyCount

+ +
+
+ + + + + +
+ + + + + + + + +
int PythonQtWrapper_QMetaObject::propertyCount (QMetaObjectobj) const
+
+inlineslot
+
+ +

Definition at line 192 of file PythonQtStdDecorators.h.

+
192{ return obj->propertyCount(); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ propertyOffset

+ +
+
+ + + + + +
+ + + + + + + + +
int PythonQtWrapper_QMetaObject::propertyOffset (QMetaObjectobj) const
+
+inlineslot
+
+ +

Definition at line 186 of file PythonQtStdDecorators.h.

+
186{ return obj->propertyOffset(); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_QMetaObject_checkConnectArgs

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
bool PythonQtWrapper_QMetaObject::static_QMetaObject_checkConnectArgs (const charsignal,
const charmethod 
)
+
+inlineslot
+
+ +

Definition at line 213 of file PythonQtStdDecorators.h.

+
214 {
+
215 return QMetaObject::checkConnectArgs(signal, method);
+
216 }
+
+

References method(), and PythonQtConvertPairToPython().

+ +
+
+ +

◆ static_QMetaObject_normalizedSignature

+ +
+
+ + + + + +
+ + + + + + + + +
QByteArray PythonQtWrapper_QMetaObject::static_QMetaObject_normalizedSignature (const charmethod)
+
+inlineslot
+
+ +

Definition at line 217 of file PythonQtStdDecorators.h.

+
218 {
+
219 return QMetaObject::normalizedSignature(method);
+
220 }
+
+

References method().

+ +
+
+ +

◆ static_QMetaObject_normalizedType

+ +
+
+ + + + + +
+ + + + + + + + +
QByteArray PythonQtWrapper_QMetaObject::static_QMetaObject_normalizedType (const chartype)
+
+inlineslot
+
+ +

Definition at line 221 of file PythonQtStdDecorators.h.

+
221{ return QMetaObject::normalizedType(type); }
+
+
+
+ +

◆ superClass

+ +
+
+ + + + + +
+ + + + + + + + +
const QMetaObject * PythonQtWrapper_QMetaObject::superClass (QMetaObjectobj) const
+
+inlineslot
+
+ +

Definition at line 182 of file PythonQtStdDecorators.h.

+
182{ return obj->superClass(); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+ +

◆ userProperty

+ +
+
+ + + + + +
+ + + + + + + + +
QMetaProperty PythonQtWrapper_QMetaObject::userProperty (QMetaObjectobj) const
+
+inlineslot
+
+ +

Definition at line 211 of file PythonQtStdDecorators.h.

+
211{ return obj->userProperty(); }
+
+

References PythonQtConvertPairToPython().

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/classPythonQtWrapper__QMetaObject.png b/classPythonQtWrapper__QMetaObject.png new file mode 100644 index 000000000..08bf518ea Binary files /dev/null and b/classPythonQtWrapper__QMetaObject.png differ diff --git a/classes.html b/classes.html new file mode 100644 index 000000000..72a4d4a27 --- /dev/null +++ b/classes.html @@ -0,0 +1,99 @@ + + + + + + + +PythonQt: Class Index + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + +
+
+
Class Index
+
+ + + + + diff --git a/closed.png b/closed.png new file mode 100644 index 000000000..98cc2c909 Binary files /dev/null and b/closed.png differ diff --git a/createSolution.bat b/createSolution.bat deleted file mode 100644 index 03e8b565b..000000000 --- a/createSolution.bat +++ /dev/null @@ -1 +0,0 @@ -qmake -tp vc -r PythonQt.pro diff --git a/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/dir_68267d1309a1af8e8297ef4c3efbcdba.html new file mode 100644 index 000000000..80624d73b --- /dev/null +++ b/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -0,0 +1,113 @@ + + + + + + + +PythonQt: src Directory Reference + + + + + + +
+
+ + + + + + +
+
PythonQt +
+
+
+ + + + + + + +
+
+
src Directory Reference
+
+ + + + + diff --git a/doc.svg b/doc.svg new file mode 100644 index 000000000..0b928a531 --- /dev/null +++ b/doc.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/docd.svg b/docd.svg new file mode 100644 index 000000000..ac18b2755 --- /dev/null +++ b/docd.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/doxygen.css b/doxygen.css new file mode 100644 index 000000000..009a9b554 --- /dev/null +++ b/doxygen.css @@ -0,0 +1,2045 @@ +/* The standard CSS for doxygen 1.9.8*/ + +html { +/* page base colors */ +--page-background-color: white; +--page-foreground-color: black; +--page-link-color: #3D578C; +--page-visited-link-color: #4665A2; + +/* index */ +--index-odd-item-bg-color: #F8F9FC; +--index-even-item-bg-color: white; +--index-header-color: black; +--index-separator-color: #A0A0A0; + +/* header */ +--header-background-color: #F9FAFC; +--header-separator-color: #C4CFE5; +--header-gradient-image: url('nav_h.png'); +--group-header-separator-color: #879ECB; +--group-header-color: #354C7B; +--inherit-header-color: gray; + +--footer-foreground-color: #2A3D61; +--footer-logo-width: 104px; +--citation-label-color: #334975; +--glow-color: cyan; + +--title-background-color: white; +--title-separator-color: #5373B4; +--directory-separator-color: #9CAFD4; +--separator-color: #4A6AAA; + +--blockquote-background-color: #F7F8FB; +--blockquote-border-color: #9CAFD4; + +--scrollbar-thumb-color: #9CAFD4; +--scrollbar-background-color: #F9FAFC; + +--icon-background-color: #728DC1; +--icon-foreground-color: white; +--icon-doc-image: url('doc.svg'); +--icon-folder-open-image: url('folderopen.svg'); +--icon-folder-closed-image: url('folderclosed.svg'); + +/* brief member declaration list */ +--memdecl-background-color: #F9FAFC; +--memdecl-separator-color: #DEE4F0; +--memdecl-foreground-color: #555; +--memdecl-template-color: #4665A2; + +/* detailed member list */ +--memdef-border-color: #A8B8D9; +--memdef-title-background-color: #E2E8F2; +--memdef-title-gradient-image: url('nav_f.png'); +--memdef-proto-background-color: #DFE5F1; +--memdef-proto-text-color: #253555; +--memdef-proto-text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); +--memdef-doc-background-color: white; +--memdef-param-name-color: #602020; +--memdef-template-color: #4665A2; + +/* tables */ +--table-cell-border-color: #2D4068; +--table-header-background-color: #374F7F; +--table-header-foreground-color: #FFFFFF; + +/* labels */ +--label-background-color: #728DC1; +--label-left-top-border-color: #5373B4; +--label-right-bottom-border-color: #C4CFE5; +--label-foreground-color: white; + +/** navigation bar/tree/menu */ +--nav-background-color: #F9FAFC; +--nav-foreground-color: #364D7C; +--nav-gradient-image: url('tab_b.png'); +--nav-gradient-hover-image: url('tab_h.png'); +--nav-gradient-active-image: url('tab_a.png'); +--nav-gradient-active-image-parent: url("../tab_a.png"); +--nav-separator-image: url('tab_s.png'); +--nav-breadcrumb-image: url('bc_s.png'); +--nav-breadcrumb-border-color: #C2CDE4; +--nav-splitbar-image: url('splitbar.png'); +--nav-font-size-level1: 13px; +--nav-font-size-level2: 10px; +--nav-font-size-level3: 9px; +--nav-text-normal-color: #283A5D; +--nav-text-hover-color: white; +--nav-text-active-color: white; +--nav-text-normal-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); +--nav-text-hover-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-text-active-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-menu-button-color: #364D7C; +--nav-menu-background-color: white; +--nav-menu-foreground-color: #555555; +--nav-menu-toggle-color: rgba(255, 255, 255, 0.5); +--nav-arrow-color: #9CAFD4; +--nav-arrow-selected-color: #9CAFD4; + +/* table of contents */ +--toc-background-color: #F4F6FA; +--toc-border-color: #D8DFEE; +--toc-header-color: #4665A2; +--toc-down-arrow-image: url("data:image/svg+xml;utf8,&%238595;"); + +/** search field */ +--search-background-color: white; +--search-foreground-color: #909090; +--search-magnification-image: url('mag.svg'); +--search-magnification-select-image: url('mag_sel.svg'); +--search-active-color: black; +--search-filter-background-color: #F9FAFC; +--search-filter-foreground-color: black; +--search-filter-border-color: #90A5CE; +--search-filter-highlight-text-color: white; +--search-filter-highlight-bg-color: #3D578C; +--search-results-foreground-color: #425E97; +--search-results-background-color: #EEF1F7; +--search-results-border-color: black; +--search-box-shadow: inset 0.5px 0.5px 3px 0px #555; + +/** code fragments */ +--code-keyword-color: #008000; +--code-type-keyword-color: #604020; +--code-flow-keyword-color: #E08000; +--code-comment-color: #800000; +--code-preprocessor-color: #806020; +--code-string-literal-color: #002080; +--code-char-literal-color: #008080; +--code-xml-cdata-color: black; +--code-vhdl-digit-color: #FF00FF; +--code-vhdl-char-color: #000000; +--code-vhdl-keyword-color: #700070; +--code-vhdl-logic-color: #FF0000; +--code-link-color: #4665A2; +--code-external-link-color: #4665A2; +--fragment-foreground-color: black; +--fragment-background-color: #FBFCFD; +--fragment-border-color: #C4CFE5; +--fragment-lineno-border-color: #00FF00; +--fragment-lineno-background-color: #E8E8E8; +--fragment-lineno-foreground-color: black; +--fragment-lineno-link-fg-color: #4665A2; +--fragment-lineno-link-bg-color: #D8D8D8; +--fragment-lineno-link-hover-fg-color: #4665A2; +--fragment-lineno-link-hover-bg-color: #C8C8C8; +--tooltip-foreground-color: black; +--tooltip-background-color: white; +--tooltip-border-color: gray; +--tooltip-doc-color: grey; +--tooltip-declaration-color: #006318; +--tooltip-link-color: #4665A2; +--tooltip-shadow: 1px 1px 7px gray; +--fold-line-color: #808080; +--fold-minus-image: url('minus.svg'); +--fold-plus-image: url('plus.svg'); +--fold-minus-image-relpath: url('../../minus.svg'); +--fold-plus-image-relpath: url('../../plus.svg'); + +/** font-family */ +--font-family-normal: Roboto,sans-serif; +--font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +--font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +--font-family-title: Tahoma,Arial,sans-serif; +--font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; +--font-family-search: Arial,Verdana,sans-serif; +--font-family-icon: Arial,Helvetica; +--font-family-tooltip: Roboto,sans-serif; + +} + +@media (prefers-color-scheme: dark) { + html:not(.dark-mode) { + color-scheme: dark; + +/* page base colors */ +--page-background-color: black; +--page-foreground-color: #C9D1D9; +--page-link-color: #90A5CE; +--page-visited-link-color: #A3B4D7; + +/* index */ +--index-odd-item-bg-color: #0B101A; +--index-even-item-bg-color: black; +--index-header-color: #C4CFE5; +--index-separator-color: #334975; + +/* header */ +--header-background-color: #070B11; +--header-separator-color: #141C2E; +--header-gradient-image: url('nav_hd.png'); +--group-header-separator-color: #283A5D; +--group-header-color: #90A5CE; +--inherit-header-color: #A0A0A0; + +--footer-foreground-color: #5B7AB7; +--footer-logo-width: 60px; +--citation-label-color: #90A5CE; +--glow-color: cyan; + +--title-background-color: #090D16; +--title-separator-color: #354C79; +--directory-separator-color: #283A5D; +--separator-color: #283A5D; + +--blockquote-background-color: #101826; +--blockquote-border-color: #283A5D; + +--scrollbar-thumb-color: #283A5D; +--scrollbar-background-color: #070B11; + +--icon-background-color: #334975; +--icon-foreground-color: #C4CFE5; +--icon-doc-image: url('docd.svg'); +--icon-folder-open-image: url('folderopend.svg'); +--icon-folder-closed-image: url('folderclosedd.svg'); + +/* brief member declaration list */ +--memdecl-background-color: #0B101A; +--memdecl-separator-color: #2C3F65; +--memdecl-foreground-color: #BBB; +--memdecl-template-color: #7C95C6; + +/* detailed member list */ +--memdef-border-color: #233250; +--memdef-title-background-color: #1B2840; +--memdef-title-gradient-image: url('nav_fd.png'); +--memdef-proto-background-color: #19243A; +--memdef-proto-text-color: #9DB0D4; +--memdef-proto-text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.9); +--memdef-doc-background-color: black; +--memdef-param-name-color: #D28757; +--memdef-template-color: #7C95C6; + +/* tables */ +--table-cell-border-color: #283A5D; +--table-header-background-color: #283A5D; +--table-header-foreground-color: #C4CFE5; + +/* labels */ +--label-background-color: #354C7B; +--label-left-top-border-color: #4665A2; +--label-right-bottom-border-color: #283A5D; +--label-foreground-color: #CCCCCC; + +/** navigation bar/tree/menu */ +--nav-background-color: #101826; +--nav-foreground-color: #364D7C; +--nav-gradient-image: url('tab_bd.png'); +--nav-gradient-hover-image: url('tab_hd.png'); +--nav-gradient-active-image: url('tab_ad.png'); +--nav-gradient-active-image-parent: url("../tab_ad.png"); +--nav-separator-image: url('tab_sd.png'); +--nav-breadcrumb-image: url('bc_sd.png'); +--nav-breadcrumb-border-color: #2A3D61; +--nav-splitbar-image: url('splitbard.png'); +--nav-font-size-level1: 13px; +--nav-font-size-level2: 10px; +--nav-font-size-level3: 9px; +--nav-text-normal-color: #B6C4DF; +--nav-text-hover-color: #DCE2EF; +--nav-text-active-color: #DCE2EF; +--nav-text-normal-shadow: 0px 1px 1px black; +--nav-text-hover-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-text-active-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +--nav-menu-button-color: #B6C4DF; +--nav-menu-background-color: #05070C; +--nav-menu-foreground-color: #BBBBBB; +--nav-menu-toggle-color: rgba(255, 255, 255, 0.2); +--nav-arrow-color: #334975; +--nav-arrow-selected-color: #90A5CE; + +/* table of contents */ +--toc-background-color: #151E30; +--toc-border-color: #202E4A; +--toc-header-color: #A3B4D7; +--toc-down-arrow-image: url("data:image/svg+xml;utf8,&%238595;"); + +/** search field */ +--search-background-color: black; +--search-foreground-color: #C5C5C5; +--search-magnification-image: url('mag_d.svg'); +--search-magnification-select-image: url('mag_seld.svg'); +--search-active-color: #C5C5C5; +--search-filter-background-color: #101826; +--search-filter-foreground-color: #90A5CE; +--search-filter-border-color: #7C95C6; +--search-filter-highlight-text-color: #BCC9E2; +--search-filter-highlight-bg-color: #283A5D; +--search-results-background-color: #101826; +--search-results-foreground-color: #90A5CE; +--search-results-border-color: #7C95C6; +--search-box-shadow: inset 0.5px 0.5px 3px 0px #2F436C; + +/** code fragments */ +--code-keyword-color: #CC99CD; +--code-type-keyword-color: #AB99CD; +--code-flow-keyword-color: #E08000; +--code-comment-color: #717790; +--code-preprocessor-color: #65CABE; +--code-string-literal-color: #7EC699; +--code-char-literal-color: #00E0F0; +--code-xml-cdata-color: #C9D1D9; +--code-vhdl-digit-color: #FF00FF; +--code-vhdl-char-color: #C0C0C0; +--code-vhdl-keyword-color: #CF53C9; +--code-vhdl-logic-color: #FF0000; +--code-link-color: #79C0FF; +--code-external-link-color: #79C0FF; +--fragment-foreground-color: #C9D1D9; +--fragment-background-color: black; +--fragment-border-color: #30363D; +--fragment-lineno-border-color: #30363D; +--fragment-lineno-background-color: black; +--fragment-lineno-foreground-color: #6E7681; +--fragment-lineno-link-fg-color: #6E7681; +--fragment-lineno-link-bg-color: #303030; +--fragment-lineno-link-hover-fg-color: #8E96A1; +--fragment-lineno-link-hover-bg-color: #505050; +--tooltip-foreground-color: #C9D1D9; +--tooltip-background-color: #202020; +--tooltip-border-color: #C9D1D9; +--tooltip-doc-color: #D9E1E9; +--tooltip-declaration-color: #20C348; +--tooltip-link-color: #79C0FF; +--tooltip-shadow: none; +--fold-line-color: #808080; +--fold-minus-image: url('minusd.svg'); +--fold-plus-image: url('plusd.svg'); +--fold-minus-image-relpath: url('../../minusd.svg'); +--fold-plus-image-relpath: url('../../plusd.svg'); + +/** font-family */ +--font-family-normal: Roboto,sans-serif; +--font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +--font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +--font-family-title: Tahoma,Arial,sans-serif; +--font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; +--font-family-search: Arial,Verdana,sans-serif; +--font-family-icon: Arial,Helvetica; +--font-family-tooltip: Roboto,sans-serif; + +}} +body { + background-color: var(--page-background-color); + color: var(--page-foreground-color); +} + +body, table, div, p, dl { + font-weight: 400; + font-size: 14px; + font-family: var(--font-family-normal); + line-height: 22px; +} + +/* @group Heading Levels */ + +.title { + font-weight: 400; + font-size: 14px; + font-family: var(--font-family-normal); + line-height: 28px; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h1.groupheader { + font-size: 150%; +} + +h2.groupheader { + border-bottom: 1px solid var(--group-header-separator-color); + color: var(--group-header-color); + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px var(--glow-color); +} + +dt { + font-weight: bold; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +th p.starttd, th p.intertd, th p.endtd { + font-size: 100%; + font-weight: 700; +} + +p.starttd { + margin-top: 0px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +p.interli { +} + +p.interdd { +} + +p.intertd { +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.navtab { + padding-right: 15px; + text-align: right; + line-height: 110%; +} + +div.navtab table { + border-spacing: 0; +} + +td.navtab { + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL { + background-image: var(--nav-gradient-active-image); + background-repeat:repeat-x; + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL a, td.navtabHL a:visited { + color: var(--nav-text-hover-color); + text-shadow: var(--nav-text-hover-shadow); +} + +a.navtab { + font-weight: bold; +} + +div.qindex{ + text-align: center; + width: 100%; + line-height: 140%; + font-size: 130%; + color: var(--index-separator-color); +} + +#main-menu a:focus { + outline: auto; + z-index: 10; + position: relative; +} + +dt.alphachar{ + font-size: 180%; + font-weight: bold; +} + +.alphachar a{ + color: var(--index-header-color); +} + +.alphachar a:hover, .alphachar a:visited{ + text-decoration: none; +} + +.classindex dl { + padding: 25px; + column-count:1 +} + +.classindex dd { + display:inline-block; + margin-left: 50px; + width: 90%; + line-height: 1.15em; +} + +.classindex dl.even { + background-color: var(--index-even-item-bg-color); +} + +.classindex dl.odd { + background-color: var(--index-odd-item-bg-color); +} + +@media(min-width: 1120px) { + .classindex dl { + column-count:2 + } +} + +@media(min-width: 1320px) { + .classindex dl { + column-count:3 + } +} + + +/* @group Link Styling */ + +a { + color: var(--page-link-color); + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: var(--page-visited-link-color); +} + +a:hover { + text-decoration: underline; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited, a.line, a.line:visited { + color: var(--code-link-color); +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: var(--code-external-link-color); +} + +a.code.hl_class { /* style for links to class names in code snippets */ } +a.code.hl_struct { /* style for links to struct names in code snippets */ } +a.code.hl_union { /* style for links to union names in code snippets */ } +a.code.hl_interface { /* style for links to interface names in code snippets */ } +a.code.hl_protocol { /* style for links to protocol names in code snippets */ } +a.code.hl_category { /* style for links to category names in code snippets */ } +a.code.hl_exception { /* style for links to exception names in code snippets */ } +a.code.hl_service { /* style for links to service names in code snippets */ } +a.code.hl_singleton { /* style for links to singleton names in code snippets */ } +a.code.hl_concept { /* style for links to concept names in code snippets */ } +a.code.hl_namespace { /* style for links to namespace names in code snippets */ } +a.code.hl_package { /* style for links to package names in code snippets */ } +a.code.hl_define { /* style for links to macro names in code snippets */ } +a.code.hl_function { /* style for links to function names in code snippets */ } +a.code.hl_variable { /* style for links to variable names in code snippets */ } +a.code.hl_typedef { /* style for links to typedef names in code snippets */ } +a.code.hl_enumvalue { /* style for links to enum value names in code snippets */ } +a.code.hl_enumeration { /* style for links to enumeration names in code snippets */ } +a.code.hl_signal { /* style for links to Qt signal names in code snippets */ } +a.code.hl_slot { /* style for links to Qt slot names in code snippets */ } +a.code.hl_friend { /* style for links to friend names in code snippets */ } +a.code.hl_dcop { /* style for links to KDE3 DCOP names in code snippets */ } +a.code.hl_property { /* style for links to property names in code snippets */ } +a.code.hl_event { /* style for links to event names in code snippets */ } +a.code.hl_sequence { /* style for links to sequence names in code snippets */ } +a.code.hl_dictionary { /* style for links to dictionary names in code snippets */ } + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +ul { + overflow: visible; +} + +ul.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; + column-count: 3; + list-style-type: none; +} + +#side-nav ul { + overflow: visible; /* reset ul rule for scroll bar in GENERATE_TREEVIEW window */ +} + +#main-nav ul { + overflow: visible; /* reset ul rule for the navigation bar drop down lists */ +} + +.fragment { + text-align: left; + direction: ltr; + overflow-x: auto; /*Fixed: fragment lines overlap floating elements*/ + overflow-y: hidden; +} + +pre.fragment { + border: 1px solid var(--fragment-border-color); + background-color: var(--fragment-background-color); + color: var(--fragment-foreground-color); + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: var(--font-family-monospace); + font-size: 105%; +} + +div.fragment { + padding: 0 0 1px 0; /*Fixed: last line underline overlap border*/ + margin: 4px 8px 4px 2px; + color: var(--fragment-foreground-color); + background-color: var(--fragment-background-color); + border: 1px solid var(--fragment-border-color); +} + +div.line { + font-family: var(--font-family-monospace); + font-size: 13px; + min-height: 13px; + line-height: 1.2; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line:after { + content:"\000A"; + white-space: pre; +} + +div.line.glow { + background-color: var(--glow-color); + box-shadow: 0 0 10px var(--glow-color); +} + +span.fold { + margin-left: 5px; + margin-right: 1px; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; + display: inline-block; + width: 12px; + height: 12px; + background-repeat:no-repeat; + background-position:center; +} + +span.lineno { + padding-right: 4px; + margin-right: 9px; + text-align: right; + border-right: 2px solid var(--fragment-lineno-border-color); + color: var(--fragment-lineno-foreground-color); + background-color: var(--fragment-lineno-background-color); + white-space: pre; +} +span.lineno a, span.lineno a:visited { + color: var(--fragment-lineno-link-fg-color); + background-color: var(--fragment-lineno-link-bg-color); +} + +span.lineno a:hover { + color: var(--fragment-lineno-link-hover-fg-color); + background-color: var(--fragment-lineno-link-hover-bg-color); +} + +.lineno { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +div.classindex ul { + list-style: none; + padding-left: 0; +} + +div.classindex span.ai { + display: inline-block; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + color: var(--page-foreground-color); + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +p.formulaDsp { + text-align: center; +} + +img.dark-mode-visible { + display: none; +} +img.light-mode-visible { + display: none; +} + +img.formulaDsp { + +} + +img.formulaInl, img.inline { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; + width: var(--footer-logo-width); +} + +.compoundTemplParams { + color: var(--memdecl-template-color); + font-size: 80%; + line-height: 120%; +} + +/* @group Code Colorization */ + +span.keyword { + color: var(--code-keyword-color); +} + +span.keywordtype { + color: var(--code-type-keyword-color); +} + +span.keywordflow { + color: var(--code-flow-keyword-color); +} + +span.comment { + color: var(--code-comment-color); +} + +span.preprocessor { + color: var(--code-preprocessor-color); +} + +span.stringliteral { + color: var(--code-string-literal-color); +} + +span.charliteral { + color: var(--code-char-literal-color); +} + +span.xmlcdata { + color: var(--code-xml-cdata-color); +} + +span.vhdldigit { + color: var(--code-vhdl-digit-color); +} + +span.vhdlchar { + color: var(--code-vhdl-char-color); +} + +span.vhdlkeyword { + color: var(--code-vhdl-keyword-color); +} + +span.vhdllogic { + color: var(--code-vhdl-logic-color); +} + +blockquote { + background-color: var(--blockquote-background-color); + border-left: 2px solid var(--blockquote-border-color); + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +/* @end */ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid var(--table-cell-border-color); +} + +th.dirtab { + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid var(--separator-color); +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: var(--glow-color); + box-shadow: 0 0 15px var(--glow-color); +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: var(--memdecl-background-color); + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: var(--memdecl-foreground-color); +} + +.memSeparator { + border-bottom: 1px solid var(--memdecl-separator-color); + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight, .memTemplItemRight { + width: 100%; +} + +.memTemplParams { + color: var(--memdecl-template-color); + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtitle { + padding: 8px; + border-top: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); + border-top-right-radius: 4px; + border-top-left-radius: 4px; + margin-bottom: -1px; + background-image: var(--memdef-title-gradient-image); + background-repeat: repeat-x; + background-color: var(--memdef-title-background-color); + line-height: 1.25; + font-weight: 300; + float:left; +} + +.permalink +{ + font-size: 65%; + display: inline-block; + vertical-align: middle; +} + +.memtemplate { + font-size: 80%; + color: var(--memdef-template-color); + font-weight: normal; + margin-left: 9px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px var(--glow-color); +} + +.memname { + font-weight: 400; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); + padding: 6px 0px 6px 0px; + color: var(--memdef-proto-text-color); + font-weight: bold; + text-shadow: var(--memdef-proto-text-shadow); + background-color: var(--memdef-proto-background-color); + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; +} + +.overload { + font-family: var(--font-family-monospace); + font-size: 65%; +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); + padding: 6px 10px 2px 10px; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: var(--memdef-doc-background-color); + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: var(--memdef-param-name-color); + white-space: nowrap; +} +.paramname em { + font-style: normal; +} +.paramname code { + line-height: 14px; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname, .tparams .paramname, .exception .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype, .tparams .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir, .tparams .paramdir { + font-family: var(--font-family-monospace); + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: var(--label-background-color); + border-top:1px solid var(--label-left-top-border-color); + border-left:1px solid var(--label-left-top-border-color); + border-right:1px solid var(--label-right-bottom-border-color); + border-bottom:1px solid var(--label-right-bottom-border-color); + text-shadow: none; + color: var(--label-foreground-color); + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view inside a (index) page */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid var(--directory-separator-color); + border-bottom: 1px solid var(--directory-separator-color); + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.odd { + padding-left: 6px; + background-color: var(--index-odd-item-bg-color); +} + +.directory tr.even { + padding-left: 6px; + background-color: var(--index-even-item-bg-color); +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: var(--page-link-color); +} + +.arrow { + color: var(--nav-arrow-color); + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 22px; +} + +.icon { + font-family: var(--font-family-icon); + line-height: normal; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: var(--icon-background-color); + color: var(--icon-foreground-color); + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; +} + +.icona { + width: 24px; + height: 22px; + display: inline-block; +} + +.iconfopen { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:var(--icon-folder-open-image); + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.iconfclosed { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:var(--icon-folder-closed-image); + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.icondoc { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:var(--icon-doc-image); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: var(--footer-foreground-color); +} + +table.doxtable caption { + caption-side: top; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid var(--table-cell-border-color); + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + margin-bottom: 10px; + border: 1px solid var(--memdef-border-color); + border-spacing: 0px; + border-radius: 4px; + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid var(--memdef-border-color); + border-bottom: 1px solid var(--memdef-border-color); + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid var(--memdef-border-color); +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image: var(--memdef-title-gradient-image); + background-repeat:repeat-x; + background-color: var(--memdef-title-background-color); + font-size: 90%; + color: var(--memdef-proto-text-color); + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + font-weight: 400; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid var(--memdef-border-color); +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: var(--nav-gradient-image); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image: var(--nav-gradient-image); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:var(--nav-text-normal-color); + border:solid 1px var(--nav-breadcrumb-border-color); + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:var(--nav-breadcrumb-image); + background-repeat:no-repeat; + background-position:right; + color: var(--nav-foreground-color); +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; + color: var(--nav-text-normal-color); + font-family: var(--font-family-nav); + text-shadow: var(--nav-text-normal-shadow); + text-decoration: none; +} + +.navpath li.navelem a:hover +{ + color: var(--nav-text-hover-color); + text-shadow: var(--nav-text-hover-shadow); +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color: var(--footer-foreground-color); + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +table.classindex +{ + margin: 10px; + white-space: nowrap; + margin-left: 3%; + margin-right: 3%; + width: 94%; + border: 0; + border-spacing: 0; + padding: 0; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image: var(--header-gradient-image); + background-repeat:repeat-x; + background-color: var(--header-background-color); + margin: 0px; + border-bottom: 1px solid var(--header-separator-color); +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +.PageDocRTL-title div.headertitle { + text-align: right; + direction: rtl; +} + +dl { + padding: 0 0 0 0; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug, dl.examples */ +dl.section { + margin-left: 0px; + padding-left: 0px; +} + +dl.note { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00D000; +} + +dl.deprecated { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #505050; +} + +dl.todo { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00C0E0; +} + +dl.test { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #3030E0; +} + +dl.bug { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #C08050; +} + +dl.section dd { + margin-bottom: 6px; +} + + +#projectrow +{ + height: 56px; +} + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectalign +{ + vertical-align: middle; + padding-left: 0.5em; +} + +#projectname +{ + font-size: 200%; + font-family: var(--font-family-title); + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font-size: 90%; + font-family: var(--font-family-title); + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font-size: 50%; + font-family: 50% var(--font-family-title); + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid var(--title-separator-color); + background-color: var(--title-background-color); +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.plantumlgraph +{ + text-align: center; +} + +.diagraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:var(--citation-label-color); + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; + text-align:right; + width:52px; +} + +dl.citelist dd { + margin:2px 0 2px 72px; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: var(--toc-background-color); + border: 1px solid var(--toc-border-color); + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 8px 10px 10px; + width: 200px; +} + +div.toc li { + background: var(--toc-down-arrow-image) no-repeat scroll 0 5px transparent; + font: 10px/1.2 var(--font-family-toc); + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 var(--font-family-toc); + color: var(--toc-header-color); + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 15px; +} + +div.toc li.level4 { + margin-left: 15px; +} + +span.emoji { + /* font family used at the site: https://unicode.org/emoji/charts/full-emoji-list.html + * font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif, LastResort; + */ +} + +span.obfuscator { + display: none; +} + +.inherit_header { + font-weight: bold; + color: var(--inherit-header-color); + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +#powerTip { + cursor: default; + /*white-space: nowrap;*/ + color: var(--tooltip-foreground-color); + background-color: var(--tooltip-background-color); + border: 1px solid var(--tooltip-border-color); + border-radius: 4px 4px 4px 4px; + box-shadow: var(--tooltip-shadow); + display: none; + font-size: smaller; + max-width: 80%; + opacity: 0.9; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: var(--tooltip-doc-color); + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip a { + color: var(--tooltip-link-color); +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: var(--tooltip-declaration-color); +} + +#powerTip div { + margin: 0px; + padding: 0px; + font-size: 12px; + font-family: var(--font-family-tooltip); + line-height: 16px; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: var(--tooltip-background-color); + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before, #powerTip.ne:before, #powerTip.nw:before { + border-top-color: var(--tooltip-border-color); + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: var(--tooltip-background-color); + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: var(--tooltip-border-color); + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: var(--tooltip-border-color); + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: var(--tooltip-border-color); + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: var(--tooltip-border-color); + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: var(--tooltip-border-color); + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + +/* @group Markdown */ + +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid var(--table-cell-border-color); + padding: 3px 7px 2px; +} + +table.markdownTable tr { +} + +th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft, td.markdownTableBodyLeft { + text-align: left +} + +th.markdownTableHeadRight, td.markdownTableBodyRight { + text-align: right +} + +th.markdownTableHeadCenter, td.markdownTableBodyCenter { + text-align: center +} + +tt, code, kbd, samp +{ + display: inline-block; +} +/* @end */ + +u { + text-decoration: underline; +} + +details>summary { + list-style-type: none; +} + +details > summary::-webkit-details-marker { + display: none; +} + +details>summary::before { + content: "\25ba"; + padding-right:4px; + font-size: 80%; +} + +details[open]>summary::before { + content: "\25bc"; + padding-right:4px; + font-size: 80%; +} + +body { + scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-background-color); +} + +::-webkit-scrollbar { + background-color: var(--scrollbar-background-color); + height: 12px; + width: 12px; +} +::-webkit-scrollbar-thumb { + border-radius: 6px; + box-shadow: inset 0 0 12px 12px var(--scrollbar-thumb-color); + border: solid 2px transparent; +} +::-webkit-scrollbar-corner { + background-color: var(--scrollbar-background-color); +} + diff --git a/doxygen.svg b/doxygen.svg new file mode 100644 index 000000000..79a763540 --- /dev/null +++ b/doxygen.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doxygen/Doxyfile b/doxygen/Doxyfile deleted file mode 100644 index 8013ca1ed..000000000 --- a/doxygen/Doxyfile +++ /dev/null @@ -1,2603 +0,0 @@ -# Doxyfile 1.9.5 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). -# -# Note: -# -# Use doxygen to compare the used configuration file with the template -# configuration file: -# doxygen -x [configFile] -# Use doxygen to compare the used configuration file with the template -# configuration file without replacing the environment variables or CMake type -# replacement variables: -# doxygen -x_noenv [configFile] - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the configuration -# file that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# https://www.gnu.org/software/libiconv/ for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = PythonQt - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify a logo or an icon that is included -# in the documentation. The maximum height of the logo should not exceed 55 -# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy -# the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = . - -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 -# sub-directories (in 2 levels) under the output directory of each output format -# and will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to -# control the number of sub-directories. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII -# characters to appear in the names of generated files. If set to NO, non-ASCII -# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode -# U+3044. -# The default value is: NO. - -ALLOW_UNICODE_NAMES = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, -# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English -# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, -# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with -# English messages), Korean, Korean-en (Korean with English messages), Latvian, -# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, -# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, -# Swedish, Turkish, Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = NO - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = NO - -# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line -# such as -# /*************** -# as being the beginning of a Javadoc-style comment "banner". If set to NO, the -# Javadoc-style will behave just like regular comments and it will not be -# interpreted by doxygen. -# The default value is: NO. - -JAVADOC_BANNER = NO - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# By default Python docstrings are displayed as preformatted text and doxygen's -# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the -# doxygen's special commands can be used and the contents of the docstring -# documentation blocks is shown as doxygen documentation. -# The default value is: YES. - -PYTHON_DOCSTRING = YES - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new -# page for each member. If set to NO, the documentation of a member will be part -# of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:^^" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". Note that you cannot put \n's in the value part of an alias -# to insert newlines (in the resulting output). You can put ^^ in the value part -# of an alias to insert a newline as if a physical newline was in the original -# file. When you need a literal { or } or , in the value part of an alias you -# have to escape them by means of a backslash (\), this can lead to conflicts -# with the commands \{ and \} for these it is advised to use the version @{ and -# @} or use a double escape (\\{ and \\}) - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice -# sources only. Doxygen will then generate output that is more tailored for that -# language. For instance, namespaces will be presented as modules, types will be -# separated into more groups, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_SLICE = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, -# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, -# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: -# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser -# tries to guess whether the code is fixed or free formatted code, this is the -# default for Fortran type files). For instance to make doxygen treat .inc files -# as Fortran files (default is PHP), and .f files as C (default is Fortran), -# use: inc=Fortran f=C. -# -# Note: For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. When specifying no_extension you should add -# * to the FILE_PATTERNS. -# -# Note see also the list of default file extension mappings. - -EXTENSION_MAPPING = - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See https://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up -# to that level are automatically included in the table of contents, even if -# they do not have an id attribute. -# Note: This feature currently applies only to Markdown headings. -# Minimum value: 0, maximum value: 99, default value: 5. -# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. - -TOC_INCLUDE_HEADINGS = 0 - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by putting a % sign in front of the word or -# globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# If one adds a struct or class to a group and this option is enabled, then also -# any nested class or struct is added to the same group. By default this option -# is disabled and one has to add nested compounds explicitly via \ingroup. -# The default value is: NO. - -GROUP_NESTED_COMPOUNDS = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use -# during processing. When set to 0 doxygen will based this on the number of -# cores available in the system. You can set it explicitly to a value larger -# than 0 to get more control over the balance between CPU load and processing -# speed. At this moment only the input processing can be done using multiple -# threads. Since this is still an experimental feature the default is set to 1, -# which effectively disables parallel processing. Please report any issues you -# encounter. Generating dot graphs in parallel is controlled by the -# DOT_NUM_THREADS setting. -# Minimum value: 0, maximum value: 32, default value: 1. - -NUM_PROC_THREADS = 1 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual -# methods of a class will be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIV_VIRTUAL = NO - -# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO, -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. If set to YES, local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO, only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If this flag is set to YES, the name of an unnamed parameter in a declaration -# will be determined by the corresponding definition. By default unnamed -# parameters remain unnamed in the output. -# The default value is: YES. - -RESOLVE_UNNAMED_PARAMS = YES - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO, these classes will be included in the various overviews. This option -# has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# declarations. If set to NO, these declarations will be included in the -# documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO, these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# With the correct setting of option CASE_SENSE_NAMES doxygen will better be -# able to match the capabilities of the underlying filesystem. In case the -# filesystem is case sensitive (i.e. it supports files in the same directory -# whose names only differ in casing), the option must be set to YES to properly -# deal with such files in case they appear in the input. For filesystems that -# are not case sensitive the option should be set to NO to properly deal with -# output files written for symbols that only differ in casing, such as for two -# classes, one named CLASS and the other named Class, and to also support -# references to files without having to specify the exact matching casing. On -# Windows (including Cygwin) and MacOS, users should typically set this option -# to NO, whereas on Linux or other Unix flavors it should typically be set to -# YES. -# Possible values are: SYSTEM, NO and YES. -# The default value is: SYSTEM. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES, the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = NO - -# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will -# append additional text to a page's title, such as Class Reference. If set to -# YES the compound reference will be hidden. -# The default value is: NO. - -HIDE_COMPOUND_REFERENCE= NO - -# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class -# will show which file needs to be included to use the class. -# The default value is: YES. - -# SHOW_HEADERFILE = YES - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = YES - -# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each -# grouped member an include statement to the documentation, telling the reader -# which file to include in order to use the member. -# The default value is: NO. - -SHOW_GROUPED_MEMB_INC = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. -# The default value is: NO. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo -# list. This list is created by putting \todo commands in the documentation. -# The default value is: YES. - -GENERATE_TODOLIST = NO - -# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test -# list. This list is created by putting \test commands in the documentation. -# The default value is: YES. - -GENERATE_TESTLIST = NO - -# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if ... \endif and \cond -# ... \endcond blocks. - -ENABLED_SECTIONS = sourceonly - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES, the -# list will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. See also section "Changing the -# layout of pages" for information. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. See also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = YES - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as documenting some parameters in -# a documented function twice, or documenting parameters that don't exist or -# using markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong parameter -# documentation, but not about the absence of documentation. If EXTRACT_ALL is -# set to YES then this flag will automatically be disabled. See also -# WARN_IF_INCOMPLETE_DOC -# The default value is: NO. - -WARN_NO_PARAMDOC = NO - -# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS -# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but -# at the end of the doxygen process doxygen will return with a non-zero status. -# Possible values are: NO, YES and FAIL_ON_WARNINGS. -# The default value is: NO. - -WARN_AS_ERROR = NO - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# See also: WARN_LINE_FORMAT -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# In the $text part of the WARN_FORMAT command it is possible that a reference -# to a more specific place is given. To make it easier to jump to this place -# (outside of doxygen) the user can define a custom "cut" / "paste" string. -# Example: -# WARN_LINE_FORMAT = "'vi $file +$line'" -# See also: WARN_FORMAT -# The default value is: at line $line of file $file. - -# WARN_LINE_FORMAT = "at line $line of file $file" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). In case the file specified cannot be opened for writing the -# warning and error messages are written to standard error. When as file - is -# specified the warning and error messages are written to standard output -# (stdout). - -WARN_LOGFILE = doxygen.log - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING -# Note: If this tag is empty the current directory is searched. - -INPUT = ../src - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: -# https://www.gnu.org/software/libiconv/) for the list of possible encodings. -# See also: INPUT_FILE_ENCODING -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# read by doxygen. -# -# Note the list of default checked file patterns might differ from the list of -# default file extension mappings. -# -# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, -# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, -# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, -# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C -# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, -# *.vhdl, *.ucf, *.qsf and *.ice. - -FILE_PATTERNS = *.h - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# ANamespace::AClass, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = . - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# -# -# where is the value of the INPUT_FILTER tag, and is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. -# -# Note that doxygen will use the data processed and written to standard output -# for further processing, therefore nothing else, like debug statements or used -# commands (so in case of a Windows batch file always use @echo OFF), should be -# written to standard output. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -# The Fortran standard specifies that for fixed formatted Fortran code all -# characters from position 72 are to be considered as comment. A common -# extension is to allow longer lines before the automatic comment starts. The -# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can -# be processed before the automatic comment starts. -# Minimum value: 7, maximum value: 10000, default value: 72. - -# FORTRAN_COMMENT_AFTER = 72 - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = YES - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# entity all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = YES - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = YES - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see https://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = YES - -# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the -# clang parser (see: -# http://clang.llvm.org/) for more accurate parsing at the cost of reduced -# performance. This can be particularly helpful with template rich C++ code for -# which doxygen's built-in parser lacks the necessary type information. -# Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse_libclang=ON option for CMake. -# The default value is: NO. - -CLANG_ASSISTED_PARSING = NO - -# If the CLANG_ASSISTED_PARSING tag is set to YES and the CLANG_ADD_INC_PATHS -# tag is set to YES then doxygen will add the directory of each input to the -# include path. -# The default value is: YES. -# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. - -CLANG_ADD_INC_PATHS = YES - -# If clang assisted parsing is enabled you can provide the compiler with command -# line options that you would normally use when invoking the compiler. Note that -# the include paths will already be set by doxygen for the files and directories -# specified with INPUT and INCLUDE_PATH. -# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. - -CLANG_OPTIONS = - -# If clang assisted parsing is enabled you can provide the clang parser with the -# path to the directory containing a file called compile_commands.json. This -# file is the compilation database (see: -# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the -# options used when the source files were built. This is equivalent to -# specifying the -p option to a clang tool, such as clang-check. These options -# will then be passed to the parser. Any options specified with CLANG_OPTIONS -# will be added as well. -# Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse_libclang=ON option for CMake. - -CLANG_DATABASE_PATH = - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = YES - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = PythonQt - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined -# cascading style sheets that are included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefore more robust against future updates. -# Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra style sheet files is of importance (e.g. the last -# style sheet in the list overrules the setting of the previous ones in the -# list). For an example see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the style sheet and background images according to -# this color. Hue is specified as an angle on a color-wheel, see -# https://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use gray-scales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to YES can help to show when doxygen was last run and thus if the -# documentation is up to date. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML -# documentation will contain a main index with vertical navigation menus that -# are dynamically created via JavaScript. If disabled, the navigation index will -# consists of multiple levels of tabs that are statically embedded in every HTML -# page. Disable this option to support browsers that do not have JavaScript, -# like the Qt help browser. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_MENUS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: -# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To -# create a documentation set, doxygen will generate a Makefile in the HTML -# output directory. Running make will produce the docset in that directory and -# running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy -# genXcode/_index.html for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# on Windows. In the beginning of 2021 Microsoft took the original page, with -# a.o. the download links, offline the HTML help workshop was already many years -# in maintenance mode). You can download the HTML help workshop from the web -# archives at Installation executable (see: -# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo -# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler (hhc.exe). If non-empty, -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the main .chm file (NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated -# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it -# enables the Previous and Next buttons. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: -# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: -# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: -# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: -# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location (absolute path -# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to -# run qhelpgenerator on the generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can -# further fine tune the look of the index (see "Fine-tuning the output"). As an -# example, the default style sheet generated by doxygen has an example that -# shows how to put an image at the root of the tree instead of the PROJECT_NAME. -# Since the tree basically has the same information as the tab index, you could -# consider setting DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = NO - -# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the -# FULL_SIDEBAR option determines if the side bar is limited to only the treeview -# area (value NO) or if it should extend to the full height of the window (value -# YES). Setting this to YES gives a layout similar to -# https://docs.readthedocs.io with more room for contents, but less room for the -# project logo, title, and description. If either GENERATE_TREEVIEW or -# DISABLE_INDEX is set to NO, this option has no effect. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -# FULL_SIDEBAR = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg -# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see -# https://inkscape.org) to generate formulas as SVG images instead of PNGs for -# the HTML output. These images will generally look nicer at scaled resolutions. -# Possible values are: png (the default) and svg (looks nicer but requires the -# pdf2svg or inkscape tool). -# The default value is: png. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FORMULA_FORMAT = png - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands -# to create new LaTeX commands to be used in formulas as building blocks. See -# the section "Including formulas" for details. - -FORMULA_MACROFILE = - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# https://www.mathjax.org) which uses client side JavaScript for the rendering -# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. For more details about the output format see MathJax -# version 2 (see: -# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 -# (see: -# http://docs.mathjax.org/en/latest/web/components/output.html). -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility. This is the name for Mathjax version 2, for MathJax version 3 -# this will be translated into chtml), NativeMML (i.e. MathML. Only supported -# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This -# is the name for Mathjax version 3, for MathJax version 2 this will be -# translated into HTML-CSS) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from https://www.mathjax.org before deployment. The default value is: -# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 -# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# for MathJax version 2 (see -# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# For example for MathJax version 3 (see -# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): -# MATHJAX_EXTENSIONS = ams -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: -# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use + S -# (what the is depends on the OS and browser, but it is typically -# , /