Skip to content

Commit

Permalink
Qt 6.8 support (used on Windows x64)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelson-numerical-software committed Oct 9, 2024
1 parent 5ab929f commit 54d2330
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 14 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
brew install tbb
- name: Install Qt
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v4
with:
version: "6.4.2"
- name: Checkout
Expand Down Expand Up @@ -219,7 +219,7 @@ jobs:
brew install tbb
- name: Install Qt
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v4
with:
version: "6.4.2"
- name: Checkout
Expand Down Expand Up @@ -797,15 +797,15 @@ jobs:
python %GITHUB_WORKSPACE%/tools/update_version/update_version.py
- name: Install Qt 5.15.2
uses: jurplel/install-qt-action@v3
uses: jurplel/install-qt-action@v4
with:
version: "5.15.2"
host: "windows"
target: "desktop"
arch: "win32_msvc2019"
dir: "C:/install/QT5/"
install-deps: "true"
modules: "qtwebengine"
# modules: "qtwebengine"
cache: "false"
setup-python: "false"

Expand Down Expand Up @@ -910,16 +910,16 @@ jobs:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Install Qt 6.7.1
uses: jurplel/install-qt-action@v3
- name: Install Qt 6.8.0
uses: jurplel/install-qt-action@v4
with:
version: "6.7.1"
version: "6.8.0"
host: "windows"
target: "desktop"
arch: "win64_msvc2019_64"
arch: "win64_msvc2022_64"
dir: "C:/install/QT6/"
install-deps: "true"
modules: "qtwebengine"
# modules: "qtwebengine"
cache: "false"
setup-python: "false"

Expand Down Expand Up @@ -950,7 +950,7 @@ jobs:
- name: Install dependencies
run: |
set QTDIR64=C:\install\QT6\Qt\6.7.1\msvc2019_64
set QTDIR64=C:\install\QT6\Qt\6.8.0\msvc2019_64
set QTDIR=%QTDIR64%
cd ..
git clone https://github.com/nelson-lang/nelson-thirdparty-x64.git
Expand All @@ -961,7 +961,7 @@ jobs:
- name: Build Nelson
run: |
set QTDIR64=C:\install\QT6\Qt\6.7.1\msvc2019_64
set QTDIR64=C:\install\QT6\Qt\6.8.0\msvc2019_64
set QTDIR=%QTDIR64%
SET PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\current\Bin\;C:\Program Files (x86)\Inno Setup 6;%PATH%
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- `end` magic keyword can be overloaded for classes (applied to `table` class).

- [#1250](http://github.com/nelson-lang/nelson/issues/1250) `head`, `tail` functions for table and array.

### Changed

- Qt 6.8 LTS support (used on Windows 64 bits binary).
- Python 3.13.0 on Windows.

## 1.8.0 (2024-10-04)
Expand Down
1 change: 1 addition & 0 deletions bin/qt.iss
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Source: {#RootPath}bin\{#BinPath}\Qt6QuickLayouts.dll; DestDir: {app}\bin\{#BinP
Source: {#RootPath}bin\{#BinPath}\Qt6QuickControls2Basic.dll; DestDir: {app}\bin\{#BinPath}\;Components: {#COMPONENT_GUI};
Source: {#RootPath}bin\{#BinPath}\Qt6QuickControls2Fusion.dll; DestDir: {app}\bin\{#BinPath}\;Components: {#COMPONENT_GUI};
Source: {#RootPath}bin\{#BinPath}\Qt6QuickControls2FusionStyleImpl.dll; DestDir: {app}\bin\{#BinPath}\;Components: {#COMPONENT_GUI};
Source: {#RootPath}bin\{#BinPath}\Qt6QmlMeta.dll; DestDir: {app}\bin\{#BinPath}\;Flags: skipifsourcedoesntexist;Components: {#COMPONENT_GUI};
#endif
;==============================================================================
Source: {#RootPath}bin\{#BinPath}\qhelpgenerator.exe; DestDir: {app}\bin\{#BinPath}\;Components: {#COMPONENT_GUI};
Expand Down
12 changes: 12 additions & 0 deletions modules/qml_engine/src/cpp/QVariantArrayOf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QtGui/QMatrix>
#endif
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
#include <QtCore/QTimeZone>
#endif
#include <QtGui/QQuaternion>
#include <QtGui/QTransform>
#include <QtGui/QVector2D>
Expand Down Expand Up @@ -239,7 +242,11 @@ QVariantToArrayOf(QVariant Q)
} break;
case QMetaType::Type::QDateTime: {
QDateTime qdatetime = qvariant_cast<QDateTime>(Q);
#if (QT_VERSION >= QT_VERSION_CHECK(6, 8, 0))
qdatetime.setTimeZone(QTimeZone::UTC);
#else
qdatetime.setTimeSpec(Qt::UTC); // FORCE UTC
#endif
QDate qdate = qdatetime.date();
QTime qtime = qdatetime.time();
int32* arrayInt32 = (int32*)ArrayOf::allocateArrayOf(NLS_INT32, 7, stringVector(), false);
Expand Down Expand Up @@ -683,7 +690,12 @@ ArrayOfToQVariant(ArrayOf A, int id)
QDate date(arrayInt[0], arrayInt[1], arrayInt[2]);
QTime time(arrayInt[3], arrayInt[4], arrayInt[5], arrayInt[6]);
QDateTime datetime(date, time);

#if (QT_VERSION >= QT_VERSION_CHECK(6, 8, 0))
datetime.setTimeZone(QTimeZone::UTC);
#else
datetime.setTimeSpec(Qt::UTC); // FORCE UTC
#endif
res = datetime;
} break;
case QMetaType::Type::QUrl: {
Expand Down
12 changes: 12 additions & 0 deletions modules/qml_engine/src/cpp/QmlEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,21 @@ QJsValueToQVariant(QJSValue value)
if (value.isNumber()) {
return value.toNumber();
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
if (value.isBool() || value.isNumber() || value.isNull() || value.isString()
|| value.isUndefined() || value.isQObject() || value.isQMetaObject() || value.isObject()
|| value.isDate() || value.isRegExp() || value.isArray() || value.isError()
|| value.isUrl()) {
return value.toString();
} else {
return value.toVariant();
}
#else
if (value.isVariant()) {
return value.toVariant();
}
#endif
return value.toString();
}
//=============================================================================
Expand Down
10 changes: 8 additions & 2 deletions modules/qml_engine/tests/test_QObject_isprop.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@
qobj.z = 1;
assert_istrue(isprop(qobj, 'z'));
else
assert_istrue(isprop(qobj, 'z'));
assert_isequal(qobj.z, 0);
if (semver(qt_version(), '6.8.0') < 0)
assert_istrue(isprop(qobj, 'z'));
assert_isequal(qobj.z, 0);
else
assert_isfalse(isprop(qobj, 'z'));
qobj.z = 1;
assert_istrue(isprop(qobj, 'z'));
end
end
%=============================================================================
delete(qobj);
Expand Down

0 comments on commit 54d2330

Please sign in to comment.