Skip to content

Commit 99008f4

Browse files
Merge pull request #1988 from KLayout/bugfix/issue-1987
Bugfix/issue 1987
2 parents 2b494d1 + cb0b0ba commit 99008f4

28 files changed

+375
-1240
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
mv ./wheelhouse/.ccache $HOST_CCACHE_DIR
7777
ls -la $HOST_CCACHE_DIR
7878
ccache -s
79-
- uses: actions/upload-artifact@v3
79+
- uses: actions/upload-artifact@v4
8080
with:
8181
path: ./wheelhouse/*.whl
8282

@@ -90,7 +90,7 @@ jobs:
9090
- name: Build SDist
9191
run: pipx run build --sdist
9292

93-
- uses: actions/upload-artifact@v3
93+
- uses: actions/upload-artifact@v4
9494
with:
9595
path: dist/*.tar.gz
9696

scripts/mkqtdecl6/mkqtdecl.conf

Lines changed: 104 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,82 @@
1818

1919
load(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
460536
drop_method "QTextCodec", /QTextCodec::toUnicode\(const\s+QByteArray/ # clashes with const char * variant
461537
drop_method "QTextCodec", /QTextCodec::fromUnicode\(const\s+QChar\s+\*/ # requires real QChar *
462538
drop_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
465539
drop_method "", /::operator\s*==\(const\s+QVariant\s*&\w+,\s*const\s+QVariantComparisonHelper/ # requires QVariantComparisonHelper
466540
drop_method "", /::operator\s*!=\(const\s+QVariant\s*&\w+,\s*const\s+QVariantComparisonHelper/ # requires QVariantComparisonHelper
467541
drop_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
473547
drop_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?)
474548
drop_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+
476577
include "QCoreApplication", [ "<QCoreApplication>", "<QAbstractEventDispatcher>", "<QAbstractNativeEventFilter>", "<QTranslator>" ]
477578
include "QThread", [ "<QThread>", "<QAbstractEventDispatcher>" ]
478579

@@ -551,6 +652,7 @@ no_default_ctor "QModelRoleData"
551652
no_default_ctor "QPartialOrdering"
552653
no_default_ctor "QOperatingSystemVersion"
553654
no_default_ctor "QStringConverter"
655+
no_default_ctor "QStringConverterBase"
554656

555657
drop_method "QMessageLogger", /QMessageLogger::critical.*\.\.\./ # does not support ...
556658
drop_method "QMessageLogger", /QMessageLogger::debug.*\.\.\./ # does not support ...

src/gsiqt/qt6/QtCore/gsiDeclQDir.cc

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535

3636
// -----------------------------------------------------------------------
3737
// class QDir
38+
static bool QDir_operator_eq(const QDir *a, const QDir &b) {
39+
return *a == b;
40+
}
41+
static bool QDir_operator_ne(const QDir *a, const QDir &b) {
42+
return !(*a == b);
43+
}
3844

3945
// Constructor QDir::QDir(const QDir &)
4046

@@ -524,25 +530,6 @@ static void _call_f_nameFilters_c0 (const qt_gsi::GenericMethod * /*decl*/, void
524530
}
525531

526532

527-
// bool QDir::operator!=(const QDir &dir)
528-
529-
530-
static void _init_f_operator_excl__eq__c1681 (qt_gsi::GenericMethod *decl)
531-
{
532-
static gsi::ArgSpecBase argspec_0 ("dir");
533-
decl->add_arg<const QDir & > (argspec_0);
534-
decl->set_return<bool > ();
535-
}
536-
537-
static void _call_f_operator_excl__eq__c1681 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
538-
{
539-
__SUPPRESS_UNUSED_WARNING(args);
540-
tl::Heap heap;
541-
const QDir &arg1 = gsi::arg_reader<const QDir & >() (args, heap);
542-
ret.write<bool > ((bool)((QDir *)cls)->operator!= (arg1));
543-
}
544-
545-
546533
// QDir &QDir::operator=(const QDir &)
547534

548535

@@ -562,25 +549,6 @@ static void _call_f_operator_eq__1681 (const qt_gsi::GenericMethod * /*decl*/, v
562549
}
563550

564551

565-
// bool QDir::operator==(const QDir &dir)
566-
567-
568-
static void _init_f_operator_eq__eq__c1681 (qt_gsi::GenericMethod *decl)
569-
{
570-
static gsi::ArgSpecBase argspec_0 ("dir");
571-
decl->add_arg<const QDir & > (argspec_0);
572-
decl->set_return<bool > ();
573-
}
574-
575-
static void _call_f_operator_eq__eq__c1681 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
576-
{
577-
__SUPPRESS_UNUSED_WARNING(args);
578-
tl::Heap heap;
579-
const QDir &arg1 = gsi::arg_reader<const QDir & >() (args, heap);
580-
ret.write<bool > ((bool)((QDir *)cls)->operator== (arg1));
581-
}
582-
583-
584552
// QString QDir::operator[](int)
585553

586554

@@ -1299,9 +1267,7 @@ static gsi::Methods methods_QDir () {
12991267
methods += new qt_gsi::GenericMethod ("mkdir", "@brief Method bool QDir::mkdir(const QString &dirName)\n", true, &_init_f_mkdir_c2025, &_call_f_mkdir_c2025);
13001268
methods += new qt_gsi::GenericMethod ("mkpath", "@brief Method bool QDir::mkpath(const QString &dirPath)\n", true, &_init_f_mkpath_c2025, &_call_f_mkpath_c2025);
13011269
methods += new qt_gsi::GenericMethod (":nameFilters", "@brief Method QStringList QDir::nameFilters()\n", true, &_init_f_nameFilters_c0, &_call_f_nameFilters_c0);
1302-
methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QDir::operator!=(const QDir &dir)\n", true, &_init_f_operator_excl__eq__c1681, &_call_f_operator_excl__eq__c1681);
13031270
methods += new qt_gsi::GenericMethod ("assign", "@brief Method QDir &QDir::operator=(const QDir &)\n", false, &_init_f_operator_eq__1681, &_call_f_operator_eq__1681);
1304-
methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QDir::operator==(const QDir &dir)\n", true, &_init_f_operator_eq__eq__c1681, &_call_f_operator_eq__eq__c1681);
13051271
methods += new qt_gsi::GenericMethod ("[]", "@brief Method QString QDir::operator[](int)\n", true, &_init_f_operator_index__c767, &_call_f_operator_index__c767);
13061272
methods += new qt_gsi::GenericMethod (":path", "@brief Method QString QDir::path()\n", true, &_init_f_path_c0, &_call_f_path_c0);
13071273
methods += new qt_gsi::GenericMethod ("refresh", "@brief Method void QDir::refresh()\n", true, &_init_f_refresh_c0, &_call_f_refresh_c0);
@@ -1344,6 +1310,9 @@ static gsi::Methods methods_QDir () {
13441310
}
13451311

13461312
gsi::Class<QDir> decl_QDir ("QtCore", "QDir",
1313+
gsi::method_ext("==", &QDir_operator_eq, gsi::arg ("other"), "@brief Method bool QDir::operator==(const QDir &) const") +
1314+
gsi::method_ext("!=", &QDir_operator_ne, gsi::arg ("other"), "@brief Method bool QDir::operator!=(const QDir &) const")
1315+
+
13471316
methods_QDir (),
13481317
"@qt\n@brief Binding of QDir");
13491318

src/gsiqt/qt6/QtCore/gsiDeclQEasingCurve.cc

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535

3636
// -----------------------------------------------------------------------
3737
// class QEasingCurve
38+
static bool QEasingCurve_operator_eq(const QEasingCurve *a, const QEasingCurve &b) {
39+
return *a == b;
40+
}
41+
static bool QEasingCurve_operator_ne(const QEasingCurve *a, const QEasingCurve &b) {
42+
return !(*a == b);
43+
}
3844

3945
// Constructor QEasingCurve::QEasingCurve(QEasingCurve::Type type)
4046

@@ -144,25 +150,6 @@ static void _call_f_amplitude_c0 (const qt_gsi::GenericMethod * /*decl*/, void *
144150
}
145151

146152

147-
// bool QEasingCurve::operator!=(const QEasingCurve &other)
148-
149-
150-
static void _init_f_operator_excl__eq__c2510 (qt_gsi::GenericMethod *decl)
151-
{
152-
static gsi::ArgSpecBase argspec_0 ("other");
153-
decl->add_arg<const QEasingCurve & > (argspec_0);
154-
decl->set_return<bool > ();
155-
}
156-
157-
static void _call_f_operator_excl__eq__c2510 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
158-
{
159-
__SUPPRESS_UNUSED_WARNING(args);
160-
tl::Heap heap;
161-
const QEasingCurve &arg1 = gsi::arg_reader<const QEasingCurve & >() (args, heap);
162-
ret.write<bool > ((bool)((QEasingCurve *)cls)->operator!= (arg1));
163-
}
164-
165-
166153
// QEasingCurve &QEasingCurve::operator=(const QEasingCurve &other)
167154

168155

@@ -182,25 +169,6 @@ static void _call_f_operator_eq__2510 (const qt_gsi::GenericMethod * /*decl*/, v
182169
}
183170

184171

185-
// bool QEasingCurve::operator==(const QEasingCurve &other)
186-
187-
188-
static void _init_f_operator_eq__eq__c2510 (qt_gsi::GenericMethod *decl)
189-
{
190-
static gsi::ArgSpecBase argspec_0 ("other");
191-
decl->add_arg<const QEasingCurve & > (argspec_0);
192-
decl->set_return<bool > ();
193-
}
194-
195-
static void _call_f_operator_eq__eq__c2510 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
196-
{
197-
__SUPPRESS_UNUSED_WARNING(args);
198-
tl::Heap heap;
199-
const QEasingCurve &arg1 = gsi::arg_reader<const QEasingCurve & >() (args, heap);
200-
ret.write<bool > ((bool)((QEasingCurve *)cls)->operator== (arg1));
201-
}
202-
203-
204172
// double QEasingCurve::overshoot()
205173

206174

@@ -391,9 +359,7 @@ static gsi::Methods methods_QEasingCurve () {
391359
methods += new qt_gsi::GenericMethod ("addCubicBezierSegment", "@brief Method void QEasingCurve::addCubicBezierSegment(const QPointF &c1, const QPointF &c2, const QPointF &endPoint)\n", false, &_init_f_addCubicBezierSegment_5742, &_call_f_addCubicBezierSegment_5742);
392360
methods += new qt_gsi::GenericMethod ("addTCBSegment", "@brief Method void QEasingCurve::addTCBSegment(const QPointF &nextPoint, double t, double c, double b)\n", false, &_init_f_addTCBSegment_4875, &_call_f_addTCBSegment_4875);
393361
methods += new qt_gsi::GenericMethod (":amplitude", "@brief Method double QEasingCurve::amplitude()\n", true, &_init_f_amplitude_c0, &_call_f_amplitude_c0);
394-
methods += new qt_gsi::GenericMethod ("!=", "@brief Method bool QEasingCurve::operator!=(const QEasingCurve &other)\n", true, &_init_f_operator_excl__eq__c2510, &_call_f_operator_excl__eq__c2510);
395362
methods += new qt_gsi::GenericMethod ("assign", "@brief Method QEasingCurve &QEasingCurve::operator=(const QEasingCurve &other)\n", false, &_init_f_operator_eq__2510, &_call_f_operator_eq__2510);
396-
methods += new qt_gsi::GenericMethod ("==", "@brief Method bool QEasingCurve::operator==(const QEasingCurve &other)\n", true, &_init_f_operator_eq__eq__c2510, &_call_f_operator_eq__eq__c2510);
397363
methods += new qt_gsi::GenericMethod (":overshoot", "@brief Method double QEasingCurve::overshoot()\n", true, &_init_f_overshoot_c0, &_call_f_overshoot_c0);
398364
methods += new qt_gsi::GenericMethod (":period", "@brief Method double QEasingCurve::period()\n", true, &_init_f_period_c0, &_call_f_period_c0);
399365
methods += new qt_gsi::GenericMethod ("setAmplitude|amplitude=", "@brief Method void QEasingCurve::setAmplitude(double amplitude)\n", false, &_init_f_setAmplitude_1071, &_call_f_setAmplitude_1071);
@@ -408,6 +374,9 @@ static gsi::Methods methods_QEasingCurve () {
408374
}
409375

410376
gsi::Class<QEasingCurve> decl_QEasingCurve ("QtCore", "QEasingCurve",
377+
gsi::method_ext("==", &QEasingCurve_operator_eq, gsi::arg ("other"), "@brief Method bool QEasingCurve::operator==(const QEasingCurve &) const") +
378+
gsi::method_ext("!=", &QEasingCurve_operator_ne, gsi::arg ("other"), "@brief Method bool QEasingCurve::operator!=(const QEasingCurve &) const")
379+
+
411380
methods_QEasingCurve (),
412381
"@qt\n@brief Binding of QEasingCurve");
413382

0 commit comments

Comments
 (0)