Skip to content

Commit 0fe279c

Browse files
committed
update qt version for CI
1 parent 9696ab5 commit 0fe279c

File tree

5 files changed

+46
-7
lines changed

5 files changed

+46
-7
lines changed

.github/workflows/cpp-ci-serial-programs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
os: [windows-2022, macos-13, ubuntu-24.04]
13-
qt_version: ['5.12.12', '6.7.2']
13+
qt_version: ['5.12.12', '6.8.1']
1414
include:
1515
- qt_version: '5.12.12'
1616
qt_version_major: '5'
1717
qt_modules: ''
1818

19-
- qt_version: '6.7.2'
19+
- qt_version: '6.8.1'
2020
qt_version_major: '6'
2121
qt_modules: 'qtmultimedia qtserialport'
2222

@@ -37,7 +37,7 @@ jobs:
3737
if: startsWith(matrix.os, 'mac')
3838
run: |
3939
brew install opencv
40-
- uses: jurplel/install-qt-action@v3
40+
- uses: jurplel/install-qt-action@v4
4141
with:
4242
version: ${{ matrix.qt_version }}
4343
modules: ${{ matrix.qt_modules }}

Common/Qt/Options/BooleanCheckBoxWidget.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,21 @@ BooleanCheckBoxCellWidget::BooleanCheckBoxCellWidget(QWidget& parent, BooleanChe
3838
m_box = new QCheckBox(this);
3939
m_box->setChecked(m_value);
4040
layout->addWidget(m_box);
41+
#if QT_VERSION < 0x060700
4142
connect(
4243
m_box, &QCheckBox::stateChanged,
4344
this, [this](int){
4445
m_value = m_box->isChecked();
4546
}
4647
);
48+
#else
49+
connect(
50+
m_box, &QCheckBox::checkStateChanged,
51+
this, [this](Qt::CheckState){
52+
m_value = m_box->isChecked();
53+
}
54+
);
55+
#endif
4756
value.add_listener(*this);
4857
}
4958
void BooleanCheckBoxCellWidget::update_value(){
@@ -81,12 +90,21 @@ BooleanCheckBoxOptionWidget::BooleanCheckBoxOptionWidget(QWidget& parent, Boolea
8190
m_box = new QCheckBox(this);
8291
m_box->setChecked(m_value);
8392
layout->addWidget(m_box, 1);
93+
#if QT_VERSION < 0x060700
8494
connect(
8595
m_box, &QCheckBox::stateChanged,
8696
this, [this](int){
8797
m_value = m_box->isChecked();
8898
}
8999
);
100+
#else
101+
connect(
102+
m_box, &QCheckBox::checkStateChanged,
103+
this, [this](int){
104+
m_value = m_box->isChecked();
105+
}
106+
);
107+
#endif
90108
value.add_listener(*this);
91109
}
92110
void BooleanCheckBoxOptionWidget::update_value(){

Common/Qt/TimeQt.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
#include <QDateTime>
8+
#include <QTimeZone>
89
#include "Common/Cpp/Exceptions.h"
910
#include "Common/Cpp/PrettyPrint.h"
1011
#include "TimeQt.h"
@@ -45,7 +46,7 @@ std::string to_utc_time_str(WallClock time){
4546
#endif
4647

4748
int64_t secs_since_epoch = std::chrono::duration_cast<std::chrono::seconds>(time.time_since_epoch()).count();
48-
QDateTime qdatetime = QDateTime::fromSecsSinceEpoch(secs_since_epoch, Qt::UTC);
49+
QDateTime qdatetime = QDateTime::fromSecsSinceEpoch(secs_since_epoch, QTimeZone::utc());
4950
QDate qdate = qdatetime.date();
5051
QTime qtime = qdatetime.time();
5152
std::string str;
@@ -142,7 +143,7 @@ WallClock parse_utc_time_str(const std::string& str){
142143
throw ParseException("Invalid time.");
143144
}
144145

145-
QDateTime qdatetime(qdate, qtime, Qt::UTC);
146+
QDateTime qdatetime(qdate, qtime, QTimeZone::utc());
146147
int64_t secs_since_epoch = qdatetime.toSecsSinceEpoch();
147148

148149
return WallClock{} + std::chrono::seconds(secs_since_epoch);
@@ -153,12 +154,12 @@ WallClock parse_utc_time_str(const std::string& str){
153154
int64_t to_seconds_since_epoch(const DateTime& date){
154155
QDate qdate(date.year, date.month, date.day);
155156
QTime qtime(date.hour, date.minute, date.second);
156-
QDateTime qdatetime(qdate, qtime, Qt::UTC);
157+
QDateTime qdatetime(qdate, qtime, QTimeZone::utc());
157158
int64_t secs_since_epoch = qdatetime.toSecsSinceEpoch();
158159
return secs_since_epoch;
159160
}
160161
DateTime from_seconds_since_epoch(int64_t seconds_since_epoch){
161-
QDateTime qdatetime = QDateTime::fromSecsSinceEpoch(seconds_since_epoch, Qt::UTC);
162+
QDateTime qdatetime = QDateTime::fromSecsSinceEpoch(seconds_since_epoch, QTimeZone::utc());
162163
QDate qdate = qdatetime.date();
163164
QTime qtime = qdatetime.time();
164165
return DateTime{

SerialPrograms/Source/CommonFramework/GlobalSettingsPanel.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ void PreloadSettings::load(const JsonValue& json){
7070
const std::string* dev_token = obj->get_string("DEVELOPER_TOKEN");
7171
if (dev_token){
7272
QCryptographicHash hash(QCryptographicHash::Algorithm::Sha256);
73+
#if QT_VERSION < 0x060700
7374
hash.addData(dev_token->c_str(), (int)dev_token->size());
75+
#else
76+
QByteArrayView dataView(dev_token->data(), dev_token->size());
77+
hash.addData(dataView);
78+
#endif
7479
DEVELOPER_MODE = TOKENS.find(hash.result().toHex().toStdString()) != TOKENS.end();
7580
}
7681

SerialPrograms/Source/NintendoSwitch/Framework/UI/NintendoSwitch_CommandRow.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ CommandRow::CommandRow(
8181
m_overlay_boxes, &QCheckBox::clicked,
8282
this, [this](bool checked){ m_session.set_enabled_boxes(checked); }
8383
);
84+
#if QT_VERSION < 0x060700
8485
connect(
8586
m_overlay_text, &QCheckBox::stateChanged,
8687
this, [this](bool checked){ m_session.set_enabled_text(checked); }
@@ -93,6 +94,20 @@ CommandRow::CommandRow(
9394
m_overlay_stats, &QCheckBox::stateChanged,
9495
this, [this](bool checked){ m_session.set_enabled_stats(checked); }
9596
);
97+
#else
98+
connect(
99+
m_overlay_text, &QCheckBox::checkStateChanged,
100+
this, [this](Qt::CheckState state){ m_session.set_enabled_text(state == Qt::Checked); }
101+
);
102+
connect(
103+
m_overlay_log, &QCheckBox::checkStateChanged,
104+
this, [this](Qt::CheckState state){ m_session.set_enabled_log(state == Qt::Checked); }
105+
);
106+
connect(
107+
m_overlay_stats, &QCheckBox::checkStateChanged,
108+
this, [this](Qt::CheckState state){ m_session.set_enabled_stats(state == Qt::Checked); }
109+
);
110+
#endif
96111
connect(
97112
m_load_profile_button, &QPushButton::clicked,
98113
this, [this](bool) { emit load_profile(); }

0 commit comments

Comments
 (0)