Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install ScriptingConsole and add CMake option PythonQt_extensions #64

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -355,7 +358,9 @@ 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)

add_subdirectory(extensions)
#-----------------------------------------------------------------------------
# Testing

Expand Down
23 changes: 23 additions & 0 deletions extensions/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
4 changes: 2 additions & 2 deletions src/PythonQtClassInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1063,4 +1063,4 @@ PythonQtMemberInfo::PythonQtMemberInfo( const QMetaProperty& prop )
_property = prop;
_enumValue = NULL;
_pythonType = NULL;
}
}
4 changes: 2 additions & 2 deletions src/PythonQtMethodInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ QHash<QByteArray, QByteArray> 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;
Expand Down Expand Up @@ -584,4 +584,4 @@ QByteArray PythonQtSlotInfo::getImplementingClassName() const
} else {
return _meta.enclosingMetaObject()->className();
}
}
}
2 changes: 1 addition & 1 deletion src/PythonQtSlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down