Skip to content

Commit ae7a847

Browse files
committed
Fix PythonQt build under Qt 6.9
- add Qt 6.9 to CI
1 parent efb3f7c commit ae7a847

File tree

4 files changed

+57
-45
lines changed

4 files changed

+57
-45
lines changed

.github/workflows/build_latest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
os: ['ubuntu', 'windows']
23-
qt-version: [ '5.12.*', '5.15.*', '6.7.*', '6.8.*' ]
23+
qt-version: [ '5.12.*', '5.15.*', '6.8.*', '6.9.*' ]
2424
python-version: [ '3.12' ]
2525
runs-on: ${{ matrix.os }}-latest
2626
steps:
@@ -36,7 +36,7 @@ jobs:
3636
with:
3737
version: ${{ matrix.qt-version }}
3838
modules: ${{startsWith(matrix.qt-version, '6') && 'qt5compat qtscxml qtpositioning qtwebchannel qtmultimedia qtwebengine' || '' }}
39-
arch: ${{ (matrix.os == 'ubuntu' && (startsWith(matrix.qt-version, '5') && 'gcc_64' || 'linux_gcc_64')) || startsWith(matrix.qt-version, '5.12') && 'win64_msvc2017_64' || startsWith(matrix.qt-version, '6.8') && 'win64_msvc2022_64' || 'win64_msvc2019_64' }}
39+
arch: ${{ (matrix.os == 'ubuntu' && (startsWith(matrix.qt-version, '5') && 'gcc_64' || 'linux_gcc_64')) || startsWith(matrix.qt-version, '5.12') && 'win64_msvc2017_64' || startsWith(matrix.qt-version, '6') && 'win64_msvc2022_64' || 'win64_msvc2019_64' }}
4040

4141
- name: Setup Python ${{ matrix.python-version }}
4242
uses: actions/setup-python@v5

generator/shellgenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ void ShellGenerator::writeFunctionArguments(QTextStream &s,
199199
if (pos > 0) {
200200
QString typeName = expr.left(pos);
201201
AbstractMetaEnum* enumType = findEnumTypeOfClass(_currentScope, typeName);
202-
if (enumType && enumType->typeEntry()->isEnumClass()) {
202+
if (enumType) {
203203
// prepend original class name, otherwise the new enum type from the wrapper will be used,
204204
// which is not compatible
205205
qualifier = _currentScope->name();

generator/typesystem_core.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@
239239
<primitive-type name="qptrdiff"/>
240240
<primitive-type name="qsizetype"/>
241241
<primitive-type name="Qt::Disambiguated_t"/>
242-
242+
243243
<rejection class="qfloat16"/> <!-- only used in QRgbaFloat template and QCborStreamReader/Writer so far -->
244244

245245
<value-type name="QModelIndex"/>
@@ -1133,6 +1133,14 @@ public:
11331133
</inject-code>
11341134
</value-type>
11351135

1136+
<value-type name="QJsonValue" since-version="6.9">
1137+
<!-- workaround to handle using declaration for an enum in another class -->
1138+
<!-- (currently not handled by the generator, handling needs to be added if this happens more often) -->
1139+
<inject-code class="pywrap-h">
1140+
public:
1141+
using JsonFormat = QJsonDocument::JsonFormat;
1142+
</inject-code>
1143+
</value-type>
11361144

11371145
<value-type name="QBitArray">
11381146
<modify-function signature="operator[](int)" remove="all"/>
@@ -2053,7 +2061,7 @@ public:
20532061
</inject-code>
20542062
</object-type>
20552063
<rejection class="QCborStreamReader::StringResult" since-version="6.7"/>
2056-
2064+
20572065
<object-type name="QCborValue" since-version="5.12">
20582066
<modify-function signature="QCborValue(QCborTag, const QCborValue&amp;)" remove="all"/>
20592067
<modify-function signature="tag(QCborTag)const" remove="all"/>

0 commit comments

Comments
 (0)