Skip to content

Commit ee5e36b

Browse files
committed
Fixed compilation issues under QT 5.12
1 parent 6892eb2 commit ee5e36b

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

core/Migration.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ bool Migration::setSelectedProfile(const QString &tablename, const QString &prof
689689

690690
QSqlQuery query;
691691

692-
if ( !query.prepare(QLatin1String("UPDATE %1 "
692+
if ( !query.prepare(QString("UPDATE %1 "
693693
"SET selected = CASE "
694694
" WHEN profile_name = :profileName THEN 1 "
695695
" ELSE NULL "

data/Data.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ DxccStatus Data::dxccStatus(int dxcc, const QString &band, const QString &mode)
154154
}
155155

156156
QSqlQuery query;
157-
QString sqlStatement = QLatin1String("WITH all_dxcc_qsos AS (SELECT DISTINCT contacts.mode, contacts.band, "
157+
QString sqlStatement = QString("WITH all_dxcc_qsos AS (SELECT DISTINCT contacts.mode, contacts.band, "
158158
" contacts.qsl_rcvd, contacts.lotw_qsl_rcvd "
159159
" FROM contacts "
160160
" WHERE dxcc = :dxcc %1) "

data/ProfileManager.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class ProfileManagerSQL
101101
QString logging_cat(MOD_NAME); logging_cat.append(".function.entered");
102102
qCDebug(QLoggingCategory(logging_cat.toLatin1().constData()));
103103

104-
QSqlQuery query(QLatin1String("SELECT profile_name FROM %1 WHERE IFNULL(selected, 0) = 1").arg(tableName));
104+
QSqlQuery query(QString("SELECT profile_name FROM %1 WHERE IFNULL(selected, 0) = 1").arg(tableName));
105105
currentProfile1 = query.first() ? query.value(0).toString() : QString();
106106

107107
if ( currentProfile1.isEmpty() )
@@ -125,7 +125,7 @@ class ProfileManagerSQL
125125
QSqlQuery query;
126126

127127
// atomic change
128-
if ( !query.prepare(QLatin1String("UPDATE %1 "
128+
if ( !query.prepare(QString("UPDATE %1 "
129129
"SET selected = CASE "
130130
" WHEN profile_name = :profileName THEN 1 "
131131
" ELSE NULL "

ui/AwardsDialog.cpp

+15-5
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void AwardsDialog::refreshTable(int)
103103
if ( ui->paperCheckBox->isChecked() )
104104
confirmed << " qsl_rcvd = 'Y' ";
105105

106-
const QString innerConfirmedCase(QLatin1String(" CASE WHEN (%1) THEN 2 ELSE 1 END ").arg(confirmed.join("or")));
106+
const QString innerConfirmedCase(QString(" CASE WHEN (%1) THEN 2 ELSE 1 END ").arg(confirmed.join("or")));
107107

108108
for ( const Band& band : dxccBands )
109109
{
@@ -365,7 +365,12 @@ void AwardsDialog::refreshTable(int)
365365
tr("TOTAL Worked"),
366366
uniqColumns,
367367
stmt_total_padding.join(","),
368-
modes.join(","),
368+
modes.join(",")
369+
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
370+
,
371+
#else
372+
).arg(
373+
#endif
369374
addWherePart,
370375
tr("TOTAL Confirmed"),
371376
uniqColumns,
@@ -374,11 +379,16 @@ void AwardsDialog::refreshTable(int)
374379
modes.join(","),
375380
addWherePart,
376381
tr("Confirmed"),
377-
stmt_sum_confirmed.join(","),
378-
tr("Worked"),
382+
stmt_sum_confirmed.join(",")
383+
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
384+
,
385+
#else
386+
).arg(
387+
#endif
388+
tr("Worked")).arg(
379389
stmt_sum_worked.join(","),
380390
stmt_sum_total.join(","),
381-
ui->notWorkedCheckBox->isChecked() ? QString("HAVING %1").arg(stmt_having.join(" AND ")) : "" ));
391+
ui->notWorkedCheckBox->isChecked() ? QString("HAVING %1").arg(stmt_having.join(" AND ")) : QString() ));
382392
qDebug(runtime) << finalSQL;
383393

384394
detailedViewModel->setQuery(finalSQL);

0 commit comments

Comments
 (0)