From 1840e74d0ddf1f51fa2e243ebfd520a0b2ecb9d4 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 2 Jun 2018 00:01:00 +0200 Subject: [PATCH] WIP: avoid some warnings when using "import klayout.QtCore" Reason: klayout_QtCore needs to be linked with QtGui so it's GSI declarations become available. The reason is only QSignalMapper which is in QtCore and has a QWidget argument. --- src/gsiqt/qt4/QtCore/QtCore.pro | 2 +- src/gsiqt/qt4/QtCore/gsiDeclQtCoreAdd.cc | 13 +++++-------- src/gsiqt/qt4/QtGui/gsiDeclQtGuiAdd.cc | 8 ++++++++ src/gsiqt/qt5/QtCore/gsiDeclQtCoreAdd.cc | 8 -------- src/gsiqt/qt5/QtGui/gsiDeclQtGuiAdd.cc | 8 ++++++++ 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/gsiqt/qt4/QtCore/QtCore.pro b/src/gsiqt/qt4/QtCore/QtCore.pro index 0d7c55d5b..4620526ed 100644 --- a/src/gsiqt/qt4/QtCore/QtCore.pro +++ b/src/gsiqt/qt4/QtCore/QtCore.pro @@ -11,7 +11,7 @@ DEFINES += MAKE_GSI_QTCORE_LIBRARY INCLUDEPATH += $$TL_INC $$GSI_INC $$DB_INC $$QTBASIC_INC DEPENDPATH += $$TL_INC $$GSI_INC $$DB_INC $$QTBASIC_INC -LIBS += -L$$DESTDIR -lklayout_tl -lklayout_gsi -lklayout_qtbasic +LIBS += -L$$DESTDIR -lklayout_tl -lklayout_gsi -lklayout_qtbasic -lklayout_QtGui SOURCES += \ gsiDeclQtCoreAdd.cc diff --git a/src/gsiqt/qt4/QtCore/gsiDeclQtCoreAdd.cc b/src/gsiqt/qt4/QtCore/gsiDeclQtCoreAdd.cc index d656beab7..b89a006e1 100644 --- a/src/gsiqt/qt4/QtCore/gsiDeclQtCoreAdd.cc +++ b/src/gsiqt/qt4/QtCore/gsiDeclQtCoreAdd.cc @@ -34,6 +34,11 @@ // namespace which is in QtCore ... this introduces a dependency of QtCore GSI lib on QtGui. #include +// And this is *only* required because of QSignalMapper which takes a QWidget argument from +// the QtGui library and we need to supply the GSI binding for this ... +#include "gsiQtGuiExternals.h" +FORCE_LINK_GSI_QTGUI + class Qt_Namespace { }; namespace gsi_qt @@ -149,14 +154,6 @@ gsi::Class > decl_double_QPointF_QPair ("QtCore", "QPair_ "@qt\\n@brief Represents a QPair" ); -// ------------------------------------------------------------ -// Declarations for QPair - -gsi::Class > decl_double_QColor_QPair ("QtCore", "QPair_double_QColor", - qt_gsi::pair_decl::methods (), - "@qt\\n@brief Represents a QPair" -); - // ------------------------------------------------------------ // Declarations for QPair diff --git a/src/gsiqt/qt4/QtGui/gsiDeclQtGuiAdd.cc b/src/gsiqt/qt4/QtGui/gsiDeclQtGuiAdd.cc index 21e083739..937784427 100644 --- a/src/gsiqt/qt4/QtGui/gsiDeclQtGuiAdd.cc +++ b/src/gsiqt/qt4/QtGui/gsiDeclQtGuiAdd.cc @@ -29,6 +29,14 @@ namespace gsi_qt { +// ------------------------------------------------------------ +// Declarations for QPair + +gsi::Class > decl_double_QColor_QPair ("QtCore", "QPair_double_QColor", + qt_gsi::pair_decl::methods (), + "@qt\\n@brief Represents a QPair" +); + // ------------------------------------------------------------ // Declarations for QPair diff --git a/src/gsiqt/qt5/QtCore/gsiDeclQtCoreAdd.cc b/src/gsiqt/qt5/QtCore/gsiDeclQtCoreAdd.cc index d730ed254..3dc7cdf87 100644 --- a/src/gsiqt/qt5/QtCore/gsiDeclQtCoreAdd.cc +++ b/src/gsiqt/qt5/QtCore/gsiDeclQtCoreAdd.cc @@ -150,14 +150,6 @@ gsi::Class > decl_double_QPointF_QPair ("QtCore", "QPair_ "@qt\\n@brief Represents a QPair" ); -// ------------------------------------------------------------ -// Declarations for QPair - -gsi::Class > decl_double_QColor_QPair ("QtCore", "QPair_double_QColor", - qt_gsi::pair_decl::methods (), - "@qt\\n@brief Represents a QPair" -); - // ------------------------------------------------------------ // Declarations for QPair diff --git a/src/gsiqt/qt5/QtGui/gsiDeclQtGuiAdd.cc b/src/gsiqt/qt5/QtGui/gsiDeclQtGuiAdd.cc index 21e083739..89da38fa4 100644 --- a/src/gsiqt/qt5/QtGui/gsiDeclQtGuiAdd.cc +++ b/src/gsiqt/qt5/QtGui/gsiDeclQtGuiAdd.cc @@ -37,4 +37,12 @@ gsi::Class > decl_QAccessibl "@qt\\n@brief Represents a QPair >" ); +// ------------------------------------------------------------ +// Declarations for QPair + +gsi::Class > decl_double_QColor_QPair ("QtCore", "QPair_double_QColor", + qt_gsi::pair_decl::methods (), + "@qt\\n@brief Represents a QPair" +); + }