fix Warning
This commit is contained in:
1 parent
593c221d23
commit
8345470273
316 files changed
+1246
-929
No files matched your search
+1
-1
@@ -19,7 +19,7 @@ WebSocketInterface::WebSocketInterface(QObject *parent)
|
||||
connect(m_socket, &QWebSocket::textMessageReceived, this, &WebSocketInterface::onTextMessageRecived);
|
||||
connect(m_socket, &QWebSocket::connected, this, &WebSocketInterface::onConnected);
|
||||
connect(m_socket, &QWebSocket::disconnected, this, &WebSocketInterface::onDisconnected);
|
||||
connect(m_socket, QOverload<QAbstractSocket::SocketError>::of(&QWebSocket::error), this, &WebSocketInterface::onError);
|
||||
connect(m_socket, QOverload<QAbstractSocket::SocketError>::of(&QWebSocket::errorOccurred), this, &WebSocketInterface::onError);
|
||||
}
|
||||
|
||||
void WebSocketInterface::reset()
|
||||
|
||||
@@ -33,7 +33,7 @@ int main(int argc, char **argv)
|
||||
|
||||
NGLApplication app(argc, argv);
|
||||
QApplication::setQuitOnLastWindowClosed(true); // we are cool enough to handle it ourselves 8)
|
||||
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
// Qt::AA_UseHighDpiPixmaps: no-op since Qt6 (high-DPI pixmaps are always enabled)
|
||||
QNetworkProxy::setApplicationProxy(QNetworkProxy()); // do NOT use proxies anywhere!
|
||||
|
||||
app.createLogger("awss", "log4cxx_adlerWebSocketSimulator.props");
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
// Parts stolen from https://github.com/wille-io/fast-ca/blob/master/main.cpp @ https://github.com/wille-io/fast-ca/blob/7cd703a2751d995da5b0f918198532d4955934f6/main.cpp
|
||||
|
||||
#include <botan/x509_ca.h>
|
||||
#include <utility>
|
||||
#include <botan/x509cert.h>
|
||||
#include <botan/x509self.h>
|
||||
#include <botan/rsa.h>
|
||||
@@ -199,7 +200,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
bool first = true;
|
||||
for (const QJsonValue &wsRef : qAsConst(wsArr))
|
||||
for (const QJsonValue &wsRef : std::as_const(wsArr))
|
||||
{
|
||||
const QJsonObject ws(wsRef.toObject());
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "copy_exercise.h"
|
||||
#include <utility>
|
||||
|
||||
#include <ngldb/dbcommon.h>
|
||||
#include <ngldb/dbconnection.h>
|
||||
@@ -473,7 +474,7 @@ void CopyExercise::onPsqlFinishedForAAR(int exitCode, QProcess::ExitStatus exitS
|
||||
const QString schema = DBCommon::getExerciseSchemaName(m_exerciseId);
|
||||
QStringList downloadScriptIds;
|
||||
downloadScriptIds.reserve(m_downloadScriptIds.size());
|
||||
for (int id : qAsConst(m_downloadScriptIds))
|
||||
for (int id : std::as_const(m_downloadScriptIds))
|
||||
downloadScriptIds.push_back(QString::number(id));
|
||||
|
||||
QString stmt = QLatin1String("DELETE FROM ") + schema + QLatin1String(".pre_presentation WHERE id not in (") + downloadScriptIds.join(QLatin1Char(',')) + QLatin1Char(')');
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "exercise_table_generator.h"
|
||||
#include <utility>
|
||||
|
||||
#include <ngldb/nsqlquery.h>
|
||||
#include <ngldb/dbtransaction.h>
|
||||
@@ -450,7 +451,7 @@ bool ExerciseTableGenerator::executeSqlTableRelated(const QString &svcName, cons
|
||||
}
|
||||
|
||||
bool ok = true;
|
||||
for (const QString &table : qAsConst(tablesNewlyCreated))
|
||||
for (const QString &table : std::as_const(tablesNewlyCreated))
|
||||
{
|
||||
if (!insertTableData(table, dbSchema, sqlGen))
|
||||
{
|
||||
@@ -511,7 +512,7 @@ void ExerciseTableGenerator::checkAliveTimer()
|
||||
// --------------------------------------------------------------------------------------------------------
|
||||
void ExerciseTableGenerator::generateSqlDataForExercise(int exerciseId)
|
||||
{
|
||||
for (CodeGen::SqlGenerator *sqlGen : qAsConst(m_sqlGeneratorMap))
|
||||
for (CodeGen::SqlGenerator *sqlGen : std::as_const(m_sqlGeneratorMap))
|
||||
{
|
||||
// recreate sql statement with correct schema name (e.g. for serials)
|
||||
if (!sqlGen->generateData(exerciseId))
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include "exercises_model.h"
|
||||
#include <utility>
|
||||
|
||||
#include <ngltools/ngltools_dtg.h>
|
||||
#include <ngldb/nsqlquery.h>
|
||||
@@ -243,7 +244,7 @@ QStringList ExercisesModel::getSchemasToUpdate()
|
||||
{
|
||||
QStringList schemas;
|
||||
|
||||
for(const ExerciseUpdate &eu : qAsConst(m_vecData))
|
||||
for(const ExerciseUpdate &eu : std::as_const(m_vecData))
|
||||
{
|
||||
if (eu.isChecked)
|
||||
schemas << eu.schema;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include "global_updates_model.h"
|
||||
#include <utility>
|
||||
#include <ngldb/nsqlquery.h>
|
||||
#include <ngltools/ngltools_dtg.h>
|
||||
#include <QtCore/QStringList>
|
||||
@@ -47,7 +48,7 @@ bool GlobalUpdatesModel::initModel(const QSqlDatabase &db, const QString &versio
|
||||
DEBUG_LOG(m_logger) << "versionInt: " << versionInt;
|
||||
DEBUG_LOG(m_logger) << "upperVersion: " << upperVersion;
|
||||
|
||||
for (const QString &schema: qAsConst(schemas))
|
||||
for (const QString &schema: std::as_const(schemas))
|
||||
{
|
||||
GlobalUpdate gu;
|
||||
gu.schema = schema;
|
||||
@@ -207,7 +208,7 @@ QStringList GlobalUpdatesModel::getSchemasToUpdate()
|
||||
{
|
||||
QStringList schemas;
|
||||
|
||||
for(const GlobalUpdate &gu : qAsConst(m_vecData))
|
||||
for(const GlobalUpdate &gu : std::as_const(m_vecData))
|
||||
{
|
||||
if (gu.isChecked)
|
||||
schemas << gu.schema;
|
||||
|
||||
@@ -71,8 +71,7 @@ int main(int argc, char *argv[])
|
||||
QCoreApplication::setApplicationName(QLatin1String("DBUpdate"));
|
||||
QCoreApplication::setOrganizationName(QLatin1String("RME"));
|
||||
|
||||
if (!bHeadless)
|
||||
app->setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
// Qt::AA_UseHighDpiPixmaps: no-op since Qt6 (high-DPI pixmaps are always enabled)
|
||||
|
||||
NGL::LoggerHandler *lh = dynamic_cast<NGL::LoggerHandler*>(app.data());
|
||||
lh->createLogger("dbu", "log4cxx_dbu.props");
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* Created by Patric Karwat, NLE, 07-03-2019
|
||||
*/
|
||||
#include "system_caller.h"
|
||||
#include <utility>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QDateTime>
|
||||
|
||||
@@ -21,7 +22,7 @@ SystemCaller::SystemCaller(QObject *parent)
|
||||
|
||||
SystemCaller::~SystemCaller()
|
||||
{
|
||||
for (auto socket : qAsConst(m_sockets))
|
||||
for (auto socket : std::as_const(m_sockets))
|
||||
{
|
||||
socket->close();
|
||||
socket->deleteLater();
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include "samplemodel.h"
|
||||
#include <utility>
|
||||
#include <QMimeData>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QDomDocument>
|
||||
@@ -57,7 +58,7 @@ SampleModel::SampleModel(QObject *parent)
|
||||
|
||||
SampleModel::~SampleModel()
|
||||
{
|
||||
for (const SampleData &sd : qAsConst(m_data))
|
||||
for (const SampleData &sd : std::as_const(m_data))
|
||||
delete sd.dialog;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include "topic_tree_model.h"
|
||||
#include <utility>
|
||||
#include <QtCore/QBuffer>
|
||||
#include <QtCore/QDataStream>
|
||||
#include <QtCore/QDateTime>
|
||||
@@ -100,7 +101,7 @@ void TopicDataModel::reset()
|
||||
|
||||
void TopicDataModel::cleanupModelIndexes()
|
||||
{
|
||||
for (const QModelIndex &idx : qAsConst(m_pathInformations))
|
||||
for (const QModelIndex &idx : std::as_const(m_pathInformations))
|
||||
{
|
||||
IndexData *id = static_cast<IndexData *>(idx.internalPointer());
|
||||
delete id;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include "topicselector.h"
|
||||
#include <utility>
|
||||
#include "typecodeselectordlg.h"
|
||||
#include "nglsettings.h"
|
||||
#include "topic_tree_model.h"
|
||||
@@ -133,14 +134,14 @@ void TopicSelector::onOk()
|
||||
{
|
||||
NGLSettings::instance()->setInfoValues(m_typeCodeInfos);
|
||||
emit typeCodeInfosChanged();
|
||||
for (TypeCodeSelectorDlg *tcsd : qAsConst(m_dialogs))
|
||||
for (TypeCodeSelectorDlg *tcsd : std::as_const(m_dialogs))
|
||||
tcsd->reject();
|
||||
accept();
|
||||
}
|
||||
|
||||
void TopicSelector::onCancel()
|
||||
{
|
||||
for (TypeCodeSelectorDlg *tcsd : qAsConst(m_dialogs))
|
||||
for (TypeCodeSelectorDlg *tcsd : std::as_const(m_dialogs))
|
||||
tcsd->reject();
|
||||
reject();
|
||||
}
|
||||
|
||||
+2
-1
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include <nglapplication/nglapplication.h>
|
||||
#include <utility>
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
#include <memory>
|
||||
|
||||
@@ -75,7 +76,7 @@ int main(int argc, char *argv[])
|
||||
if (portList.count() > 1)
|
||||
{
|
||||
portNumbers.reserve(portList.size());
|
||||
for (const QString &s : qAsConst(portList))
|
||||
for (const QString &s : std::as_const(portList))
|
||||
portNumbers << s.toInt();
|
||||
}
|
||||
else if (portList.count() == 1 && !portList.first().isEmpty())
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "Server.h"
|
||||
#include <utility>
|
||||
|
||||
#include <QWebSocketServer>
|
||||
#include <QWebSocket>
|
||||
@@ -160,7 +161,7 @@ bool Server::init(quint16 port)
|
||||
|
||||
QVector<int> types;
|
||||
|
||||
for (const QString &s : qAsConst(typesStringList))
|
||||
for (const QString &s : std::as_const(typesStringList))
|
||||
{
|
||||
bool k = true;
|
||||
int type = s.toInt(&k);
|
||||
@@ -175,7 +176,7 @@ bool Server::init(quint16 port)
|
||||
QVector<Event> eventsToSend;
|
||||
|
||||
qint64 eventCount = 0;
|
||||
for (const Event &e : qAsConst(m_events))
|
||||
for (const Event &e : std::as_const(m_events))
|
||||
{
|
||||
if (e.time >= from && e.time <= to && (types.isEmpty() || types.contains(e.type)))
|
||||
{
|
||||
@@ -190,7 +191,7 @@ bool Server::init(quint16 port)
|
||||
|
||||
QJsonArray eventArray;
|
||||
|
||||
for (const Event &e : qAsConst(eventsToSend))
|
||||
for (const Event &e : std::as_const(eventsToSend))
|
||||
{
|
||||
QJsonObject eObj;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "egcu_simulator.h"
|
||||
#include <utility>
|
||||
|
||||
QVector<int> relayStates = {0,0,0,0,0,0,0,0};
|
||||
|
||||
@@ -27,7 +28,7 @@ QString sendState()
|
||||
{
|
||||
int i = 0;
|
||||
QString stateString;
|
||||
for (int value : qAsConst(relayStates))
|
||||
for (int value : std::as_const(relayStates))
|
||||
{
|
||||
QString state = QStringLiteral("\"");
|
||||
state += QString::number(i);
|
||||
|
||||
@@ -24,9 +24,9 @@ LicenceEdit::LicenceEdit(QWidget *parent)
|
||||
this, &LicenceEdit::onOk);
|
||||
connect(m_ui->nglDialogButtonBox, &NGLDialogButtonBox::onCancel,
|
||||
this, &LicenceEdit::onCancel);
|
||||
connect(m_ui->chbIgnoreCount, &QCheckBox::stateChanged,
|
||||
connect(m_ui->chbIgnoreCount, &QCheckBox::checkStateChanged,
|
||||
this, &LicenceEdit::enableIgnoreCount);
|
||||
connect(m_ui->chbIgnoreExpiration, &QCheckBox::stateChanged,
|
||||
connect(m_ui->chbIgnoreExpiration, &QCheckBox::checkStateChanged,
|
||||
this, &LicenceEdit::enableIgnoreExpiration);
|
||||
connect(m_ui->leName, &QLineEdit::textChanged,
|
||||
this, &LicenceEdit::onNameChanged);
|
||||
@@ -47,7 +47,7 @@ LicenceEdit::~LicenceEdit()
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
void LicenceEdit::enableIgnoreCount(int checkState)
|
||||
void LicenceEdit::enableIgnoreCount(Qt::CheckState checkState)
|
||||
{
|
||||
m_ui->lbxCount->setEnabled(checkState == Qt::Unchecked);
|
||||
m_ui->sbMaxCount->setEnabled(checkState == Qt::Unchecked);
|
||||
@@ -63,7 +63,7 @@ void LicenceEdit::enableIgnoreCount(int checkState)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
void LicenceEdit::enableIgnoreExpiration(int checkState)
|
||||
void LicenceEdit::enableIgnoreExpiration(Qt::CheckState checkState)
|
||||
{
|
||||
m_ui->lbxExpiry->setEnabled(checkState == Qt::Unchecked);
|
||||
m_ui->dateEdit->setEnabled(checkState == Qt::Unchecked);
|
||||
|
||||
@@ -38,8 +38,8 @@ private slots:
|
||||
void onOk();
|
||||
void onCancel();
|
||||
|
||||
void enableIgnoreCount(int checkState);
|
||||
void enableIgnoreExpiration(int checkState);
|
||||
void enableIgnoreCount(Qt::CheckState checkState);
|
||||
void enableIgnoreExpiration(Qt::CheckState checkState);
|
||||
void onNameChanged(const QString &name);
|
||||
private:
|
||||
Ui::LicenceEdit *m_ui;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include <utility>
|
||||
#include "ui_mainwindow.h"
|
||||
#include "sortfilter.h"
|
||||
#include <QCloseEvent>
|
||||
@@ -250,7 +251,7 @@ void MainWindow::onActionOpen()
|
||||
m_cryptState = CryptState::Encrypted;
|
||||
}
|
||||
|
||||
for (const LtsLicence::Licence &lic : qAsConst(licVec))
|
||||
for (const LtsLicence::Licence &lic : std::as_const(licVec))
|
||||
{
|
||||
m_licences.insert(lic.name, lic);
|
||||
insertRow(lic, m_licencesModel->rowCount());
|
||||
@@ -330,7 +331,7 @@ void MainWindow::onActionSave()
|
||||
|
||||
QVector<LtsLicence::Licence> licVec;
|
||||
licVec.reserve(m_licences.size());
|
||||
for (const LtsLicence::Licence &lic : qAsConst(m_licences))
|
||||
for (const LtsLicence::Licence &lic : std::as_const(m_licences))
|
||||
licVec += lic;
|
||||
QByteArray licenceBa = LtsLicence::writeUnencryptedLicences(licVec);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ QDateTime DateFilterWidget::dtimeTo() const
|
||||
return m_ui->dteTo->dateTime();
|
||||
}
|
||||
|
||||
void DateFilterWidget::enableMilliSecs(int state)
|
||||
void DateFilterWidget::enableMilliSecs(Qt::CheckState state)
|
||||
{
|
||||
if (state == 0)
|
||||
{
|
||||
@@ -49,7 +49,7 @@ void DateFilterWidget::enableMilliSecs(int state)
|
||||
}
|
||||
}
|
||||
|
||||
void DateFilterWidget::enableTime(int state)
|
||||
void DateFilterWidget::enableTime(Qt::CheckState state)
|
||||
{
|
||||
if (state == 0)
|
||||
{
|
||||
@@ -101,8 +101,8 @@ bool DateFilterWidget::init()
|
||||
{
|
||||
connect(m_ui->dteUp, &QDateTimeEdit::dateTimeChanged, this, &DateFilterWidget::dateStartFilterChanged);
|
||||
connect(m_ui->dteTo, &QDateTimeEdit::dateTimeChanged, this, &DateFilterWidget::dateEndFilterChanged);
|
||||
connect(m_ui->chbMilliSecs, &QCheckBox::stateChanged, this, &DateFilterWidget::enableMilliSecs);
|
||||
connect(m_ui->chbTime, &QCheckBox::stateChanged, this, &DateFilterWidget::enableTime);
|
||||
connect(m_ui->chbMilliSecs, &QCheckBox::checkStateChanged, this, &DateFilterWidget::enableMilliSecs);
|
||||
connect(m_ui->chbTime, &QCheckBox::checkStateChanged, this, &DateFilterWidget::enableTime);
|
||||
connect(m_ui->pbReset, &QPushButton::clicked, this, &DateFilterWidget::resetDTEs);
|
||||
|
||||
emit setStartDateTime();
|
||||
|
||||
@@ -43,8 +43,8 @@ public slots:
|
||||
void setEndDateTimeValue(const QDateTime &dtime);
|
||||
|
||||
private slots:
|
||||
void enableMilliSecs(int state);
|
||||
void enableTime(int state);
|
||||
void enableMilliSecs(Qt::CheckState state);
|
||||
void enableTime(Qt::CheckState state);
|
||||
void resetDTEs();
|
||||
|
||||
private:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <QLayout>
|
||||
#include <utility>
|
||||
|
||||
#include "content.h"
|
||||
#include "fullline.h"
|
||||
@@ -45,7 +46,7 @@ void Content::setCharCount(int charCount)
|
||||
{
|
||||
m_charCount = charCount;
|
||||
|
||||
for (FullLine * l : qAsConst(m_lines))
|
||||
for (FullLine * l : std::as_const(m_lines))
|
||||
l->setCharCount(m_charCount);
|
||||
}
|
||||
|
||||
@@ -58,7 +59,7 @@ void Content::setHeight(int height)
|
||||
{
|
||||
m_height = height;
|
||||
|
||||
for (FullLine * l : qAsConst(m_lines))
|
||||
for (FullLine * l : std::as_const(m_lines))
|
||||
l->setHeight(height);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* Created by Philipp Dassow, NLT, 30-11-2018
|
||||
*/
|
||||
#include "controller.h"
|
||||
#include <utility>
|
||||
#include "settings.h"
|
||||
|
||||
#include <QSystemTrayIcon>
|
||||
@@ -26,14 +27,14 @@ Controller::Controller(QObject *parent)
|
||||
|
||||
Controller::~Controller()
|
||||
{
|
||||
for (const ConverterData &data : qAsConst(m_converterData))
|
||||
for (const ConverterData &data : std::as_const(m_converterData))
|
||||
{
|
||||
if (!data.thread)
|
||||
continue;
|
||||
data.thread->disconnect(this);
|
||||
data.thread->quit();
|
||||
}
|
||||
for (const ConverterData &data : qAsConst(m_converterData))
|
||||
for (const ConverterData &data : std::as_const(m_converterData))
|
||||
{
|
||||
if (!data.thread)
|
||||
continue;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* Created by Philipp Dassow, NLT, 30-11-2018
|
||||
*/
|
||||
#include "converter.h"
|
||||
#include <utility>
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
namespace SerialToTcpConverter
|
||||
@@ -47,7 +48,7 @@ Converter::Converter(QObject *parent)
|
||||
|
||||
Converter::~Converter()
|
||||
{
|
||||
for (auto socket : qAsConst(m_sockets))
|
||||
for (auto socket : std::as_const(m_sockets))
|
||||
{
|
||||
socket->close();
|
||||
socket->deleteLater();
|
||||
@@ -116,7 +117,7 @@ void Converter::readSerial()
|
||||
{
|
||||
const QByteArray ba = m_serialPort->readAll();
|
||||
INFO_LOG(m_logger) << "Read Serial: " << ba;
|
||||
for (QTcpSocket *socket : qAsConst(m_sockets))
|
||||
for (QTcpSocket *socket : std::as_const(m_sockets))
|
||||
{
|
||||
socket->write(ba);
|
||||
socket->flush();
|
||||
|
||||
@@ -97,10 +97,10 @@ bool AddModel::setData(const QModelIndex &index, const QVariant &value, int role
|
||||
}
|
||||
|
||||
|
||||
QVariant::Type AddModel::getColumnType(const int column) const
|
||||
QMetaType::Type AddModel::getColumnType(const int column) const
|
||||
{
|
||||
if (column < 0 || column >= m_headerList.size())
|
||||
return QVariant::Invalid;
|
||||
return QMetaType::UnknownType;
|
||||
return m_headerList.at(column).second;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ public:
|
||||
void setHeaderList(const HeaderList& headerList);
|
||||
void setTablename(const QString& tableName);
|
||||
const QString& getTableName() const;
|
||||
QVariant::Type getColumnType(const int column) const;
|
||||
QMetaType::Type getColumnType(const int column) const;
|
||||
const HeaderList& getHeaderList() const;
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
@@ -41,12 +41,12 @@ void DataModel::addLine(const Data& data)
|
||||
}
|
||||
|
||||
|
||||
void DataModel::addColumn(const QString& columnName, QVariant::Type type)
|
||||
void DataModel::addColumn(const QString& columnName, QMetaType::Type type)
|
||||
{
|
||||
// QPair<QString,QVariant::Type> pair;
|
||||
// pair.first = columnName;
|
||||
// pair.second = type;
|
||||
m_newHeaderList.append(QPair<QString,QVariant::Type>(columnName, type));
|
||||
m_newHeaderList.append(QPair<QString,QMetaType::Type>(columnName, type));
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ QVariant DataModel::data(const QModelIndex &index, int role) const
|
||||
return QVariant();
|
||||
|
||||
case Qt::ToolTipRole:
|
||||
if ((element.type() == QVariant::ULongLong || element.type() == QVariant::LongLong)
|
||||
if ((element.typeId() == QMetaType::ULongLong || element.typeId() == QMetaType::LongLong)
|
||||
&& element.toLongLong() > 1000000000)
|
||||
return QDateTime::fromMSecsSinceEpoch(element.toLongLong()).toString(QStringLiteral("dd.MM.yyyy hh:mm:ss.zzz"));
|
||||
|
||||
@@ -137,8 +137,8 @@ QVariant DataModel::headerData(int section, Qt::Orientation orientation, int rol
|
||||
case Qt::DisplayRole:
|
||||
return m_headerList.at(section).first;
|
||||
case Qt::ToolTipRole:
|
||||
int type = m_headerList.at(section).second;
|
||||
return QString::fromUtf8(QMetaType::typeName(type));
|
||||
QMetaType::Type type = m_headerList.at(section).second;
|
||||
return QString::fromUtf8(QMetaType(type).name());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
using Data = QVector<QVariant>;
|
||||
using DataList = QVector<Data>;
|
||||
using HeaderList = QVector<QPair<QString, QVariant::Type>>;
|
||||
using HeaderList = QVector<QPair<QString, QMetaType::Type>>;
|
||||
|
||||
class DataModel: public QAbstractTableModel
|
||||
{
|
||||
@@ -17,7 +17,7 @@ public:
|
||||
//void fillModel(const HeaderList &headerList, const DataList &dataList);
|
||||
void dataListReserve(const int size);
|
||||
void addLine(const Data& data);
|
||||
void addColumn(const QString& columnName, QVariant::Type type);
|
||||
void addColumn(const QString& columnName, QMetaType::Type type);
|
||||
const HeaderList& getHeaderList() const;
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "LoginWnd.h"
|
||||
#include <utility>
|
||||
#include "ui_LoginUi.h"
|
||||
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
@@ -78,7 +79,7 @@ void LoginWnd::fillPresetComboBox()
|
||||
|
||||
const PresetManager::PresetList &presetList = presetManager.getPresetList();
|
||||
|
||||
for (const Preset &preset : qAsConst(presetList))
|
||||
for (const Preset &preset : std::as_const(presetList))
|
||||
m_ui->cbPresets->addItem(preset.name);
|
||||
|
||||
if (!presetList.isEmpty())
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "PresetManager.h"
|
||||
#include <utility>
|
||||
|
||||
#include <QInputDialog>
|
||||
#include <QtWidgets/QApplication>
|
||||
@@ -132,7 +133,7 @@ void PresetManager::savePresets()
|
||||
createFile(); // recreate file
|
||||
|
||||
// save all presets to file
|
||||
for (const Preset &preset : qAsConst(presetList))
|
||||
for (const Preset &preset : std::as_const(presetList))
|
||||
{
|
||||
QString presetString = QStringLiteral("%1:%2%3");
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "ui_QueryUi.h"
|
||||
#include <utility>
|
||||
|
||||
#include "Query.h"
|
||||
#include "QueryThread.h"
|
||||
@@ -163,7 +164,7 @@ void Query::slotExportCSV()
|
||||
file.write(columnNames.join(QLatin1Char(',')).toUtf8()); // write header
|
||||
file.write(NEWLINE);
|
||||
|
||||
for (const QString &row : qAsConst(rows))
|
||||
for (const QString &row : std::as_const(rows))
|
||||
{
|
||||
file.write(row.toUtf8());
|
||||
file.write(NEWLINE);
|
||||
|
||||
@@ -194,7 +194,7 @@ QString QueryWorker::selectQuery(const QString &queryString, DataModel* dataMode
|
||||
|
||||
for (int i = 0; i < recordCount; i++)
|
||||
{
|
||||
dataModel->addColumn(record.fieldName(i), record.field(i).type());
|
||||
dataModel->addColumn(record.fieldName(i), static_cast<QMetaType::Type>(record.field(i).metaType().id()));
|
||||
|
||||
if (m_dy) break;
|
||||
}
|
||||
@@ -427,7 +427,7 @@ void QueryWorker::slotAddLines(Query* caller, AddModel* addModel)
|
||||
//{
|
||||
// // value comes from sql database and must be made 'visual'
|
||||
|
||||
// QVariant::Type type = headerList.at(col).second; // get column type from model
|
||||
// QMetaType::Type type = headerList.at(col).second; // get column type from model
|
||||
|
||||
// //qWarning() << "QueryWorker::variantToSqlString: type =" << type;
|
||||
|
||||
@@ -451,7 +451,7 @@ QString QueryWorker::valueToSqlString(const QVariant& val, const HeaderList &hea
|
||||
{
|
||||
// value must be converted to sql value
|
||||
|
||||
QVariant::Type type = headerList.at(col).second; // get column type from model
|
||||
QMetaType::Type type = headerList.at(col).second; // get column type from model
|
||||
|
||||
//qWarning() << "QueryWorker::valueToSqlString: val" << val << "type" << type << "("<<type<<")";
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "httprequesthandler.h"
|
||||
#include <utility>
|
||||
#include <QDebug>
|
||||
#include <QEventLoop>
|
||||
#include <QNetworkAccessManager>
|
||||
@@ -105,7 +106,7 @@ void HTTPRequestHandler::removeParams(const QString &groupName, QNetworkAccessMa
|
||||
tempList.append(removeUrl);
|
||||
}
|
||||
tempList.removeDuplicates();
|
||||
for (const QString &string : qAsConst(tempList))
|
||||
for (const QString &string : std::as_const(tempList))
|
||||
{
|
||||
QUrl url;
|
||||
url.setUrl(string);
|
||||
|
||||
@@ -90,8 +90,6 @@ void VulnerabilityStateGenerator::MainHandler::quit()
|
||||
|
||||
ProjectDataManagement::VulnerabilityState VulnerabilityStateGenerator::MainHandler::randomVulnerabilityState()
|
||||
{
|
||||
ProjectDataManagement::VulnerabilityState result;
|
||||
|
||||
qsrand(QDateTime::currentMSecsSinceEpoch());
|
||||
unsigned int index = 0;
|
||||
if (m_vsMap.size() > 0)
|
||||
|
||||
Reference in new issue
Block a user