Skip to content

Commit

Permalink
Merge pull request #1988 from KLayout/bugfix/issue-1987
Browse files Browse the repository at this point in the history
Bugfix/issue 1987
  • Loading branch information
klayoutmatthias authored Feb 23, 2025
2 parents 2b494d1 + cb0b0ba commit 99008f4
Show file tree
Hide file tree
Showing 28 changed files with 375 additions and 1,240 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
mv ./wheelhouse/.ccache $HOST_CCACHE_DIR
ls -la $HOST_CCACHE_DIR
ccache -s
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl

Expand All @@ -90,7 +90,7 @@ jobs:
- name: Build SDist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz

Expand Down
106 changes: 104 additions & 2 deletions scripts/mkqtdecl6/mkqtdecl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,82 @@

load(File.join(File.dirname(__FILE__), "common.conf"))

def add_native_operator_neq(engine, cls)
cls_id = cls.gsub("::", "_")
engine.drop_method cls, /::operator\s*==/
engine.drop_method cls, /::operator\s*!=/
engine.add_native_impl(cls, <<"CODE", <<"DECL")
static bool #{cls_id}_operator_eq(const #{cls} *a, const #{cls} &b) {
return *a == b;
}
static bool #{cls_id}_operator_ne(const #{cls} *a, const #{cls} &b) {
return !(*a == b);
}
CODE
gsi::method_ext("==", &#{cls_id}_operator_eq, gsi::arg ("other"), "@brief Method bool #{cls}::operator==(const #{cls} &) const") +
gsi::method_ext("!=", &#{cls_id}_operator_ne, gsi::arg ("other"), "@brief Method bool #{cls}::operator!=(const #{cls} &) const")
DECL
end

def add_native_operator_neqlt(engine, cls)
cls_id = cls.gsub("::", "_")
engine.drop_method cls, /::operator\s*==/
engine.drop_method cls, /::operator\s*!=/
engine.drop_method cls, /::operator\s*</
engine.add_native_impl(cls, <<"CODE", <<"DECL")
static bool #{cls_id}_operator_eq(const #{cls} *a, const #{cls} &b) {
return *a == b;
}
static bool #{cls_id}_operator_ne(const #{cls} *a, const #{cls} &b) {
return !(*a == b);
}
static bool #{cls_id}_operator_lt(const #{cls} *a, const #{cls} &b) {
return *a < b;
}
CODE
gsi::method_ext("==", &#{cls_id}_operator_eq, gsi::arg ("other"), "@brief Method bool #{cls}::operator==(const #{cls} &) const") +
gsi::method_ext("!=", &#{cls_id}_operator_ne, gsi::arg ("other"), "@brief Method bool #{cls}::operator!=(const #{cls} &) const") +
gsi::method_ext("<", &#{cls_id}_operator_lt, gsi::arg ("other"), "@brief Method bool #{cls}::operator<(const #{cls} &) const")
DECL
end

def add_native_operator_cmp(engine, cls)
cls_id = cls.gsub("::", "_")
engine.drop_method cls, /::operator\s*==/
engine.drop_method cls, /::operator\s*!=/
engine.drop_method cls, /::operator\s*</
engine.drop_method cls, /::operator\s*<=/
engine.drop_method cls, /::operator\s*>/
engine.drop_method cls, /::operator\s*>=/
engine.add_native_impl(cls, <<"CODE", <<"DECL")
static bool #{cls_id}_operator_eq(const #{cls} *a, const #{cls} &b) {
return *a == b;
}
static bool #{cls_id}_operator_ne(const #{cls} *a, const #{cls} &b) {
return *a != b;
}
static bool #{cls_id}_operator_le(const #{cls} *a, const #{cls} &b) {
return *a <= b;
}
static bool #{cls_id}_operator_lt(const #{cls} *a, const #{cls} &b) {
return *a < b;
}
static bool #{cls_id}_operator_ge(const #{cls} *a, const #{cls} &b) {
return *a >= b;
}
static bool #{cls_id}_operator_gt(const #{cls} *a, const #{cls} &b) {
return *a > b;
}
CODE
gsi::method_ext("==", &#{cls_id}_operator_eq, gsi::arg ("other"), "@brief Method bool #{cls}::operator==(const #{cls} &) const") +
gsi::method_ext("!=", &#{cls_id}_operator_ne, gsi::arg ("other"), "@brief Method bool #{cls}::operator!=(const #{cls} &) const") +
gsi::method_ext("<=", &#{cls_id}_operator_le, gsi::arg ("other"), "@brief Method bool #{cls}::operator<=(const #{cls} &) const") +
gsi::method_ext("<", &#{cls_id}_operator_lt, gsi::arg ("other"), "@brief Method bool #{cls}::operator<(const #{cls} &) const") +
gsi::method_ext(">=", &#{cls_id}_operator_ge, gsi::arg ("other"), "@brief Method bool #{cls}::operator>=(const #{cls} &) const") +
gsi::method_ext(">", &#{cls_id}_operator_gt, gsi::arg ("other"), "@brief Method bool #{cls}::operator>(const #{cls} &) const")
DECL
end

# --------------------------------------------------------------
# all modules

Expand Down Expand Up @@ -460,8 +536,6 @@ drop_method "QTextCodec", /QTextCodec::codecForName\(const\s+QByteArray/ # clash
drop_method "QTextCodec", /QTextCodec::toUnicode\(const\s+QByteArray/ # clashes with const char * variant
drop_method "QTextCodec", /QTextCodec::fromUnicode\(const\s+QChar\s+\*/ # requires real QChar *
drop_method "QTextEncoder", /QTextEncoder::fromUnicode\(const\s+QChar\s+\*/ # requires real QChar *
drop_method "QTimeZone", /::operator\s*==/ # no longer supported on Qt 6.7
drop_method "QTimeZone", /::operator\s*!=/ # no longer supported on Qt 6.7
drop_method "", /::operator\s*==\(const\s+QVariant\s*&\w+,\s*const\s+QVariantComparisonHelper/ # requires QVariantComparisonHelper
drop_method "", /::operator\s*!=\(const\s+QVariant\s*&\w+,\s*const\s+QVariantComparisonHelper/ # requires QVariantComparisonHelper
drop_method "QByteArrayMatcher", /QByteArrayMatcher::indexIn\(const\s+QByteArray/ # clashes with const char * variant
Expand All @@ -473,6 +547,33 @@ drop_method "QDebug", /QDebug::operator\s*<<\((?!const\s+QString\s*&)/ # don't m
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?)
drop_method "QNoDebug", /QNoDebug::operator<</ # nothing usable (TODO: how to map?)

# No longer supported operator== and operator!= in Qt 6.7/6.8
add_native_operator_neq(self, "QEasingCurve")
add_native_operator_neq(self, "QTimeZone")
add_native_operator_neq(self, "QDir")
add_native_operator_neq(self, "QFileInfo")
add_native_operator_neq(self, "QItemSelectionRange")
add_native_operator_neq(self, "QJsonArray")
add_native_operator_cmp(self, "QJsonArray::iterator")
add_native_operator_neq(self, "QJsonDocument")
add_native_operator_neq(self, "QJsonObject")
add_native_operator_cmp(self, "QJsonObject::iterator")
add_native_operator_neq(self, "QJsonValue")
add_native_operator_neq(self, "QJsonValueRef")
add_native_operator_neq(self, "QLine")
add_native_operator_neq(self, "QLineF")
add_native_operator_neq(self, "QMimeType")
add_native_operator_neqlt(self, "QModelIndex")
add_native_operator_neqlt(self, "QPersistentModelIndex")
add_native_operator_neq(self, "QProcessEnvironment")
add_native_operator_neq(self, "QRegularExpression")
add_native_operator_neqlt(self, "QUrl")
add_native_operator_neq(self, "QUrlQuery")
add_native_operator_neq(self, "QXmlStreamAttribute")
add_native_operator_neq(self, "QXmlStreamEntityDeclaration")
add_native_operator_neq(self, "QXmlStreamNamespaceDeclaration")
add_native_operator_neq(self, "QXmlStreamNotationDeclaration")

include "QCoreApplication", [ "<QCoreApplication>", "<QAbstractEventDispatcher>", "<QAbstractNativeEventFilter>", "<QTranslator>" ]
include "QThread", [ "<QThread>", "<QAbstractEventDispatcher>" ]

Expand Down Expand Up @@ -551,6 +652,7 @@ no_default_ctor "QModelRoleData"
no_default_ctor "QPartialOrdering"
no_default_ctor "QOperatingSystemVersion"
no_default_ctor "QStringConverter"
no_default_ctor "QStringConverterBase"

drop_method "QMessageLogger", /QMessageLogger::critical.*\.\.\./ # does not support ...
drop_method "QMessageLogger", /QMessageLogger::debug.*\.\.\./ # does not support ...
Expand Down
49 changes: 9 additions & 40 deletions src/gsiqt/qt6/QtCore/gsiDeclQDir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@

// -----------------------------------------------------------------------
// class QDir
static bool QDir_operator_eq(const QDir *a, const QDir &b) {
return *a == b;
}
static bool QDir_operator_ne(const QDir *a, const QDir &b) {
return !(*a == b);
}

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

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


// bool QDir::operator!=(const QDir &dir)


static void _init_f_operator_excl__eq__c1681 (qt_gsi::GenericMethod *decl)
{
static gsi::ArgSpecBase argspec_0 ("dir");
decl->add_arg<const QDir & > (argspec_0);
decl->set_return<bool > ();
}

static void _call_f_operator_excl__eq__c1681 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
{
__SUPPRESS_UNUSED_WARNING(args);
tl::Heap heap;
const QDir &arg1 = gsi::arg_reader<const QDir & >() (args, heap);
ret.write<bool > ((bool)((QDir *)cls)->operator!= (arg1));
}


// QDir &QDir::operator=(const QDir &)


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


// bool QDir::operator==(const QDir &dir)


static void _init_f_operator_eq__eq__c1681 (qt_gsi::GenericMethod *decl)
{
static gsi::ArgSpecBase argspec_0 ("dir");
decl->add_arg<const QDir & > (argspec_0);
decl->set_return<bool > ();
}

static void _call_f_operator_eq__eq__c1681 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
{
__SUPPRESS_UNUSED_WARNING(args);
tl::Heap heap;
const QDir &arg1 = gsi::arg_reader<const QDir & >() (args, heap);
ret.write<bool > ((bool)((QDir *)cls)->operator== (arg1));
}


// QString QDir::operator[](int)


Expand Down Expand Up @@ -1299,9 +1267,7 @@ static gsi::Methods methods_QDir () {
methods += new qt_gsi::GenericMethod ("mkdir", "@brief Method bool QDir::mkdir(const QString &dirName)\n", true, &_init_f_mkdir_c2025, &_call_f_mkdir_c2025);
methods += new qt_gsi::GenericMethod ("mkpath", "@brief Method bool QDir::mkpath(const QString &dirPath)\n", true, &_init_f_mkpath_c2025, &_call_f_mkpath_c2025);
methods += new qt_gsi::GenericMethod (":nameFilters", "@brief Method QStringList QDir::nameFilters()\n", true, &_init_f_nameFilters_c0, &_call_f_nameFilters_c0);
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);
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);
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);
methods += new qt_gsi::GenericMethod ("[]", "@brief Method QString QDir::operator[](int)\n", true, &_init_f_operator_index__c767, &_call_f_operator_index__c767);
methods += new qt_gsi::GenericMethod (":path", "@brief Method QString QDir::path()\n", true, &_init_f_path_c0, &_call_f_path_c0);
methods += new qt_gsi::GenericMethod ("refresh", "@brief Method void QDir::refresh()\n", true, &_init_f_refresh_c0, &_call_f_refresh_c0);
Expand Down Expand Up @@ -1344,6 +1310,9 @@ static gsi::Methods methods_QDir () {
}

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

Expand Down
49 changes: 9 additions & 40 deletions src/gsiqt/qt6/QtCore/gsiDeclQEasingCurve.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@

// -----------------------------------------------------------------------
// class QEasingCurve
static bool QEasingCurve_operator_eq(const QEasingCurve *a, const QEasingCurve &b) {
return *a == b;
}
static bool QEasingCurve_operator_ne(const QEasingCurve *a, const QEasingCurve &b) {
return !(*a == b);
}

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

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


// bool QEasingCurve::operator!=(const QEasingCurve &other)


static void _init_f_operator_excl__eq__c2510 (qt_gsi::GenericMethod *decl)
{
static gsi::ArgSpecBase argspec_0 ("other");
decl->add_arg<const QEasingCurve & > (argspec_0);
decl->set_return<bool > ();
}

static void _call_f_operator_excl__eq__c2510 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
{
__SUPPRESS_UNUSED_WARNING(args);
tl::Heap heap;
const QEasingCurve &arg1 = gsi::arg_reader<const QEasingCurve & >() (args, heap);
ret.write<bool > ((bool)((QEasingCurve *)cls)->operator!= (arg1));
}


// QEasingCurve &QEasingCurve::operator=(const QEasingCurve &other)


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


// bool QEasingCurve::operator==(const QEasingCurve &other)


static void _init_f_operator_eq__eq__c2510 (qt_gsi::GenericMethod *decl)
{
static gsi::ArgSpecBase argspec_0 ("other");
decl->add_arg<const QEasingCurve & > (argspec_0);
decl->set_return<bool > ();
}

static void _call_f_operator_eq__eq__c2510 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
{
__SUPPRESS_UNUSED_WARNING(args);
tl::Heap heap;
const QEasingCurve &arg1 = gsi::arg_reader<const QEasingCurve & >() (args, heap);
ret.write<bool > ((bool)((QEasingCurve *)cls)->operator== (arg1));
}


// double QEasingCurve::overshoot()


Expand Down Expand Up @@ -391,9 +359,7 @@ static gsi::Methods methods_QEasingCurve () {
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);
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);
methods += new qt_gsi::GenericMethod (":amplitude", "@brief Method double QEasingCurve::amplitude()\n", true, &_init_f_amplitude_c0, &_call_f_amplitude_c0);
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);
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);
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);
methods += new qt_gsi::GenericMethod (":overshoot", "@brief Method double QEasingCurve::overshoot()\n", true, &_init_f_overshoot_c0, &_call_f_overshoot_c0);
methods += new qt_gsi::GenericMethod (":period", "@brief Method double QEasingCurve::period()\n", true, &_init_f_period_c0, &_call_f_period_c0);
methods += new qt_gsi::GenericMethod ("setAmplitude|amplitude=", "@brief Method void QEasingCurve::setAmplitude(double amplitude)\n", false, &_init_f_setAmplitude_1071, &_call_f_setAmplitude_1071);
Expand All @@ -408,6 +374,9 @@ static gsi::Methods methods_QEasingCurve () {
}

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

Expand Down
Loading

0 comments on commit 99008f4

Please sign in to comment.