fix Warning

This commit is contained in:
berrux-dev committed 2026-10-03 09:20:13 +02:00
1 parent 593c221d23
commit 8345470273
316 files changed
+1246 -929

No files matched your search

@@ -83,15 +83,12 @@ bool XmlReader::readServiceFile(const QString& svcFile, const QString& idlServic
INFO_LOG(m_logger) << "SvcFile: " << svcFile;
QDomDocument doc;
QString errorMsg;
int errorLine = 0;
int errorColumn = 0;
auto parseResult = doc.setContent(&f, &errorMsg, &errorLine, &errorColumn);
const auto parseResult = doc.setContent(&f);
if (!parseResult)
{
m_errorString = QLatin1String("Error parsing service file '") + svcFile + QLatin1String("' at line ") +
QString::number(errorLine) + QLatin1Char(':') +
QString::number(errorColumn);
QString::number(int(parseResult.errorLine)) + QLatin1Char(':') +
QString::number(int(parseResult.errorColumn));
ERROR_LOG(m_logger) << m_errorString;
return false;
}
@@ -56,7 +56,7 @@ std::shared_ptr<Dtc> Dtc::create(const std::shared_ptr<DDSConnector::DdsConnecto
auto ret = std::make_shared<DtcImpl>(ddsConnector);
{% endif %}
s_availableConnectors.insert(std::make_pair(ddsConnector.get(), ret));
return std::move(ret); // c++11 defect
return ret; // moved implicitly (C++17; explicit std::move on a local triggers -Wredundant-move)
}
// DtcImpl
@@ -46,7 +46,7 @@ Q_DECL_EXPORT std::shared_ptr<Ftc> Ftc::create(const std::shared_ptr<DDSConnecto
auto ret = std::make_shared<FtcImpl>(ddsConnector);
s_availableConnectors.insert(std::make_pair(ddsConnector.get(), ret));
return std::move(ret); // c++11 defect
return ret; // moved implicitly (C++17; explicit std::move on a local triggers -Wredundant-move)
}
// FtcImpl
@@ -113,7 +113,7 @@ AppDescriptionVector LtsAppDescriptor::getAppDescriptionVector(const QByteArray&
int column = 0;
QChar x = QLatin1Char('\n');
for (int i = 0; i < jsonDocument.count(); i++)
for (int i = 0; i < jsonDocument.size(); i++)
{
if (i == parseError.offset)
break;
@@ -78,8 +78,8 @@ class LtsElevationManager::Private
LtsElevationManager::LtsElevationManager()
: QObject(nullptr)
, m_logger(getLogger("LtsElevationManager"))
, d(new Private)
, m_logger(getLogger("LtsElevationManager"))
{
++s_counter;
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, s_counter=" << s_counter << " this=" << this;
@@ -20,15 +20,13 @@ QVector<Licence> readLicences(const QByteArray& unencryptedXmlData)
QVector<Licence> licenceVec;
QDomDocument xmlDoc;
QString errorMsg;
int errorLine = 0;
int errorColumn = 0;
if (!xmlDoc.setContent(unencryptedXmlData, &errorMsg, &errorLine, &errorColumn))
const auto parseResult = xmlDoc.setContent(unencryptedXmlData);
if (!parseResult)
{
ERROR_LOG(getLogger()) << "Error reading xml data, "
<< "error in line " << errorLine << ", column " << errorColumn
<< ", message: " << errorMsg;
<< "error in line " << int(parseResult.errorLine) << ", column " << int(parseResult.errorColumn)
<< ", message: " << parseResult.errorMessage;
return licenceVec;
}
@@ -9,6 +9,8 @@
*/
#include "lts_plugin_loader.h"
#include <memory>
#include <utility>
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <LtsAppDescriptor/lts_app_descriptor.h>
@@ -56,7 +58,7 @@ LtsPluginLoader::~LtsPluginLoader()
void LtsPluginLoader::unloadAllPlugins()
{
for (auto &pi : qAsConst(m_loadedPlugins))
for (auto &pi : std::as_const(m_loadedPlugins))
{
QPluginLoader *pluginLoader = pi.pluginLoader;
@@ -280,7 +282,7 @@ bool LtsPluginLoader::loadPlugins(PluginType requestedPluginType,
// continue;
// }
QScopedPointer<QPluginLoader> pluginLoader(new QPluginLoader);
std::unique_ptr<QPluginLoader> pluginLoader(new QPluginLoader);
pluginLoader->setFileName(absoluteFilePath);
const QJsonObject jObj = pluginLoader->metaData();
@@ -433,7 +435,7 @@ bool LtsPluginLoader::loadPlugins(PluginType requestedPluginType,
pi.fileName = filename;
pi.fullFileName = absoluteFilePath;
pi.plugin = plugin;
pi.pluginLoader = pluginLoader.data();
pi.pluginLoader = pluginLoader.get();
if (loadPlugin && !loadPlugin(pi)) // does the dev want this plugin? if no, unload it! TODO: really unload? or still cache it??
{
@@ -442,7 +444,7 @@ bool LtsPluginLoader::loadPlugins(PluginType requestedPluginType,
pluginLoader->unload();
continue; // next plugin
}
pi.pluginLoader = pluginLoader.take();
pi.pluginLoader = pluginLoader.release();
// the dev decided to use that plugin, so cache it
m_loadedPlugins.insert(PluginKey(requestedPluginType, pluginName), pi);
@@ -58,7 +58,7 @@ void DragHandler::dragLeaveEvent(QDragLeaveEvent* event)
void DragHandler::dropEvent(QDropEvent* event)
{
int dropPos = event->pos().x();
int dropPos = event->position().toPoint().x();
int dropTime = m_tcw->m_tools->getTime(dropPos, m_tcw->m_isFilter) - m_tcw->m_dragOffsetTime;
for (const auto& tcw : std::as_const(m_tcwCorresponding))
@@ -80,7 +80,7 @@ void DragHandler::dropEvent(QDropEvent* event)
void DragHandler::dragMoveEvent(QDragMoveEvent* event)
{
int pos = event->pos().x();
int pos = event->position().toPoint().x();
if (m_tcw->dragMove(pos))
event->acceptProposedAction();
@@ -101,7 +101,7 @@ void DragHandler::mouseMoveEvent(QMouseEvent* event)
if (event->buttons() != Qt::LeftButton)
return;
QPoint cursorPos = m_tcw->mapFromGlobal(event->globalPos());
QPoint cursorPos = m_tcw->mapFromGlobal(event->globalPosition().toPoint());
if (!m_tcw->m_mainSelected || ((cursorPos - m_dragStartPos).manhattanLength() < QApplication::startDragDistance() &&
(m_dragStartPos - cursorPos).manhattanLength() < QApplication::startDragDistance()))
@@ -37,7 +37,7 @@ void TrackHeader::mousePressEvent(QMouseEvent* event)
return;
if (!m_indicatorLock)
{
setIndicatorTime(m_tools->getTime(event->localPos().x()));
setIndicatorTime(m_tools->getTime(event->position().toPoint().x()));
emit signalHeaderIndicatorTimeUserChanged(m_indicatorTime);
}
}
@@ -19,7 +19,7 @@ void ResizeHandler::mousePressEvent(QMouseEvent* event)
if (event->buttons() != Qt::LeftButton || !m_possible)
return;
TrackEntry* te = m_trackContentWidget->getTrackEntryOnPos(event->globalPos());
TrackEntry* te = m_trackContentWidget->getTrackEntryOnPos(event->globalPosition().toPoint());
if (te == nullptr)
return;
@@ -101,7 +101,7 @@ bool ResizeHandler::isCollision(int newLength) const
bool ResizeHandler::mouseMoveEvent(QMouseEvent* event)
{
QPoint pos = m_trackContentWidget->mapFromGlobal(event->globalPos());
QPoint pos = m_trackContentWidget->mapFromGlobal(event->globalPosition().toPoint());
int posX = pos.x();
int cursorTime = m_trackContentWidget->m_tools->getTime(posX, m_trackContentWidget->m_isFilter);
@@ -128,7 +128,7 @@ bool ResizeHandler::mouseMoveEvent(QMouseEvent* event)
}
else
{
TrackEntry* te = m_trackContentWidget->getTrackEntryOnPos(event->globalPos());
TrackEntry* te = m_trackContentWidget->getTrackEntryOnPos(event->globalPosition().toPoint());
if (m_trackContentWidget->m_isFilter)
{
@@ -45,7 +45,7 @@ void SelectHandler::mousePressEvent(QMouseEvent* event)
{
m_pressedEntry = nullptr;
QPoint clickedPos = tcw->mapFromGlobal(event->globalPos());
QPoint clickedPos = tcw->mapFromGlobal(event->globalPosition().toPoint());
int clickedPosY = clickedPos.y();
int clickedPosX = clickedPos.x();
@@ -133,13 +133,13 @@ void SelectHandler::mousePressEvent(QMouseEvent* event)
contextMenu->addAction(action);
}
contextMenu->popup(event->globalPos());
contextMenu->popup(event->globalPosition().toPoint());
}
}
void SelectHandler::mouseReleaseEvent(QMouseEvent* event)
{
QPoint clickedPos = tcw->mapFromGlobal(event->globalPos());
QPoint clickedPos = tcw->mapFromGlobal(event->globalPosition().toPoint());
int clickedPosX = clickedPos.x();
int clickedTime = tcw->m_tools->getTime(clickedPosX, tcw->m_isFilter);
@@ -54,7 +54,7 @@ TrackWidget::TrackWidget(int baseWidth, bool readonly, Tools* tools, bool filter
connect(ui->mainTrack, &TrackContentWidget::signalTrackEntryDeleted, this, &TrackWidget::slotTrackEntryDeleted);
connect(ui->mainTrack, &TrackContentWidget::signalEditEntry, this, &TrackWidget::signalEditEntry);
connect(ui->chkSelect, &QCheckBox::stateChanged, this, &TrackWidget::signalSelectTrack);
connect(ui->chkSelect, &QCheckBox::checkStateChanged, this, &TrackWidget::signalSelectTrack);
connect(ui->pbExpand, &QPushButton::clicked, this, &TrackWidget::slotExpand);
connect(ui->pbAddFilter, &QPushButton::clicked, this, &TrackWidget::slotAddFilter);
}
@@ -9,6 +9,7 @@
*/
#include "lts_session.h"
#include <utility>
#ifdef BUILD_RTI
#include "lts_session_data_dds.h"
@@ -1307,7 +1308,7 @@ void LtsSession::createBaseLayout()
if (showDeveloperActions)
addDeveloperActions();
for (LtsNotification::LtsNotificationController* ctl : qAsConst(m_notiCtlList))
for (LtsNotification::LtsNotificationController* ctl : std::as_const(m_notiCtlList))
{
if (!m_baseLayout->notificationExists(ctl->identifier())) // add if non-existent only
m_baseLayout->addNotification(ctl->createWidget()); // FIXME: crash when no icons?
@@ -5,7 +5,91 @@
namespace LtsSession
{
// STUB implementations - RTI DDS not available
// All methods are stubbed since RTI Connext DDS is not available
// STUB implementations - RTI Connext DDS not available.
// The topic-lock feature depends on the RTI DDS backend (Core::Interface::Ftc),
// which is an optional dependency not present in this build. These definitions
// exist so that LtsSession links; the moc-generated qt_metacall references every
// slot, so each slot needs a body. Semantics reflect an unavailable backend:
// init reports failure (the caller logs a warning and skips wiring the handler)
// and the handler is never locked.
TopicLockHandler::TopicLockHandler()
: m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("LtsSession.TopicLockHandler"))
{
}
TopicLockHandler::~TopicLockHandler() {}
bool TopicLockHandler::init(const std::shared_ptr<Core::Interface::Ftc> &coreFtc, int exerciseId)
{
Q_UNUSED(coreFtc);
Q_UNUSED(exerciseId);
return false; // RTI DDS backend unavailable
}
void TopicLockHandler::slotTryLock(const LtsWidgets::TopicInfo &topicInfo)
{
Q_UNUSED(topicInfo);
}
bool TopicLockHandler::slotUnlock()
{
return true; // nothing is locked (no DDS backend)
}
void TopicLockHandler::slotFinalize() {}
bool TopicLockHandler::lock()
{
return false; // no DDS backend to lock against
}
bool TopicLockHandler::unlock()
{
return true; // nothing to unlock
}
std::string TopicLockHandler::objStateAsString() const
{
return "stub (RTI DDS not available)";
}
TopicLockHanderData::TopicLockHanderData() {}
TopicLockHanderData::~TopicLockHanderData() {}
void TopicLockHanderData::init(const std::shared_ptr<Core::Interface::Ftc> &coreFtc, int exerciseId)
{
Q_UNUSED(coreFtc);
Q_UNUSED(exerciseId);
}
void TopicLockHanderData::unlock() {}
void TopicLockHanderData::slotTryLock(const LtsWidgets::TopicInfo &topicInfo)
{
Q_UNUSED(topicInfo);
}
bool TopicLockHanderData::isLocked() const
{
return false; // no DDS backend: never locked
}
LtsWidgets::TopicInfo TopicLockHanderData::getTopicInfo() const
{
return LtsWidgets::TopicInfo();
}
void TopicLockHanderData::slotLock(const QString &lockedBy)
{
m_lockedBy = lockedBy;
}
void TopicLockHanderData::slotUnlock()
{
m_lockedBy.clear();
}
} // namespace LtsSession
@@ -89,7 +89,6 @@ void populateModel(LtsTimeline::TimelineModel* model)
try
{
const TestItem& testItem = dynamic_cast<const TestItem&>(model->item(5));
}
catch (const std::exception& ex)
{
@@ -109,6 +108,7 @@ void populateModel(LtsTimeline::TimelineModel* model)
#define unsorted false
QVector<int> x;
bool y;
(void)y;
x = model->itemIdsBetween(now + 60'000 + 1, now + 150'000 - 1, non_strict, recursive);
@@ -51,7 +51,10 @@ Track& TimelineModel::track(int id) noexcept(false)
{
if (id == m_rootTrack.id())
return m_rootTrack;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // model facade delegates to the deprecated root Track lookup
return m_rootTrack.track(id);
#pragma GCC diagnostic pop
}
auto it = m_trackCache.find(id);
@@ -68,7 +71,10 @@ const Track& TimelineModel::track(int id) const noexcept(false)
{
if (id == m_rootTrack.id())
return m_rootTrack;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // model facade delegates to the deprecated root Track lookup
return m_rootTrack.track(id);
#pragma GCC diagnostic pop
}
std::map<int, Track*>::const_iterator it = m_trackCache.find(id);
@@ -82,7 +88,10 @@ const Track& TimelineModel::track(int id) const noexcept(false)
Item& TimelineModel::item(int id) noexcept(false)
{
if (!m_itemCaching)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // model facade delegates to the deprecated root Track lookup
return m_rootTrack.item(id);
#pragma GCC diagnostic pop
auto it = m_itemCache.find(id);
@@ -95,7 +104,10 @@ Item& TimelineModel::item(int id) noexcept(false)
const Item& TimelineModel::item(int id) const noexcept(false)
{
if (!m_itemCaching)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // model facade delegates to the deprecated root Track lookup
return m_rootTrack.item(id);
#pragma GCC diagnostic pop
decltype(m_itemCache)::const_iterator it = m_itemCache.find(id);
@@ -132,7 +144,10 @@ bool TimelineModel::isItemsBetween(qint64 start, qint64 end, const QVector<int>&
const QVector<int> TimelineModel::copyItemIdsBetween(qint64 start, qint64 end, bool strict, bool complete,
bool sorted) const
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // model facade delegates to the deprecated root Track lookup
return m_rootTrack.copyItemIdsBetween(start, end, strict, complete, true, sorted);
#pragma GCC diagnostic pop
}
bool TimelineModel::isItemsBetween(qint64 start, qint64 end, int ignoreId, bool strict, bool complete,
@@ -45,9 +45,9 @@ void TimelineViewDragHandler::dragMoveEvent(QDragMoveEvent* e)
if (!e->mimeData()->hasFormat(Item::mimetype))
return;
m_dragPos = e->pos();
m_dragPos = e->position().toPoint();
m_view->m_header->setHoverPosition(m_dragPos.x());
e->setAccepted(canDragItemsTo(e->pos()));
e->setAccepted(canDragItemsTo(e->position().toPoint()));
m_view->viewport()->update();
}
@@ -67,7 +67,7 @@ void TimelineViewDragHandler::dropEvent(QDropEvent* e)
if (!e->mimeData()->hasFormat(Item::mimetype))
return;
if (!canDragItemsTo(e->pos()))
if (!canDragItemsTo(e->position().toPoint()))
{
clear();
e->acceptProposedAction();
@@ -22,8 +22,8 @@ namespace LtsTimeline
TimelineWidget::TimelineWidget(QWidget *parent)
: QWidget(parent)
, m_ui(new Ui::Timeline)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("Timeline.TimelineWidget"))
, m_ui(new Ui::Timeline)
{
m_ui->setupUi(this);
m_ui->debugWidget->hide();
@@ -20,7 +20,10 @@ const Track& Track::track(int id) const noexcept(false)
{
try
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // self-recursive lookup: recurses via the deprecated public Track API
return track->track(id);
#pragma GCC diagnostic pop
}
catch (...)
{
@@ -131,6 +134,7 @@ void Track::removeCopyItem(int itemId) noexcept(false)
const QVector<int> Track::copyItemIdsBetween(qint64 start, qint64 end, bool strict, bool complete, bool recursive,
bool sorted, qint64 minimumDuration) const
{
Q_UNUSED(minimumDuration);
auto itemPtrRefs = _copyItems();
if (recursive)
@@ -153,7 +157,10 @@ const QVector<int> Track::copyItemIdsBetween(qint64 start, qint64 end, bool stri
sort(itemPtrRefs);
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // internal call to the deprecated transformItemPtrsToIds helper
return transformItemPtrsToIds(itemPtrRefs);
#pragma GCC diagnostic pop
}
const QVector<int> Track::itemIdsBetween(qint64 start, qint64 end, bool strict, bool complete, bool recursive,
@@ -171,7 +178,10 @@ const QVector<int> Track::itemIdsBetween(qint64 start, qint64 end, bool strict,
sort(itemPtrRefs);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // internal call to the deprecated transformItemPtrsToIds helper
return transformItemPtrsToIds(itemPtrRefs);
#pragma GCC diagnostic pop
}
QVector<int> itemIds;
@@ -209,7 +219,10 @@ bool Track::isItemsBetween(qint64 start, qint64 end, const QVector<int>& ignoreI
for (const int itemId : std::as_const(m_copyItemIds))
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // internal lookup via the deprecated Track::item
const Item& i = item(itemId);
#pragma GCC diagnostic pop
if (!ignoreIds.contains(i.id()))
if (isItemBetween(i, start, end, strict, complete, minimumDuration))
return true;
@@ -304,7 +317,10 @@ ItemPtrNCVRefs Track::_itemsNCV(bool recursive)
const QVector<int> Track::_itemIds(bool recursive) const
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // internal call to the deprecated transformItemPtrsToIds helper
QVector<int> itemIds(transformItemPtrsToIds(m_items));
#pragma GCC diagnostic pop
if (!recursive)
return itemIds;
@@ -363,19 +379,28 @@ QVector<int> Track::itemIds(bool recursive, bool sorted) const
if (sorted)
{
if (!recursive)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // internal call to the deprecated transformItemPtrsToIds helper
return transformItemPtrsToIds(m_items);
#pragma GCC diagnostic pop
ItemPtrRefs is(_items(true));
sort(is);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // internal call to the deprecated transformItemPtrsToIds helper
return transformItemPtrsToIds(is);
#pragma GCC diagnostic pop
}
QVector<int> itemIds;
itemIds.reserve(m_items.size());
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // internal call to the deprecated transformItemPtrsToIds helper
itemIds += transformItemPtrsToIds(m_items);
#pragma GCC diagnostic pop
if (!recursive)
return itemIds;
@@ -448,7 +473,10 @@ Track& Track::track(int id) noexcept(false)
{
try
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // self-recursive lookup: recurses via the deprecated public Track API
return track->track(id);
#pragma GCC diagnostic pop
}
catch (...)
{
@@ -495,7 +523,10 @@ Item& Track::item(int id) noexcept(false)
{
try
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // self-recursive lookup: recurses via the deprecated public Track API
return track->item(id);
#pragma GCC diagnostic pop
}
catch (...)
{
@@ -519,7 +550,10 @@ const Item& Track::item(int id) const noexcept(false)
{
try
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // self-recursive lookup: recurses via the deprecated public Track API
return track->item(id);
#pragma GCC diagnostic pop
}
catch (...)
{
@@ -935,8 +935,8 @@ void LtsUtilsTest::test_jsonArray()
QVERIFY_EXCEPTION_THROWN(array.at<std::string>(0), JsonTypeError);
QVERIFY_EXCEPTION_THROWN(array.contains<int>(-1), JsonRangeError);
QVERIFY_EXCEPTION_THROWN(array.contains<int>(4), JsonRangeError);
QVERIFY_EXCEPTION_THROWN((void)array.contains<int>(-1), JsonRangeError);
QVERIFY_EXCEPTION_THROWN((void)array.contains<int>(4), JsonRangeError);
QVERIFY_EXCEPTION_THROWN(array.at<int>(-1), JsonRangeError);
QVERIFY_EXCEPTION_THROWN(array.at<int>(4), JsonRangeError);
@@ -223,12 +223,10 @@ template <typename T> bool inline get1Byte(const QByteArray& baData, size_t& pos
if (size_t(baData.size()) < pos + 1)
return false;
const char* data = baData.data() + pos;
if (std::numeric_limits<T>::is_signed)
out = (T)(data[0]);
out = (T)(baData.at(pos));
else
out = (T)(data[0] & 0xFF);
out = (T)(baData.at(pos) & 0xFF);
pos += 1;
@@ -9,7 +9,7 @@ namespace LtsUtils
inline bool lessThan(const QVariant& var1, const QVariant& var2)
{
if (var1.canConvert(QMetaType::QString) && var2.canConvert(QMetaType::QString))
if (var1.canConvert<QString>() && var2.canConvert<QString>())
{
QString str1(var1.toString());
QString str2(var2.toString());
@@ -28,7 +28,7 @@ inline bool lessThan(const QVariant& var1, const QVariant& var2)
return d1 < d2;
}
else if (var1.canConvert(QMetaType::Double) && var2.canConvert(QMetaType::Double))
else if (var1.canConvert<double>() && var2.canConvert<double>())
return var1.toDouble() < var2.toDouble();
return false;
@@ -49,7 +49,7 @@ WebSocketHelper::WebSocketHelper(AbstractClientMessageFactory* messageFactory, L
connect(m_socket, &QWebSocket::textFrameReceived, this, &WebSocketHelper::dataReceived);
connect(m_socket, &QWebSocket::connected, this, &WebSocketHelper::onConnected);
connect(m_socket, &QWebSocket::disconnected, this, &WebSocketHelper::onDisconnected);
connect(m_socket, QOverload<QAbstractSocket::SocketError>::of(&QWebSocket::error), this, &WebSocketHelper::error);
connect(m_socket, &QWebSocket::errorOccurred, this, &WebSocketHelper::error);
}
WebSocketHelper::~WebSocketHelper()
@@ -49,6 +49,7 @@ void LtsAbstractSequenceWidget::getValue(QWidget *data,
return;
data = findChild<QWidget *>(findObjectName);
Q_UNUSED(data);
}
void LtsAbstractSequenceWidget::setMemberCount(int count)
@@ -22,6 +22,7 @@
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QCompleter>
#include <QtCore/QDateTime>
#include <QtCore/QTimeZone>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QHBoxLayout>
#include <QtGui/QKeyEvent>
@@ -248,7 +249,7 @@ int getItemValue(QSpinBox *spinBox)
LtsDateTimeEdit::LtsDateTimeEdit(QWidget *parent, bool withNowButton, bool checkable)
: QWidget(parent)
// , m_uiLe(new Ui::LtsDateTimeEditLe)
, m_scFixed(new QShortcut(QKeySequence(Qt::ShiftModifier + Qt::Key_F2), this, SLOT(setFixedDateTime()), nullptr, Qt::WidgetWithChildrenShortcut))
, m_scFixed(new QShortcut(QKeySequence(Qt::ShiftModifier | Qt::Key_F2), this, SLOT(setFixedDateTime()), nullptr, Qt::WidgetWithChildrenShortcut))
, m_scOffset(new QShortcut(QKeySequence(Qt::Key_F2), this, SLOT(setOffsetDateTime()), nullptr, Qt::WidgetWithChildrenShortcut))
, m_checkable(checkable) // see below
, m_withNowButton(withNowButton) // see below
@@ -551,7 +552,7 @@ bool LtsDateTimeEdit::setMsecsSinceEpoch(qint64 msec, bool setToNearestPossible)
m_curTimeMSec = msec;
const qint64 offsetTimeZoneMsec = getTimezoneAsSecs() * 1000;
const QDateTime datetime(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec + offsetTimeZoneMsec, Qt::UTC));
const QDateTime datetime(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec + offsetTimeZoneMsec, QTimeZone(0)));
const QDate date(datetime.date());
const QTime time(datetime.time());
@@ -940,7 +941,7 @@ bool LtsDateTimeEdit::isDataAcceptable()
return false;
}
qint64 msec = QDateTime(QDate(getYear(), getMonth(), getDay()), QTime(getHour(), getMinute(), getSecond()), Qt::UTC).toMSecsSinceEpoch();
qint64 msec = QDateTime(QDate(getYear(), getMonth(), getDay()), QTime(getHour(), getMinute(), getSecond()), QTimeZone(0)).toMSecsSinceEpoch();
msec -= DTG::timezone2Secs(getTimezone()) * 1000LL;
if (m_minTimeMSec > 0 && m_maxTimeMSec > 0 && m_minTimeMSec < m_maxTimeMSec)
{
@@ -1539,7 +1540,7 @@ void LtsDateTimeEdit::onFocusOutDay()
{
if (m_getCurrentTimeCallback)
{
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), Qt::UTC));
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), QTimeZone(0)));
setDay(dt.date().day());
}
}
@@ -1571,7 +1572,7 @@ void LtsDateTimeEdit::onFocusOutHHMMSS()
{
if (m_getCurrentTimeCallback)
{
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), Qt::UTC));
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), QTimeZone(0)));
setHHMMSS(dt.time().hour(), dt.time().minute(), dt.time().second());
}
}
@@ -1632,7 +1633,7 @@ void LtsDateTimeEdit::onFocusOutMonth()
{
if (m_getCurrentTimeCallback)
{
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), Qt::UTC));
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), QTimeZone(0)));
setMonth(dt.date().month());
}
}
@@ -1671,7 +1672,7 @@ void LtsDateTimeEdit::onFocusOutYear()
{
if (m_getCurrentTimeCallback)
{
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), Qt::UTC));
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), QTimeZone(0)));
setYear(dt.date().year());
}
}
@@ -1768,7 +1769,7 @@ void LtsDateTimeEdit::onMonthWheelEvent(bool bForward, int cursorPos)
if (!isMonthAcceptable())
return;
const int ofs = bForward ? 1 : -1;
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec, Qt::UTC).addMonths(ofs));
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec, QTimeZone(0)).addMonths(ofs));
setMsecsSinceEpoch(dt.toMSecsSinceEpoch(), true);
m_uiLe->leLongMonth->setCursorPosition(cursorPos);
m_uiLe->leLongMonth->setSelection(0, 3);
@@ -1782,7 +1783,7 @@ void LtsDateTimeEdit::onYearWheelEvent(bool bForward, int cursorPos)
if (!isYearAcceptable())
return;
const int ofs = bForward ? 1 : -1;
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec, Qt::UTC).addYears(ofs));
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec, QTimeZone(0)).addYears(ofs));
setMsecsSinceEpoch(dt.toMSecsSinceEpoch(), true);
m_uiLe->leLongYear->setCursorPosition(cursorPos);
m_uiLe->leLongYear->setSelection(0, 2);
@@ -389,7 +389,7 @@ void LtsDialog::addConnections(QWidget *widget)
if (addChangesMadeSignal<QLineEdit>(widget, &QLineEdit::textChanged)) return;
if (addChangesMadeSignal<QDateTimeEdit>(widget, &QDateTimeEdit::dateTimeChanged)) return;
if (addChangesMadeSignal<QComboBox>(widget, &QComboBox::currentTextChanged)) return;
if (addChangesMadeSignal<QCheckBox>(widget, &QCheckBox::stateChanged)) return;
if (addChangesMadeSignal<QCheckBox>(widget, &QCheckBox::checkStateChanged)) return;
if (addChangesMadeSignal<QSpinBox>(widget, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged))) return;
if (addChangesMadeSignal<QDoubleSpinBox>(widget, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged))) return;
if (addChangesMadeSignal<QSlider>(widget, &QSlider::valueChanged)) return;
@@ -437,7 +437,7 @@ private:
for (WidgetType *widget : children)
{
QVariant lastState = widget->property("lastReadOnlyState");
if (lastState.isValid() && !lastState.isNull() && lastState.canConvert(QMetaType::Bool))
if (lastState.isValid() && !lastState.isNull() && lastState.canConvert<bool>())
widget->setReadOnly(lastState.toBool());
}
}
@@ -449,7 +449,7 @@ private:
for (WidgetType *widget : children)
{
QVariant lastState = widget->property("lastEnabledState");
if (lastState.isValid() && !lastState.isNull() && lastState.canConvert(QMetaType::Bool))
if (lastState.isValid() && !lastState.isNull() && lastState.canConvert<bool>())
widget->setEnabled(lastState.toBool());
}
}
@@ -119,6 +119,7 @@ void bt()
}
//qWarning() << "frame" << i << address << function << offset;
(void)offset;
}
free(symbols);
@@ -84,12 +84,12 @@ void LtsMSecDateTimeEdit::setTimezoneHoursOffset(int timezoneHoursOffset)
void LtsMSecDateTimeEdit::setDateTime(const QDateTime &dateTime)
{
// TODO: doesn't make sense, as toMSecsSinceEpoch returns the *UTC version* of the dt, so the timespec stuff does nothing
setMsecsSinceEpoch(QDateTime::fromMSecsSinceEpoch(dateTime.toMSecsSinceEpoch(), Qt::TimeSpec::OffsetFromUTC, m_timezoneHoursOffset * 3600).toMSecsSinceEpoch());
setMsecsSinceEpoch(QDateTime::fromMSecsSinceEpoch(dateTime.toMSecsSinceEpoch(), QTimeZone(m_timezoneHoursOffset * 3600)).toMSecsSinceEpoch());
}
void LtsMSecDateTimeEdit::setMsecsSinceEpoch(qint64 msecs)
{
QDateTimeEdit::setDateTime(QDateTime::fromMSecsSinceEpoch(msecs, Qt::TimeSpec::OffsetFromUTC, m_timezoneHoursOffset * 3600));
QDateTimeEdit::setDateTime(QDateTime::fromMSecsSinceEpoch(msecs, QTimeZone(m_timezoneHoursOffset * 3600)));
}
int LtsMSecDateTimeEdit::msecStepSize() const
@@ -50,11 +50,14 @@ QValidator::State LtsMultiRangeSpinBox::validate(QString &input, int &pos) const
// int value = input.toInt();
// value -= minimum();
// return (value % singleStep() == 0) ? QValidator::Acceptable : QValidator::Intermediate;
Q_UNUSED(input);
Q_UNUSED(pos);
return QValidator::Acceptable;
}
void LtsMultiRangeSpinBox::fixup(QString &str) const
{
Q_UNUSED(str);
// QSpinBox::fixup(str);
@@ -106,7 +106,7 @@ LtsSelectionPopup::~LtsSelectionPopup()
void LtsSelectionPopup::slotFilterChanged()
{
m_filter->setFilterWildcard(m_ui->leSearch->text().count() ? m_ui->leSearch->text() : QStringLiteral("*") /* show everything if nothing was entered */);
m_filter->setFilterWildcard(m_ui->leSearch->text().size() ? m_ui->leSearch->text() : QStringLiteral("*") /* show everything if nothing was entered */);
refresh();
}
@@ -139,7 +139,6 @@ void LtsTextEditor::slotTextBold()
if (m_ui->textEdit->document()->isEmpty())
{
const QString &f = m_ui->cbFonts->currentText();
fmt.setFontFamily(f);
fmt.setFontFamilies({f});
fmt.setForeground(m_foregroundColor);
const qreal pointSize = (m_ui->cbFontSize->currentText().toFloat() > 0 ? m_ui->cbFontSize->currentText().toFloat() : 11);
@@ -158,7 +157,6 @@ void LtsTextEditor::slotTextUnderline()
if (m_ui->textEdit->document()->isEmpty())
{
const QString &f = m_ui->cbFonts->currentText();
fmt.setFontFamily(f);
fmt.setFontFamilies({f});
fmt.setForeground(m_foregroundColor);
const qreal pointSize = (m_ui->cbFontSize->currentText().toFloat() > 0 ? m_ui->cbFontSize->currentText().toFloat() : 11);
@@ -177,7 +175,6 @@ void LtsTextEditor::slotTextItalic()
if (m_ui->textEdit->document()->isEmpty())
{
const QString &f = m_ui->cbFonts->currentText();
fmt.setFontFamily(f);
fmt.setFontFamilies({f});
fmt.setForeground(m_foregroundColor);
const qreal pointSize = (m_ui->cbFontSize->currentText().toFloat() > 0 ? m_ui->cbFontSize->currentText().toFloat() : 11);
@@ -202,7 +199,6 @@ void LtsTextEditor::slotTextFamily(int index)
fmt.setForeground(m_foregroundColor);
}
const QString f = m_ui->cbFonts->currentText();
fmt.setFontFamily(f);
fmt.setFontFamilies({f});
slotMergeFormatOnWordOrSelection(fmt);
}
@@ -223,7 +219,6 @@ void LtsTextEditor::slotTextSize(int index)
if (m_ui->textEdit->document()->isEmpty())
{
const QString &f = m_ui->cbFonts->currentText();
fmt.setFontFamily(f);
fmt.setFontFamilies({f});
fmt.setForeground(m_foregroundColor);
@@ -273,7 +268,6 @@ void LtsTextEditor::slotTextColor()
fmt.setFontWeight(m_ui->pbBold->isChecked() ? QFont::Bold : QFont::Normal);
const QString &f = m_ui->cbFonts->currentText();
fmt.setFontFamily(f);
fmt.setFontFamilies({f});
const qreal pointSize = (m_ui->cbFontSize->currentText().toFloat() > 0 ? m_ui->cbFontSize->currentText().toFloat() : 11);
fmt.setFontPointSize(pointSize);
@@ -652,7 +652,7 @@ void LtsTextEditor2::onTextItalic()
void LtsTextEditor2::onTextFamily(const QString &f)
{
QTextCharFormat fmt;
fmt.setFontFamily(f);
fmt.setFontFamilies({f});
mergeFormatOnWordOrSelection(fmt);
}
@@ -47,7 +47,7 @@ class Interface
{
public:
Interface(LtsSession::LtsSession* session, NGL::INGLLogger& logger)
: m_hasInit(true), m_session(session), m_logger(logger), m_appId(LtsAppDescriptor::App::Login)
: m_hasInit(true), m_session(session), m_appId(LtsAppDescriptor::App::Login), m_logger(logger)
{
}