From 6066a76574eec65c327614d632da75e254278a67 Mon Sep 17 00:00:00 2001 From: Joseph Mirabel Date: Tue, 6 Feb 2018 18:21:47 +0100 Subject: [PATCH 1/3] Install PythonQtScriptingConsole.h --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 08a154d3..348046a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -282,6 +282,9 @@ set(headers src/PythonQtPythonInclude.h generated_cpp${generated_cpp_suffix}/PythonQt_QtBindings.h ) +set(headers_gui + src/gui/PythonQtScriptingConsole.h +) #----------------------------------------------------------------------------- # Headers that should run through moc @@ -355,6 +358,7 @@ install(TARGETS PythonQt LIBRARY DESTINATION ${PythonQt_INSTALL_LIBRARY_DIR} ARCHIVE DESTINATION ${PythonQt_INSTALL_ARCHIVE_DIR}) install(FILES ${headers} DESTINATION ${PythonQt_INSTALL_INCLUDE_DIR}) +install(FILES ${headers_gui} DESTINATION ${PythonQt_INSTALL_INCLUDE_DIR}/gui) #----------------------------------------------------------------------------- # Testing From bee026bea235d95ac5fdc0ddb1a7f68fea5705b7 Mon Sep 17 00:00:00 2001 From: Joseph Mirabel Date: Tue, 6 Feb 2018 18:23:23 +0100 Subject: [PATCH 2/3] Add option to build and install extensions. --- CMakeLists.txt | 1 + extensions/CMakeLists.txt | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 extensions/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 348046a3..743302aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -360,6 +360,7 @@ install(TARGETS PythonQt install(FILES ${headers} DESTINATION ${PythonQt_INSTALL_INCLUDE_DIR}) install(FILES ${headers_gui} DESTINATION ${PythonQt_INSTALL_INCLUDE_DIR}/gui) +add_subdirectory(extensions) #----------------------------------------------------------------------------- # Testing diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt new file mode 100644 index 00000000..261c99d7 --- /dev/null +++ b/extensions/CMakeLists.txt @@ -0,0 +1,23 @@ +option(PythonQt_Extensions "Build PythonQt extensions." OFF) + +if(PythonQt_Extensions) + if(NOT PythonQt_Wrap_QtAll) + MESSAGE(FATAL_ERROR "Cannot build PythonQt_QtAll without PythonQt_Wrap_QtAll set to ON") + endif(NOT PythonQt_Wrap_QtAll) + set(qtall_headers + PythonQt_QtAll/PythonQt_QtAll.h) + + set(qtall_sources + PythonQt_QtAll/PythonQt_QtAll.cpp) + + include_directories(generated_cpp${generated_cpp_suffix}) + + add_library(PythonQt_QtAll SHARED ${qtall_sources}) + target_link_libraries(PythonQt_QtAll PythonQt) + + install(TARGETS PythonQt_QtAll + RUNTIME DESTINATION ${PythonQt_INSTALL_RUNTIME_DIR} + LIBRARY DESTINATION ${PythonQt_INSTALL_LIBRARY_DIR} + ARCHIVE DESTINATION ${PythonQt_INSTALL_ARCHIVE_DIR}) + install(FILES ${qtall_headers} DESTINATION ${PythonQt_INSTALL_INCLUDE_DIR}) +endif() From fdea80d22e4c3e780873b4b47ed8602090d349f1 Mon Sep 17 00:00:00 2001 From: Joseph Mirabel Date: Fri, 30 Sep 2016 18:06:34 +0200 Subject: [PATCH 3/3] Fix compilation with PythonQt_Debug flag --- src/PythonQtClassInfo.cpp | 4 ++-- src/PythonQtMethodInfo.cpp | 4 ++-- src/PythonQtSlot.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PythonQtClassInfo.cpp b/src/PythonQtClassInfo.cpp index b48a523d..434f74e7 100644 --- a/src/PythonQtClassInfo.cpp +++ b/src/PythonQtClassInfo.cpp @@ -287,7 +287,7 @@ bool PythonQtClassInfo::lookForEnumAndCache(const QMetaObject* meta, const char* PythonQtMemberInfo newInfo(enumValuePtr); _cachedMembers.insert(memberName, newInfo); #ifdef PYTHONQT_DEBUG - std::cout << "caching enum " << memberName << " on " << meta->className()->constData() << std::endl; + std::cout << "caching enum " << memberName << " on " << meta->className() << std::endl; #endif found = true; break; @@ -1063,4 +1063,4 @@ PythonQtMemberInfo::PythonQtMemberInfo( const QMetaProperty& prop ) _property = prop; _enumValue = NULL; _pythonType = NULL; -} \ No newline at end of file +} diff --git a/src/PythonQtMethodInfo.cpp b/src/PythonQtMethodInfo.cpp index 716fd648..5700565c 100644 --- a/src/PythonQtMethodInfo.cpp +++ b/src/PythonQtMethodInfo.cpp @@ -50,7 +50,7 @@ QHash PythonQtMethodInfo::_parameterNameAliases; PythonQtMethodInfo::PythonQtMethodInfo(const QMetaMethod& meta, PythonQtClassInfo* classInfo) { #ifdef PYTHONQT_DEBUG - QByteArray sig = PythonQtUtils::signature(meta)); + QByteArray sig = PythonQtUtils::signature(meta); sig = sig.mid(sig.indexOf('(')); QByteArray fullSig = QByteArray(meta.typeName()) + " " + sig; std::cout << "caching " << fullSig.data() << std::endl; @@ -584,4 +584,4 @@ QByteArray PythonQtSlotInfo::getImplementingClassName() const } else { return _meta.enclosingMetaObject()->className(); } -} \ No newline at end of file +} diff --git a/src/PythonQtSlot.cpp b/src/PythonQtSlot.cpp index 2401307a..2bc4f09a 100644 --- a/src/PythonQtSlot.cpp +++ b/src/PythonQtSlot.cpp @@ -333,7 +333,7 @@ PyObject *PythonQtSlotFunction_CallImpl(PythonQtClassInfo* classInfo, QObject* o } #ifdef PYTHONQT_DEBUG - std::cout << "called " << info->metaMethod()->typeName() << " " << info->signature() << std::endl; + std::cout << "called " << info->metaMethod()->typeName() << " " << info->signature().constData() << std::endl; #endif PyObject* r = NULL;