diff --git a/src/gsiqt/qt4/QtNetwork/QtNetwork.pro b/src/gsiqt/qt4/QtNetwork/QtNetwork.pro index 58544eafb..00b0983f4 100644 --- a/src/gsiqt/qt4/QtNetwork/QtNetwork.pro +++ b/src/gsiqt/qt4/QtNetwork/QtNetwork.pro @@ -12,6 +12,9 @@ DEPENDPATH += $$TL_INC $$GSI_INC $$QTBASIC_INC LIBS += -L$$DESTDIR -lklayout_tl -lklayout_gsi -lklayout_qtbasic +# because QQbject is used as base class for many classes, we need this: +LIBS += -lklayout_QtCore + SOURCES += \ gsiDeclQtNetworkAdd.cc diff --git a/src/gsiqt/qt4/QtNetwork/gsiDeclQtNetworkAdd.cc b/src/gsiqt/qt4/QtNetwork/gsiDeclQtNetworkAdd.cc index 25f7c5097..a79a54d26 100644 --- a/src/gsiqt/qt4/QtNetwork/gsiDeclQtNetworkAdd.cc +++ b/src/gsiqt/qt4/QtNetwork/gsiDeclQtNetworkAdd.cc @@ -20,7 +20,6 @@ */ - #include "gsiQt.h" #include diff --git a/src/gsiqt/qt4/QtSql/QtSql.pro b/src/gsiqt/qt4/QtSql/QtSql.pro index 663f99b2b..c74889559 100644 --- a/src/gsiqt/qt4/QtSql/QtSql.pro +++ b/src/gsiqt/qt4/QtSql/QtSql.pro @@ -12,6 +12,9 @@ DEPENDPATH += $$TL_INC $$GSI_INC $$QTBASIC_INC LIBS += -L$$DESTDIR -lklayout_tl -lklayout_gsi -lklayout_qtbasic +# because QAsbtractTableModel is used as base class, we need this: +LIBS += -lklayout_QtCore + SOURCES += \ HEADERS += \ diff --git a/src/gsiqt/qt4/qt4.pro b/src/gsiqt/qt4/qt4.pro index 01daec72f..36c09917d 100644 --- a/src/gsiqt/qt4/qt4.pro +++ b/src/gsiqt/qt4/qt4.pro @@ -9,8 +9,8 @@ SUBDIRS = \ QtNetwork \ QtDesigner -# This is weired, but true: because QSignalMapper (inside QtCore) has a QWidget -# argument, we need to enforce linking of QtCore against QtGui so this GSI declaration -# is available there -# TODO: -QtCore.depends += QtGui +QtGui.depends += QtCore +QtNetwork.depends += QtCore +QtSql.depends += QtCore +QtDesigner.depends += QtCore +QtXml.depends += QtCore diff --git a/src/pya/pya/pya.cc b/src/pya/pya/pya.cc index 0668299ba..7956d8813 100644 --- a/src/pya/pya/pya.cc +++ b/src/pya/pya/pya.cc @@ -2280,13 +2280,13 @@ PythonModule::init (const char *mod_name, const char *description) module = Py_InitModule3 (m_mod_name.c_str (), module_methods, m_mod_description.c_str ()); #else - static struct PyModuleDef mod_def = { + struct PyModuleDef mod_def = { PyModuleDef_HEAD_INIT, m_mod_name.c_str (), NULL, // module documentation -1, // size of per-interpreter state of the module, // if the module keeps state in global variables. - module_methods + NULL }; tl_assert (! mp_mod_def); diff --git a/src/pymod/QtCore/QtCore.pro b/src/pymod/QtCore/QtCore.pro index 40caf843a..b45334bd4 100644 --- a/src/pymod/QtCore/QtCore.pro +++ b/src/pymod/QtCore/QtCore.pro @@ -8,4 +8,8 @@ SOURCES = \ HEADERS += \ -LIBS += -lklayout_QtCore -lklayout_QtGui -lklayout_QtWidgets +LIBS += -lklayout_QtCore -lklayout_QtGui + +equals(HAVE_QT5, "1") { + LIBS += -lklayout_QtWidgets +} diff --git a/src/pymod/QtXml/QtXml.pro b/src/pymod/QtXml/QtXml.pro index 532447f86..a8641948a 100644 --- a/src/pymod/QtXml/QtXml.pro +++ b/src/pymod/QtXml/QtXml.pro @@ -11,4 +11,8 @@ HEADERS += \ LIBS += -lklayout_QtCore -lklayout_QtXml # Because of stupid dependency of QtCore on QtGui and this on QtWidgets: -LIBS += -lklayout_QtGui -lklayout_QtWidgets +LIBS += -lklayout_QtGui + +equals(HAVE_QT5, "1") { + LIBS += -lklayout_QtWidgets +} diff --git a/testdata/pymod/import_QtDesigner.py b/testdata/pymod/import_QtDesigner.py index f8c491cda..314250d74 100644 --- a/testdata/pymod/import_QtDesigner.py +++ b/testdata/pymod/import_QtDesigner.py @@ -29,6 +29,7 @@ class BasicTest(unittest.TestCase): self.assertEqual("QFormBuilder" in QtDesigner.__all__, True) def test_2(self): + app = QtCore.QCoreApplication([ "appname" ]) q = QtDesigner.QFormBuilder() # run unit tests diff --git a/testdata/pymod/import_lay.py b/testdata/pymod/import_lay.py index 4433624bd..ed877c03a 100644 --- a/testdata/pymod/import_lay.py +++ b/testdata/pymod/import_lay.py @@ -18,7 +18,8 @@ import pykl.QtCore import pykl.QtGui -import pykl.QtWidgets +if not "QApplication" in pykl.QtGui.__all__: + import pykl.QtWidgets # Qt5 import pykl.lay as lay import unittest import sys