This commit is contained in:
Matthias Koefferlein 2021-11-24 23:59:36 +01:00
parent fb4caf15ac
commit a4d2e7891c
15 changed files with 29 additions and 14 deletions

View File

@ -2,7 +2,7 @@
TEMPLATE = subdirs TEMPLATE = subdirs
SUBDIRS = qtbasic SUBDIRS = qtbasic
greaterThan(QT_MAJOR, "4") { greaterThan(QT_MAJOR_VERSION, 4) {
SUBDIRS += qt5 SUBDIRS += qt5
qt5.depends += qtbasic qt5.depends += qtbasic
} else { } else {

View File

@ -171,6 +171,10 @@ equals(HAVE_QT, "0") {
DEFINES += HAVE_QT DEFINES += HAVE_QT
QT += core xml network QT += core xml network
greaterThan(QT_MAJOR_VERSION, 5) {
QT += core5compat
}
equals(HAVE_QTBINDINGS, "1") { equals(HAVE_QTBINDINGS, "1") {
# sql isn't needed by the base application # sql isn't needed by the base application
!equals(HAVE_QT_SQL, "0") { !equals(HAVE_QT_SQL, "0") {
@ -178,9 +182,13 @@ equals(HAVE_QT, "0") {
} }
} }
greaterThan(QT_MAJOR, "4") { greaterThan(QT_MAJOR_VERSION, 4) {
QT += widgets gui printsupport xmlpatterns QT += widgets gui printsupport
lessThan(QT_MAJOR_VERSION, 6) {
QT += xmlpatterns
}
equals(HAVE_QTBINDINGS, "1") { equals(HAVE_QTBINDINGS, "1") {
!equals(HAVE_QT_DESIGNER, "0") { !equals(HAVE_QT_DESIGNER, "0") {

View File

@ -45,7 +45,7 @@ equals(HAVE_QTBINDINGS, "1") {
LIBS += -lklayout_QtUiTools LIBS += -lklayout_QtUiTools
} }
greaterThan(QT_MAJOR, "4") { greaterThan(QT_MAJOR_VERSION, 4) {
LIBS += -lklayout_QtWidgets LIBS += -lklayout_QtWidgets

View File

@ -207,7 +207,7 @@ equals(HAVE_QTBINDINGS, "1") {
!equals(HAVE_QT_XML, "0") { !equals(HAVE_QT_XML, "0") {
LIBS += -lklayout_QtXml LIBS += -lklayout_QtXml
} }
greaterThan(QT_MAJOR, "4") { greaterThan(QT_MAJOR_VERSION, 4) {
LIBS += -lklayout_QtWidgets LIBS += -lklayout_QtWidgets
} }
} }

View File

@ -310,7 +310,7 @@ DEPENDPATH += $$QTBASIC_INC
equals(HAVE_QTBINDINGS, "1") { equals(HAVE_QTBINDINGS, "1") {
LIBS += -lklayout_qtbasic -lklayout_QtGui -lklayout_QtCore LIBS += -lklayout_qtbasic -lklayout_QtGui -lklayout_QtCore
greaterThan(QT_MAJOR, "4") { greaterThan(QT_MAJOR_VERSION, 4) {
LIBS += -lklayout_QtWidgets LIBS += -lklayout_QtWidgets
} }
} }

View File

@ -17,7 +17,7 @@ win32 {
QMAKE_POST_LINK += $(COPY) $(DESTDIR)$(TARGET) $$DESTDIR_UT/$${TARGET}.ut QMAKE_POST_LINK += $(COPY) $(DESTDIR)$(TARGET) $$DESTDIR_UT/$${TARGET}.ut
} }
greaterThan(QT_MAJOR, "4") { greaterThan(QT_MAJOR_VERSION, 4) {
QT += testlib QT += testlib
} else { } else {
CONFIG += qtestlib CONFIG += qtestlib

View File

@ -3,7 +3,7 @@ TEMPLATE = subdirs
contains(QT_CONFIG, opengl) { contains(QT_CONFIG, opengl) {
greaterThan(QT_MAJOR, "4") { greaterThan(QT_MAJOR_VERSION, 4) {
SUBDIRS = lay_plugin unit_tests SUBDIRS = lay_plugin unit_tests
} }

View File

@ -10,6 +10,6 @@ HEADERS += \
LIBS += -lklayout_QtCore -lklayout_QtGui LIBS += -lklayout_QtCore -lklayout_QtGui
greaterThan(QT_MAJOR, "4") { greaterThan(QT_MAJOR_VERSION, 4) {
LIBS += -lklayout_QtWidgets LIBS += -lklayout_QtWidgets
} }

View File

@ -10,7 +10,7 @@ HEADERS += \
LIBS += -lklayout_QtGui -lklayout_QtCore LIBS += -lklayout_QtGui -lklayout_QtCore
greaterThan(QT_MAJOR, "4") { greaterThan(QT_MAJOR_VERSION, 4) {
LIBS += -lklayout_QtWidgets LIBS += -lklayout_QtWidgets
} }

View File

@ -13,6 +13,6 @@ LIBS += -lklayout_QtCore -lklayout_QtXml
# Because of stupid dependency of QtCore on QtGui and this on QtWidgets: # Because of stupid dependency of QtCore on QtGui and this on QtWidgets:
LIBS += -lklayout_QtGui LIBS += -lklayout_QtGui
greaterThan(QT_MAJOR, "4") { greaterThan(QT_MAJOR_VERSION, 4) {
LIBS += -lklayout_QtWidgets LIBS += -lklayout_QtWidgets
} }

View File

@ -18,7 +18,7 @@ SUBDIRS = \
QtCore \ QtCore \
QtGui QtGui
greaterThan(QT_MAJOR, "4") { greaterThan(QT_MAJOR_VERSION, 4) {
SUBDIRS += QtWidgets SUBDIRS += QtWidgets

View File

@ -12,7 +12,7 @@ HEADERS += \
# Use this opportunity to provide the __init__.py file # Use this opportunity to provide the __init__.py file
equals(HAVE_QTBINDINGS, "1") { equals(HAVE_QTBINDINGS, "1") {
greaterThan(QT_MAJOR, "4") { greaterThan(QT_MAJOR_VERSION, 4) {
INIT_PY = $$PWD/../__init__.py.qt5 INIT_PY = $$PWD/../__init__.py.qt5
} else { } else {
INIT_PY = $$PWD/../__init__.py.qt4 INIT_PY = $$PWD/../__init__.py.qt4

View File

@ -175,8 +175,13 @@ InputStream::InputStream (const std::string &abstract_path)
if (res.size () > 0) { if (res.size () > 0) {
QByteArray data; QByteArray data;
#if QT_VERSION >= 0x60000
if (res.compressionAlgorithm () == QResource::ZlibCompression) {
data = qUncompress ((const unsigned char *)res.data (), (int)res.size ());
#else
if (res.isCompressed ()) { if (res.isCompressed ()) {
data = qUncompress ((const unsigned char *)res.data (), (int)res.size ()); data = qUncompress ((const unsigned char *)res.data (), (int)res.size ());
#endif
} else { } else {
data = QByteArray ((const char *)res.data (), (int)res.size ()); data = QByteArray ((const char *)res.data (), (int)res.size ());
} }

View File

@ -402,9 +402,11 @@ Variant::Variant (const QVariant &v)
case QVariant::RectF: case QVariant::RectF:
operator= (tl::Variant (v.value<QRectF> ())); operator= (tl::Variant (v.value<QRectF> ()));
break; break;
#if QT_VERSION < 0x60000
case QVariant::RegExp: case QVariant::RegExp:
operator= (tl::Variant (v.value<QRegExp> ())); operator= (tl::Variant (v.value<QRegExp> ()));
break; break;
#endif
case QVariant::Region: case QVariant::Region:
operator= (tl::Variant (v.value<QRegion> ())); operator= (tl::Variant (v.value<QRegion> ()));
break; break;

View File

@ -37,7 +37,7 @@ LIBS += -lklayout_gsi_test
!equals(HAVE_QT_XML, "0") { !equals(HAVE_QT_XML, "0") {
LIBS += -lklayout_QtXml LIBS += -lklayout_QtXml
} }
greaterThan(QT_MAJOR, "4") { greaterThan(QT_MAJOR_VERSION, 4) {
LIBS += -lklayout_QtWidgets LIBS += -lklayout_QtWidgets
} }
} }