Skip to content

Commit

Permalink
Merge pull request #91 from mappu/miqt-qt68
Browse files Browse the repository at this point in the history
Qt 6.8 compatibility
  • Loading branch information
mappu authored Nov 22, 2024
2 parents 75d562d + 3ec795d commit 45db3c6
Show file tree
Hide file tree
Showing 159 changed files with 649 additions and 639 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/miqt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,24 @@ jobs:
- name: Linux64 bindings compile
run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/linux64:qt64 /bin/bash -c 'cd qt6 && go build'

miqt_linux64_qt6_7:
miqt_linux64_qt6_8:
runs-on: ubuntu-24.04

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Linux64 docker build
run: docker build -t miqt/linux64:qt67 -f docker/linux64-go1.22-qt6.7-dynamic.Dockerfile .
run: docker build -t miqt/linux64:qt68 -f docker/linux64-go1.23-qt6.8-dynamic.Dockerfile .

- name: Cache GOCACHE
uses: actions/cache@v4
with:
path: ~/.cache/go-build
key: linux64-qt67-gocache
key: linux64-qt68-gocache

- name: Linux64 bindings compile
run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/linux64:qt67 /bin/bash -c 'cd qt6 && go build'
run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/linux64:qt68 /bin/bash -c 'cd qt6 && go build'

miqt_win64_qt5:
runs-on: ubuntu-24.04
Expand Down
5 changes: 5 additions & 0 deletions cmd/genbindings/config-allowlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ func AllowMethod(className string, mm CppMethod) error {
return ErrTooComplex
}

if className == "QXmlStreamEntityResolver" && mm.MethodName == "operator=" {
// Present in Qt 6.7, but marked as =delete by Q_DISABLE_COPY_MOVE in Qt 6.8
return ErrTooComplex
}

return nil // OK, allow
}

Expand Down
8 changes: 8 additions & 0 deletions cmd/genbindings/emitcabi.go
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,14 @@ func emitBindingCpp(src *CppParsedHeader, filename string) (string, error) {

callTarget += m.CppCallTarget() + "(" + forwarding + ")"

// Qt 6.8 moved many operator== implementations from class methods
// into global operators.
// By using infix syntax, either can be called
if m.IsReadonlyOperator() && len(m.Parameters) == 1 {
operator := m.CppCallTarget()[8:]
callTarget = "(*self " + operator + " " + forwarding + ")"
}

if m.LinuxOnly {
ret.WriteString(fmt.Sprintf(
"%s %s_%s(%s) {\n"+
Expand Down
10 changes: 10 additions & 0 deletions cmd/genbindings/intermediate.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,16 @@ func (nm CppMethod) SafeMethodName() string {
return tmp
}

func (nm CppMethod) IsReadonlyOperator() bool {
targ := nm.CppCallTarget()
switch targ {
case "operator==", "operator!=",
"operator<", "operator<=", "operator>", "operator>=":
return true
}
return false
}

type CppEnumEntry struct {
EntryName string
EntryValue string
Expand Down
5 changes: 5 additions & 0 deletions docker/linux64-go1.23-qt6.8-dynamic.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM fedora:41

RUN dnf -y --setopt=install_weak_deps=False install \
qt6-qtbase-devel.x86_64 \
golang.x86_64
10 changes: 5 additions & 5 deletions qt-extras/scintillaedit/gen_ScintillaEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ Scintilla__Internal__Point* Scintilla__Internal__Point_FromInts(int x_, int y_)
}

bool Scintilla__Internal__Point_OperatorEqual(const Scintilla__Internal__Point* self, Scintilla__Internal__Point* other) {
return self->operator==(*other);
return (*self == *other);
}

bool Scintilla__Internal__Point_OperatorNotEqual(const Scintilla__Internal__Point* self, Scintilla__Internal__Point* other) {
return self->operator!=(*other);
return (*self != *other);
}

Scintilla__Internal__Point* Scintilla__Internal__Point_OperatorPlus(const Scintilla__Internal__Point* self, Scintilla__Internal__Point* other) {
Expand All @@ -112,7 +112,7 @@ void Scintilla__Internal__Point_Delete(Scintilla__Internal__Point* self, bool is
}

bool Scintilla__Internal__Interval_OperatorEqual(const Scintilla__Internal__Interval* self, Scintilla__Internal__Interval* other) {
return self->operator==(*other);
return (*self == *other);
}

double Scintilla__Internal__Interval_Width(const Scintilla__Internal__Interval* self) {
Expand Down Expand Up @@ -175,7 +175,7 @@ Scintilla__Internal__PRectangle* Scintilla__Internal__PRectangle_FromInts(int le
}

bool Scintilla__Internal__PRectangle_OperatorEqual(const Scintilla__Internal__PRectangle* self, Scintilla__Internal__PRectangle* rc) {
return self->operator==(*rc);
return (*self == *rc);
}

bool Scintilla__Internal__PRectangle_Contains(const Scintilla__Internal__PRectangle* self, Scintilla__Internal__Point* pt) {
Expand Down Expand Up @@ -331,7 +331,7 @@ float Scintilla__Internal__ColourRGBA_GetAlphaComponent(const Scintilla__Interna
}

bool Scintilla__Internal__ColourRGBA_OperatorEqual(const Scintilla__Internal__ColourRGBA* self, Scintilla__Internal__ColourRGBA* other) {
return self->operator==(*other);
return (*self == *other);
}

bool Scintilla__Internal__ColourRGBA_IsOpaque(const Scintilla__Internal__ColourRGBA* self) {
Expand Down
54 changes: 27 additions & 27 deletions qt/cbor/gen_qcborarray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ int QCborArray_Compare(const QCborArray* self, QCborArray* other) {
}

bool QCborArray_OperatorEqual(const QCborArray* self, QCborArray* other) {
return self->operator==(*other);
return (*self == *other);
}

bool QCborArray_OperatorNotEqual(const QCborArray* self, QCborArray* other) {
return self->operator!=(*other);
return (*self != *other);
}

bool QCborArray_OperatorLesser(const QCborArray* self, QCborArray* other) {
return self->operator<(*other);
return (*self < *other);
}

QCborArray__Iterator* QCborArray_Begin(QCborArray* self) {
Expand Down Expand Up @@ -277,51 +277,51 @@ QCborValueRef* QCborArray__Iterator_OperatorSubscript(QCborArray__Iterator* self
}

bool QCborArray__Iterator_OperatorEqual(const QCborArray__Iterator* self, QCborArray__Iterator* o) {
return self->operator==(*o);
return (*self == *o);
}

bool QCborArray__Iterator_OperatorNotEqual(const QCborArray__Iterator* self, QCborArray__Iterator* o) {
return self->operator!=(*o);
return (*self != *o);
}

bool QCborArray__Iterator_OperatorLesser(const QCborArray__Iterator* self, QCborArray__Iterator* other) {
return self->operator<(*other);
return (*self < *other);
}

bool QCborArray__Iterator_OperatorLesserOrEqual(const QCborArray__Iterator* self, QCborArray__Iterator* other) {
return self->operator<=(*other);
return (*self <= *other);
}

bool QCborArray__Iterator_OperatorGreater(const QCborArray__Iterator* self, QCborArray__Iterator* other) {
return self->operator>(*other);
return (*self > *other);
}

bool QCborArray__Iterator_OperatorGreaterOrEqual(const QCborArray__Iterator* self, QCborArray__Iterator* other) {
return self->operator>=(*other);
return (*self >= *other);
}

bool QCborArray__Iterator_OperatorEqualWithQCborArrayConstIterator(const QCborArray__Iterator* self, QCborArray__ConstIterator* o) {
return self->operator==(*o);
return (*self == *o);
}

bool QCborArray__Iterator_OperatorNotEqualWithQCborArrayConstIterator(const QCborArray__Iterator* self, QCborArray__ConstIterator* o) {
return self->operator!=(*o);
return (*self != *o);
}

bool QCborArray__Iterator_OperatorLesserWithOther(const QCborArray__Iterator* self, QCborArray__ConstIterator* other) {
return self->operator<(*other);
return (*self < *other);
}

bool QCborArray__Iterator_OperatorLesserOrEqualWithOther(const QCborArray__Iterator* self, QCborArray__ConstIterator* other) {
return self->operator<=(*other);
return (*self <= *other);
}

bool QCborArray__Iterator_OperatorGreaterWithOther(const QCborArray__Iterator* self, QCborArray__ConstIterator* other) {
return self->operator>(*other);
return (*self > *other);
}

bool QCborArray__Iterator_OperatorGreaterOrEqualWithOther(const QCborArray__Iterator* self, QCborArray__ConstIterator* other) {
return self->operator>=(*other);
return (*self >= *other);
}

QCborArray__Iterator* QCborArray__Iterator_OperatorPlusPlus(QCborArray__Iterator* self) {
Expand Down Expand Up @@ -404,51 +404,51 @@ QCborValueRef* QCborArray__ConstIterator_OperatorSubscript(QCborArray__ConstIter
}

bool QCborArray__ConstIterator_OperatorEqual(const QCborArray__ConstIterator* self, QCborArray__Iterator* o) {
return self->operator==(*o);
return (*self == *o);
}

bool QCborArray__ConstIterator_OperatorNotEqual(const QCborArray__ConstIterator* self, QCborArray__Iterator* o) {
return self->operator!=(*o);
return (*self != *o);
}

bool QCborArray__ConstIterator_OperatorLesser(const QCborArray__ConstIterator* self, QCborArray__Iterator* other) {
return self->operator<(*other);
return (*self < *other);
}

bool QCborArray__ConstIterator_OperatorLesserOrEqual(const QCborArray__ConstIterator* self, QCborArray__Iterator* other) {
return self->operator<=(*other);
return (*self <= *other);
}

bool QCborArray__ConstIterator_OperatorGreater(const QCborArray__ConstIterator* self, QCborArray__Iterator* other) {
return self->operator>(*other);
return (*self > *other);
}

bool QCborArray__ConstIterator_OperatorGreaterOrEqual(const QCborArray__ConstIterator* self, QCborArray__Iterator* other) {
return self->operator>=(*other);
return (*self >= *other);
}

bool QCborArray__ConstIterator_OperatorEqualWithQCborArrayConstIterator(const QCborArray__ConstIterator* self, QCborArray__ConstIterator* o) {
return self->operator==(*o);
return (*self == *o);
}

bool QCborArray__ConstIterator_OperatorNotEqualWithQCborArrayConstIterator(const QCborArray__ConstIterator* self, QCborArray__ConstIterator* o) {
return self->operator!=(*o);
return (*self != *o);
}

bool QCborArray__ConstIterator_OperatorLesserWithOther(const QCborArray__ConstIterator* self, QCborArray__ConstIterator* other) {
return self->operator<(*other);
return (*self < *other);
}

bool QCborArray__ConstIterator_OperatorLesserOrEqualWithOther(const QCborArray__ConstIterator* self, QCborArray__ConstIterator* other) {
return self->operator<=(*other);
return (*self <= *other);
}

bool QCborArray__ConstIterator_OperatorGreaterWithOther(const QCborArray__ConstIterator* self, QCborArray__ConstIterator* other) {
return self->operator>(*other);
return (*self > *other);
}

bool QCborArray__ConstIterator_OperatorGreaterOrEqualWithOther(const QCborArray__ConstIterator* self, QCborArray__ConstIterator* other) {
return self->operator>=(*other);
return (*self >= *other);
}

QCborArray__ConstIterator* QCborArray__ConstIterator_OperatorPlusPlus(QCborArray__ConstIterator* self) {
Expand Down
Loading

0 comments on commit 45db3c6

Please sign in to comment.