Skip to content

Commit fe1daf7

Browse files
authored
Bump Qt to 6.10.2 (#265)
1 parent 2b1d8cb commit fe1daf7

File tree

13 files changed

+41
-42
lines changed

13 files changed

+41
-42
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
permissions:
1111
contents: read
1212
env:
13-
QT_VERSION: 6.9.2
13+
QT_VERSION: 6.10.2
1414
jobs:
1515
# This is a super hacky way to get this into a place that can actually be
1616
# used by downstream jobs because YAML values don't allow shell
@@ -149,7 +149,7 @@ jobs:
149149
chmod a+x linuxdeploy*.AppImage
150150
export VERSION=${{ env.githash }}
151151
export PATH=$PATH:/opt/Qt/${{env.QT_VERSION}}/gcc_64/libexec
152-
export LINUXDEPLOY_EXCLUDED_LIBRARIES=libqsqlmimer.so
152+
export LINUXDEPLOY_EXCLUDED_LIBRARIES="libqsqlmimer.so;libqsqloci.so"
153153
./linuxdeploy-x86_64.AppImage --appdir=appdir --output appimage \
154154
-e src/ashirt \
155155
-d ../deploy/ashirt.desktop \

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ else()
5858
endif()
5959
message(STATUS "VERSION: ${CMAKE_PROJECT_VERSION}")
6060

61-
find_package(Qt6 6.5.0 REQUIRED COMPONENTS
61+
find_package(Qt6 6.10.0 REQUIRED COMPONENTS
6262
Widgets
6363
Gui
6464
Network

Readme_Developer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Building and Build Requirements
44

5-
This application is built off of Qt 6.5+, and utilizes's Qt's networking and Sql featuresets. To build, your specific system may need the following:
5+
This application is built off of Qt 6.10+, and utilizes's Qt's networking and Sql featuresets. To build, your specific system may need the following:
66

7-
1. Qt 6.5+, `cmake`, and possibly Qt Creator IDE.
7+
1. Qt 6.10+, `cmake`, and possibly Qt Creator IDE.
88
1. Binaries located [here](https://www.qt.io/download-qt-installer?hsCtaTracking=99d9dd4f-5681-48d2-b096-470725510d34%7C074ddad0-fdef-4e53-8aa8-5e8a876d6ab4). You may need to alter which downloader you install.
99
2. SQLite C driver (for SQLite version 3)
1010
1. On Fedora, this can be installed with `yum install sqlite-devel`

src/components/flow_layout/flowlayout.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ QSize FlowLayout::sizeHint() const {
113113

114114
QSize FlowLayout::minimumSize() const {
115115
QSize size;
116-
for (const QLayoutItem *item : qAsConst(itemList))
116+
for (const QLayoutItem *item : std::as_const(itemList))
117117
size = size.expandedTo(item->minimumSize());
118118

119119
const QMargins margins = contentsMargins();
@@ -122,14 +122,13 @@ QSize FlowLayout::minimumSize() const {
122122
}
123123

124124
int FlowLayout::doLayout(const QRect &rect, bool testOnly) const {
125-
int left, top, right, bottom;
126-
getContentsMargins(&left, &top, &right, &bottom);
127-
QRect effectiveRect = rect.adjusted(+left, +top, -right, -bottom);
125+
const QMargins m = contentsMargins();
126+
QRect effectiveRect = rect.adjusted(+m.left(), +m.top(), -m.right(), -m.bottom());
128127
int x = effectiveRect.x();
129128
int y = effectiveRect.y();
130129
int lineHeight = 0;
131130

132-
for (QLayoutItem *item : qAsConst(itemList)) {
131+
for (QLayoutItem *item : std::as_const(itemList)) {
133132
const QWidget *wid = item->widget();
134133
int spaceX = horizontalSpacing();
135134
if (spaceX == -1) {
@@ -157,7 +156,7 @@ int FlowLayout::doLayout(const QRect &rect, bool testOnly) const {
157156
x = nextX;
158157
lineHeight = qMax(lineHeight, item->sizeHint().height());
159158
}
160-
return y + lineHeight - rect.y() + bottom;
159+
return y + lineHeight - rect.y() + m.bottom();
161160
}
162161

163162
int FlowLayout::smartSpacing(QStyle::PixelMetric pm) const {

src/components/tagging/tag_cache/tagcache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ TagCache::TagCache(QObject *parent): QObject(parent) {
1111
}
1212

1313
TagCache::~TagCache() {
14-
for (auto entry : qAsConst(tagRequests)) {
14+
for (auto entry : std::as_const(tagRequests)) {
1515
cleanUpReply(&(entry));
1616
}
1717
}

src/db/databaseconnection.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "databaseconnection.h"
22

33
#include <QDir>
4+
#include <QTimeZone>
45
#include <QVariant>
56

67
#include "helpers/file_helpers.h"
@@ -24,7 +25,7 @@ bool DatabaseConnection::withConnection(const QString& dbPath, const QString &db
2425
return false;
2526
actions(conn);
2627
bool rtn = true;
27-
if( conn._db.lastError().type() != QSqlError::NoError)
28+
if(conn._db.lastError().isValid())
2829
rtn = false;
2930

3031
conn.close();
@@ -75,7 +76,7 @@ model::Evidence DatabaseConnection::getEvidenceDetails(qint64 evidenceID)
7576
model::Evidence rtn;
7677
auto qStr = QStringLiteral("%1 WHERE id=? LIMIT 1").arg(_sqlSelectTemplate.arg(_evidenceAllKeys, _tblEvidence));
7778
auto query = executeQuery(_db, qStr, {evidenceID});
78-
if (_db.lastError().type() == QSqlError::NoError && query.first()) {
79+
if (!_db.lastError().isValid() && query.first()) {
7980
rtn.id = query.value(QStringLiteral("id")).toLongLong();
8081
rtn.path = query.value(QStringLiteral("path")).toString();
8182
rtn.operationSlug = query.value(QStringLiteral("operation_slug")).toString();
@@ -84,8 +85,8 @@ model::Evidence DatabaseConnection::getEvidenceDetails(qint64 evidenceID)
8485
rtn.errorText = query.value(QStringLiteral("error")).toString();
8586
rtn.recordedDate = query.value(QStringLiteral("recorded_date")).toDateTime();
8687
rtn.uploadDate = query.value(QStringLiteral("upload_date")).toDateTime();
87-
rtn.recordedDate.setTimeSpec(Qt::UTC);
88-
rtn.uploadDate.setTimeSpec(Qt::UTC);
88+
rtn.recordedDate.setTimeZone(QTimeZone::UTC);
89+
rtn.uploadDate.setTimeZone(QTimeZone::UTC);
8990
rtn.tags = getTagsForEvidenceID(evidenceID);
9091
} else {
9192
rtn.id = -1;
@@ -96,18 +97,18 @@ model::Evidence DatabaseConnection::getEvidenceDetails(qint64 evidenceID)
9697
bool DatabaseConnection::updateEvidenceDescription(const QString &newDescription, qint64 evidenceID)
9798
{
9899
auto q = executeQuery(_db, QStringLiteral("UPDATE evidence SET description=? WHERE id=?"), {newDescription, evidenceID});
99-
return (q.lastError().type() == QSqlError::NoError);
100+
return !q.lastError().isValid();
100101
}
101102

102103
bool DatabaseConnection::deleteEvidence(qint64 evidenceID)
103104
{
104105
auto q = executeQuery(_db, QStringLiteral("DELETE FROM evidence WHERE id=?"), {evidenceID});
105-
return (q.lastError().type() == QSqlError::NoError);
106+
return !q.lastError().isValid();
106107
}
107108

108109
bool DatabaseConnection::updateEvidenceError(const QString &errorText, qint64 evidenceID) {
109110
auto q = executeQuery(_db, QStringLiteral("UPDATE evidence SET error=? WHERE id=?"), {errorText, evidenceID});
110-
return (q.lastError().type() == QSqlError::NoError);
111+
return !q.lastError().isValid();
111112
}
112113

113114
void DatabaseConnection::updateEvidenceSubmitted(qint64 evidenceID) {
@@ -157,12 +158,12 @@ bool DatabaseConnection::setEvidenceTags(const QList<model::Tag> &newTags, qint6
157158

158159
auto qDelStr = QStringLiteral("DELETE FROM tags WHERE tag_id NOT IN (?) AND evidence_id = ?");
159160
auto a = executeQuery(_db, qDelStr, {newTagIds, evidenceID});
160-
if(a.lastError().type() != QSqlError::NoError)
161+
if(a.lastError().isValid())
161162
return false;
162163

163164
auto qSelStr = QStringLiteral("SELECT tag_id FROM tags WHERE evidence_id = ?");
164165
auto currentTagsResult = executeQuery(_db, qSelStr, {evidenceID});
165-
if (currentTagsResult.lastError().type() != QSqlError::NoError)
166+
if (currentTagsResult.lastError().isValid())
166167
return false;
167168

168169
QList<qint64> currentTags;
@@ -199,7 +200,7 @@ bool DatabaseConnection::setEvidenceTags(const QList<model::Tag> &newTags, qint6
199200
args.append(item.name);
200201
}
201202
auto q = executeQuery(_db, baseQuery, args);
202-
if (q.lastError().type() != QSqlError::NoError)
203+
if (q.lastError().isValid())
203204
return false;
204205
}
205206
return true;
@@ -282,8 +283,8 @@ QList<model::Evidence> DatabaseConnection::getEvidenceWithFilters(const Evidence
282283
evi.errorText = resultSet.value(QStringLiteral("error")).toString();
283284
evi.recordedDate = resultSet.value(QStringLiteral("recorded_date")).toDateTime();
284285
evi.uploadDate = resultSet.value(QStringLiteral("upload_date")).toDateTime();
285-
evi.recordedDate.setTimeSpec(Qt::UTC);
286-
evi.uploadDate.setTimeSpec(Qt::UTC);
286+
evi.recordedDate.setTimeZone(QTimeZone::UTC);
287+
evi.uploadDate.setTimeZone(QTimeZone::UTC);
287288
allEvidence.append(evi);
288289
}
289290

@@ -401,7 +402,7 @@ QueryResult DatabaseConnection::executeQueryNoThrow(const QSqlDatabase& db, cons
401402
qint64 DatabaseConnection::doInsert(const QSqlDatabase& db, const QString &stmt, const QVariantList &args)
402403
{
403404
auto query = executeQuery(db, stmt, args);
404-
if(query.lastInsertId() != QVariant())
405+
if(query.lastInsertId().isValid())
405406
return query.lastInsertId().toLongLong();
406407
return -1;
407408
}

src/db/query_result.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class QueryResult {
1515
QueryResult(QSqlQuery query) {
1616
this->err = query.lastError();
1717
this->query = std::move(query);
18-
this->success = err.type() == QSqlError::NoError;
18+
this->success = !err.isValid();
1919
}
2020

2121
public:

src/forms/evidence/evidencemanager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ void EvidenceManager::loadEvidence()
335335

336336
auto filter = EvidenceFilters::parseFilter(filterTextBox->text());
337337
QList<model::Evidence> operationEvidence = db->getEvidenceWithFilters(filter);
338-
if(db->lastError().type() != QSqlError::NoError){
338+
if(db->lastError().isValid()){
339339
qWarning() << "Could not retrieve evidence for operation. Error: " << db->lastError().text();
340340
}
341341
evidenceTable->setRowCount(operationEvidence.size());

src/forms/evidence_filter/evidencefilterform.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,12 @@ void EvidenceFilterForm::wireUi() {
123123
connect(NetMan::get(), &NetMan::operationListUpdated, this, &EvidenceFilterForm::onOperationListUpdated);
124124
connect(buttonBox, &QDialogButtonBox::accepted, this, &EvidenceFilterForm::writeAndClose);
125125

126-
connect(includeStartDateCheckBox, &QCheckBox::stateChanged, fromDateEdit, &QDateEdit::setEnabled);
127-
connect(includeEndDateCheckBox, &QCheckBox::stateChanged, toDateEdit, &QDateEdit::setEnabled);
126+
connect(includeStartDateCheckBox, &QCheckBox::checkStateChanged, this, [this](Qt::CheckState state) {
127+
fromDateEdit->setEnabled(state == Qt::Checked);
128+
});
129+
connect(includeEndDateCheckBox, &QCheckBox::checkStateChanged, this, [this](Qt::CheckState state) {
130+
toDateEdit->setEnabled(state == Qt::Checked);
131+
});
128132
}
129133

130134
void EvidenceFilterForm::writeAndClose() {

src/forms/firstRunWizard/welcomepage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ WelcomePage::WelcomePage(QWidget *parent)
120120

121121
auto hide = new QCheckBox("Do Not show when starting", this);
122122
hide->setChecked(AppConfig::value(CONFIG::SHOW_WELCOME_SCREEN) != "true");
123-
connect(hide,&QCheckBox::stateChanged, this, [hide, this] (int newState) {
123+
connect(hide, &QCheckBox::checkStateChanged, this, [this](Qt::CheckState newState) {
124124
if(newState != Qt::Checked)
125125
AppConfig::setValue(CONFIG::SHOW_WELCOME_SCREEN, "true");
126126
else

0 commit comments

Comments
 (0)