1818
1919load(File.join(File.dirname(__FILE__), "common.conf"))
2020
21+ def add_native_operator_neq(engine, cls)
22+ cls_id = cls.gsub("::", "_")
23+ engine.drop_method cls, /::operator\s*==/
24+ engine.drop_method cls, /::operator\s*!=/
25+ engine.add_native_impl(cls, <<"CODE", <<"DECL")
26+ static bool #{cls_id}_operator_eq(const #{cls} *a, const #{cls} &b) {
27+ return *a == b;
28+ }
29+ static bool #{cls_id}_operator_ne(const #{cls} *a, const #{cls} &b) {
30+ return !(*a == b);
31+ }
32+ CODE
33+ gsi::method_ext("==", &#{cls_id}_operator_eq, gsi::arg ("other"), "@brief Method bool #{cls}::operator==(const #{cls} &) const") +
34+ gsi::method_ext("!=", &#{cls_id}_operator_ne, gsi::arg ("other"), "@brief Method bool #{cls}::operator!=(const #{cls} &) const")
35+ DECL
36+ end
37+
38+ def add_native_operator_neqlt(engine, cls)
39+ cls_id = cls.gsub("::", "_")
40+ engine.drop_method cls, /::operator\s*==/
41+ engine.drop_method cls, /::operator\s*!=/
42+ engine.drop_method cls, /::operator\s*</
43+ engine.add_native_impl(cls, <<"CODE", <<"DECL")
44+ static bool #{cls_id}_operator_eq(const #{cls} *a, const #{cls} &b) {
45+ return *a == b;
46+ }
47+ static bool #{cls_id}_operator_ne(const #{cls} *a, const #{cls} &b) {
48+ return !(*a == b);
49+ }
50+ static bool #{cls_id}_operator_lt(const #{cls} *a, const #{cls} &b) {
51+ return *a < b;
52+ }
53+ CODE
54+ gsi::method_ext("==", &#{cls_id}_operator_eq, gsi::arg ("other"), "@brief Method bool #{cls}::operator==(const #{cls} &) const") +
55+ gsi::method_ext("!=", &#{cls_id}_operator_ne, gsi::arg ("other"), "@brief Method bool #{cls}::operator!=(const #{cls} &) const") +
56+ gsi::method_ext("<", &#{cls_id}_operator_lt, gsi::arg ("other"), "@brief Method bool #{cls}::operator<(const #{cls} &) const")
57+ DECL
58+ end
59+
60+ def add_native_operator_cmp(engine, cls)
61+ cls_id = cls.gsub("::", "_")
62+ engine.drop_method cls, /::operator\s*==/
63+ engine.drop_method cls, /::operator\s*!=/
64+ engine.drop_method cls, /::operator\s*</
65+ engine.drop_method cls, /::operator\s*<=/
66+ engine.drop_method cls, /::operator\s*>/
67+ engine.drop_method cls, /::operator\s*>=/
68+ engine.add_native_impl(cls, <<"CODE", <<"DECL")
69+ static bool #{cls_id}_operator_eq(const #{cls} *a, const #{cls} &b) {
70+ return *a == b;
71+ }
72+ static bool #{cls_id}_operator_ne(const #{cls} *a, const #{cls} &b) {
73+ return *a != b;
74+ }
75+ static bool #{cls_id}_operator_le(const #{cls} *a, const #{cls} &b) {
76+ return *a <= b;
77+ }
78+ static bool #{cls_id}_operator_lt(const #{cls} *a, const #{cls} &b) {
79+ return *a < b;
80+ }
81+ static bool #{cls_id}_operator_ge(const #{cls} *a, const #{cls} &b) {
82+ return *a >= b;
83+ }
84+ static bool #{cls_id}_operator_gt(const #{cls} *a, const #{cls} &b) {
85+ return *a > b;
86+ }
87+ CODE
88+ gsi::method_ext("==", &#{cls_id}_operator_eq, gsi::arg ("other"), "@brief Method bool #{cls}::operator==(const #{cls} &) const") +
89+ gsi::method_ext("!=", &#{cls_id}_operator_ne, gsi::arg ("other"), "@brief Method bool #{cls}::operator!=(const #{cls} &) const") +
90+ gsi::method_ext("<=", &#{cls_id}_operator_le, gsi::arg ("other"), "@brief Method bool #{cls}::operator<=(const #{cls} &) const") +
91+ gsi::method_ext("<", &#{cls_id}_operator_lt, gsi::arg ("other"), "@brief Method bool #{cls}::operator<(const #{cls} &) const") +
92+ gsi::method_ext(">=", &#{cls_id}_operator_ge, gsi::arg ("other"), "@brief Method bool #{cls}::operator>=(const #{cls} &) const") +
93+ gsi::method_ext(">", &#{cls_id}_operator_gt, gsi::arg ("other"), "@brief Method bool #{cls}::operator>(const #{cls} &) const")
94+ DECL
95+ end
96+
2197# --------------------------------------------------------------
2298# all modules
2399
@@ -460,8 +536,6 @@ drop_method "QTextCodec", /QTextCodec::codecForName\(const\s+QByteArray/ # clash
460536drop_method "QTextCodec", /QTextCodec::toUnicode\(const\s+QByteArray/ # clashes with const char * variant
461537drop_method "QTextCodec", /QTextCodec::fromUnicode\(const\s+QChar\s+\*/ # requires real QChar *
462538drop_method "QTextEncoder", /QTextEncoder::fromUnicode\(const\s+QChar\s+\*/ # requires real QChar *
463- drop_method "QTimeZone", /::operator\s*==/ # no longer supported on Qt 6.7
464- drop_method "QTimeZone", /::operator\s*!=/ # no longer supported on Qt 6.7
465539drop_method "", /::operator\s*==\(const\s+QVariant\s*&\w+,\s*const\s+QVariantComparisonHelper/ # requires QVariantComparisonHelper
466540drop_method "", /::operator\s*!=\(const\s+QVariant\s*&\w+,\s*const\s+QVariantComparisonHelper/ # requires QVariantComparisonHelper
467541drop_method "QByteArrayMatcher", /QByteArrayMatcher::indexIn\(const\s+QByteArray/ # clashes with const char * variant
@@ -473,6 +547,33 @@ drop_method "QDebug", /QDebug::operator\s*<<\((?!const\s+QString\s*&)/ # don't m
473547drop_method "", /::operator\s*<<\(QDebug\s*\w*\s*,\s*(?!const\s+QString\s*&)/ # don't map the others right now - too many (TODO: how to map?)
474548drop_method "QNoDebug", /QNoDebug::operator<</ # nothing usable (TODO: how to map?)
475549
550+ # No longer supported operator== and operator!= in Qt 6.7/6.8
551+ add_native_operator_neq(self, "QEasingCurve")
552+ add_native_operator_neq(self, "QTimeZone")
553+ add_native_operator_neq(self, "QDir")
554+ add_native_operator_neq(self, "QFileInfo")
555+ add_native_operator_neq(self, "QItemSelectionRange")
556+ add_native_operator_neq(self, "QJsonArray")
557+ add_native_operator_cmp(self, "QJsonArray::iterator")
558+ add_native_operator_neq(self, "QJsonDocument")
559+ add_native_operator_neq(self, "QJsonObject")
560+ add_native_operator_cmp(self, "QJsonObject::iterator")
561+ add_native_operator_neq(self, "QJsonValue")
562+ add_native_operator_neq(self, "QJsonValueRef")
563+ add_native_operator_neq(self, "QLine")
564+ add_native_operator_neq(self, "QLineF")
565+ add_native_operator_neq(self, "QMimeType")
566+ add_native_operator_neqlt(self, "QModelIndex")
567+ add_native_operator_neqlt(self, "QPersistentModelIndex")
568+ add_native_operator_neq(self, "QProcessEnvironment")
569+ add_native_operator_neq(self, "QRegularExpression")
570+ add_native_operator_neqlt(self, "QUrl")
571+ add_native_operator_neq(self, "QUrlQuery")
572+ add_native_operator_neq(self, "QXmlStreamAttribute")
573+ add_native_operator_neq(self, "QXmlStreamEntityDeclaration")
574+ add_native_operator_neq(self, "QXmlStreamNamespaceDeclaration")
575+ add_native_operator_neq(self, "QXmlStreamNotationDeclaration")
576+
476577include "QCoreApplication", [ "<QCoreApplication>", "<QAbstractEventDispatcher>", "<QAbstractNativeEventFilter>", "<QTranslator>" ]
477578include "QThread", [ "<QThread>", "<QAbstractEventDispatcher>" ]
478579
@@ -551,6 +652,7 @@ no_default_ctor "QModelRoleData"
551652no_default_ctor "QPartialOrdering"
552653no_default_ctor "QOperatingSystemVersion"
553654no_default_ctor "QStringConverter"
655+ no_default_ctor "QStringConverterBase"
554656
555657drop_method "QMessageLogger", /QMessageLogger::critical.*\.\.\./ # does not support ...
556658drop_method "QMessageLogger", /QMessageLogger::debug.*\.\.\./ # does not support ...
0 commit comments