Support for Qt-binding-less Python modules.

This commit is contained in:
Matthias Koefferlein 2018-06-09 17:01:52 +02:00
parent 7f2e740dd4
commit e5aa55a25c
6 changed files with 58 additions and 18 deletions

View File

@ -43,17 +43,19 @@
#include "libForceLink.h"
#include "antForceLink.h"
#include "imgForceLink.h"
#ifdef HAVE_RUBY
#if defined(HAVE_RUBY)
#include "drcForceLink.h"
#endif
#if defined(HAVE_QTBINDINGS)
// pulls in the Qt GSI binding modules
#include "gsiQtGuiExternals.h"
#include "gsiQtCoreExternals.h"
#include "gsiQtXmlExternals.h"
#include "gsiQtSqlExternals.h"
#include "gsiQtNetworkExternals.h"
#include "gsiQtDesignerExternals.h"
# include "gsiQtGuiExternals.h"
# include "gsiQtCoreExternals.h"
# include "gsiQtXmlExternals.h"
# include "gsiQtSqlExternals.h"
# include "gsiQtNetworkExternals.h"
# include "gsiQtDesignerExternals.h"
FORCE_LINK_GSI_QTCORE
FORCE_LINK_GSI_QTGUI
@ -62,6 +64,10 @@ FORCE_LINK_GSI_QTDESIGNER
FORCE_LINK_GSI_QTNETWORK
FORCE_LINK_GSI_QTSQL
#else
# define QT_EXTERNAL_BASE(x)
#endif
#include <QTranslator>
#include <QLocale>
#include <QTextCodec>

View File

@ -24,11 +24,14 @@
#include "layMainWindow.h"
#include "laySignalHandler.h"
#include "gsiDecl.h"
#include "tlArch.h"
#if defined(HAVE_QTBINDINGS)
#include "gsiQtGuiExternals.h"
#include "gsiQtWidgetsExternals.h" // for Qt5
#include "gsiQtCoreExternals.h"
#include "gsiQtXmlExternals.h"
#include "tlArch.h"
// this is here *once*
FORCE_LINK_GSI_QTCORE
@ -37,6 +40,8 @@ FORCE_LINK_GSI_QTWIDGETS
// required because the GSI bindings use QDomDocument
FORCE_LINK_GSI_QTXML
#endif
namespace gsi
{
@ -254,7 +259,11 @@ LAY_PUBLIC make_application_decl (bool non_gui_mode)
if (non_gui_mode) {
non_gui_app_decl.reset (
new Class<lay::NonGuiApplication> (QT_EXTERNAL_BASE (QCoreApplication) "lay", "Application",
new Class<lay::NonGuiApplication> (
#if defined(HAVE_QTBINDINGS)
QT_EXTERNAL_BASE (QCoreApplication)
#endif
"lay", "Application",
application_methods<lay::NonGuiApplication> (),
application_doc ()
)
@ -263,7 +272,11 @@ LAY_PUBLIC make_application_decl (bool non_gui_mode)
} else {
gui_app_decl.reset (
new Class<lay::GuiApplication> (QT_EXTERNAL_BASE (QApplication) "lay", "Application",
new Class<lay::GuiApplication> (
#if defined(HAVE_QTBINDINGS)
QT_EXTERNAL_BASE (QApplication)
#endif
"lay", "Application",
application_methods<lay::GuiApplication> (),
application_doc ()
)

View File

@ -26,8 +26,13 @@
#include "layMainWindow.h"
#include "laybasicCommon.h"
#include "gsiDecl.h"
#include "gsiQtGuiExternals.h"
#include "gsiQtWidgetsExternals.h"
#if defined(HAVE_QTBINDINGS)
# include "gsiQtGuiExternals.h"
# include "gsiQtWidgetsExternals.h"
#else
# define QT_EXTERNAL_BASE(x)
#endif
namespace tl
{

View File

@ -22,10 +22,15 @@
#include "gsiDecl.h"
#include "gsiSignals.h"
#include "gsiQtGuiExternals.h"
#include "gsiQtWidgetsExternals.h" // for Qt5
#include "layMainWindow.h"
#if defined(HAVE_QTBINDINGS)
# include "gsiQtGuiExternals.h"
# include "gsiQtWidgetsExternals.h" // for Qt5
#else
# define QT_EXTERNAL_BASE(x)
#endif
namespace gsi
{

View File

@ -22,8 +22,6 @@
#include "gsiDecl.h"
#include "gsiDeclBasic.h"
#include "gsiQtGuiExternals.h"
#include "gsiQtWidgetsExternals.h"
#include "layBrowserDialog.h"
#include "layBrowserPanel.h"
@ -35,9 +33,17 @@
#include <limits>
#if defined(HAVE_QTBINDINGS)
# include "gsiQtGuiExternals.h"
# include "gsiQtWidgetsExternals.h"
FORCE_LINK_GSI_QTGUI
FORCE_LINK_GSI_QTWIDGETS // for Qt5
#else
# define QT_EXTERNAL_BASE(x)
#endif
namespace gsi
{

View File

@ -23,8 +23,6 @@
#include "gsiDecl.h"
#include "gsiSignals.h"
#include "gsiQtGuiExternals.h"
#include "gsiQtWidgetsExternals.h" // for Qt5
#include "rdb.h"
#include "layLayoutView.h"
#include "layDitherPattern.h"
@ -32,6 +30,13 @@
#include "dbSaveLayoutOptions.h"
#include "tlStream.h"
#if defined(HAVE_QTBINDINGS)
# include "gsiQtGuiExternals.h"
# include "gsiQtWidgetsExternals.h" // for Qt5
#else
# define QT_EXTERNAL_BASE(x)
#endif
namespace gsi
{