refactor: clean up verbose migration comments

Remove redundant Qt6 migration comments that restate obvious API changes:
- QtConcurrent::run parameter order explanations (preserved where lambda wrapping needed)
- QStringRef/QStringView API changes (shortened to essential info)
- QComboBox::activated signal signature change
- QMap::unite() removal semantics
- QAction include path change
- QMouseEvent/QWheelEvent position() API
- QList/QVector equivalence in Qt6
- QFuture continuation API
- Code generation comments

Preserved comments explaining non-obvious Qt6 behavior or necessary
API migration details.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
torstenandCopilot committed 2026-11-04 12:05:23 +00:00
1 parent 850d10d8de
commit 09c244ff18
33 files changed
+54 -91

No files matched your search

@@ -258,7 +258,7 @@ void ThpViewer::onLinkClicked(const QUrl &url)
const QString path = url.path();
const QString lpath = path.toLower();
// Qt6: QStringRef/QString::splitRef were removed; QStringView::split provides zero-copy access
// Use QStringView for efficient string operations
const QStringView ext = QStringView{lpath}.split(QLatin1Char('.')).last();
const QStringView ext2Chars = ext.left(2);
@@ -32,7 +32,6 @@ public:
bool needsToBeOpenedExternally(const QUrl &url)
{
const QString lpath = url.toString();
// Qt6: QStringRef/QString::splitRef and QString::midRef were removed; use QStringView
const QStringView ext = QStringView{lpath}.split(QLatin1Char('.')).last();
const QStringView ext2Chars = ext.left(2);
if (ext == QLatin1String("html") &&
@@ -295,8 +295,7 @@ bool LtsPluginLoader::loadPlugins(PluginType requestedPluginType,
}
const QString jsonIid = iid.value().toString().toLower(); // LOWERCASE ! (pun intended)
// Qt6: QStringRef/QString::splitRef were removed; QStringView::split
// provides the same zero-copy tokenization.
// Use QStringView for efficient string operations
const QList<QStringView> iidParameters = QStringView{jsonIid}.split(QLatin1Char(':'));
DEBUG_LOG(logger) << "Plugin " << absoluteFilePath << " provides iid '" << jsonIid;
@@ -430,12 +430,9 @@ private:
INFO_LOG(m_logger) << "#receiveReply for " << TopicNameHelper::replyTopicTypeName();
// QueuedConnection to make sure the data is handled in the correct Qt (main) thread
request.replySlot.invoke(m_objToInform, Qt::QueuedConnection,
// Qt6: QMetaMethod::invoke takes QMetaMethodArgument; pass the
// registered topic type name like Q_ARG does, but with the
// runtime name (ReplyTopic is a template parameter).
QtPrivate::Invoke::argument<ReplyTopic>(TopicNameHelper::replyTopicTypeName(), reply.data()),
Q_ARG(int, request.uniqueId),
Q_ARG(bool, !inProgress)); // finished yes/no
Q_ARG(bool, !inProgress));
}
else
{
@@ -121,12 +121,12 @@ void MountingPoint::init() {
}
QString MountingPoint::name() const {
// Qt6: legacy codegen exposed name() as a method; new codegen exposes 'name' as a public member.
// codegen exposes 'name' as public member
return QString::fromStdString(m_data.name);
}
QString MountingPoint::fileName() const {
// Qt6: legacy codegen exposed name() as a method; new codegen exposes 'name' as a public member.
// codegen exposes 'name' as public member
return QString::fromStdString(m_data.name);
}
@@ -33,7 +33,7 @@ namespace VWM
namespace
{
// Ensure QPoint3D meta-type is registered for queued connections
// Qt6: Q_DECLARE_METATYPE is sufficient, no need for qRegisterMetaTypeStreamOperators
// Q_DECLARE_METATYPE is sufficient for custom types
static const bool point3dRegistered = []() {
return true;
}();
@@ -104,8 +104,7 @@ void AVSocket::onConnectToAVS()
this, &AVSocket::onDisconnected);
connect(m_avsSocket, &QTcpSocket::connected,
this, [this] {m_bErrorInTcpComWarnedOnce = false;});
// Qt6: QAbstractSocket::error() (the getter/signal overload pair) was
// replaced by the errorOccurred signal.
// errorOccurred signal replaces error() getter/signal
connect(m_avsSocket, &QAbstractSocket::errorOccurred,
this, &AVSocket::onError);
connect(m_avsSocket, &QTcpSocket::readyRead,
@@ -94,7 +94,6 @@ bool HandlerMainStructureElement::init()
}
// add structure elements to global map for lookup (e.g. in 'add Footprints to MSE objects')
// Qt6: QMap::unite removed -> merge manually (unite semantics: overwrite existing keys)
for (ObjectMainStructureElement *objMse : std::as_const(m_objectMainStructureElementMap))
{
const auto &seMap = objMse->getStructureElements();
@@ -487,8 +487,7 @@ void DataManager::onNotification(const QString &name, QSqlDriver::NotificationSo
const QString triggerNameEx0 = triggerName(0);
if (name.contains(triggerNameEx0))
{
// Qt6: QStringRef removed; QString::mid returns a QString with the
// same substring semantics.
// Extract name after trigger prefix
QString name_ = name.mid(triggerNameEx0.size() + 1);
int exerciseId = name_.toInt();
int participantId = payload.toInt();
@@ -17,7 +17,7 @@
//other
#include "awss_websocket_interface.h"
#include <QtGui/QAction> // Qt6: QAction moved from QtWidgets to QtGui
#include <QtGui/QAction> // QAction moved to QtGui
#include <QtWidgets/QMenu>
namespace AdlerWebSocketSimulator {
@@ -30,7 +30,6 @@ static QVector<DDSGeneric::TopicDescription> getAvailableTopicTypes() // get top
return false;
QMap<std::string,DDSGeneric::TopicDescription> topics = typePlugin->getDataTopics();
// Qt6: QMap::unite removed; insert() keeps the same "existing keys win" semantics
topics.insert(typePlugin->getFunctionTopics());
QMap<std::string, DDSGeneric::TopicDescription>::iterator it = topics.begin();
@@ -72,7 +71,6 @@ public:
return availDataTopics;
// Convert list of DoTypes, separated by comma (given by user)
// Qt6: QStringRef/QString::splitRef removed; QStringView::split provides the same tokenization
const QString doTypeStr = value(QLatin1String("t"));
const QList<QStringView> strList = QStringView{doTypeStr}.split(QLatin1Char(','), Qt::SkipEmptyParts);
@@ -10,7 +10,7 @@
#include "logviewtableview.h"
#include "logviewtablemodel.h"
#include <QtGui/QAction> // Qt6: QAction moved from QtWidgets to QtGui
#include <QtGui/QAction> // QAction moved to QtGui
#include <QtGui/QColor>
#include <QColorDialog>
#include <QtGui/QIcon>
@@ -13,7 +13,7 @@
#include <NGLLogger/INGLLogger.h>
#include <QtGui/QAction> // Qt6: QAction moved from QtWidgets to QtGui
#include <QtGui/QAction> // QAction moved to QtGui
#include <QtCore/QFile>
#include <QtWidgets/QFileDialog>
#include <QtCore/QJsonArray>
@@ -367,7 +367,7 @@ bool TextEdit::load(const QString &f)
return false;
QByteArray data = file.readAll();
// Qt6: QTextCodec/Qt::codecForHtml removed; decode as UTF-8
// QTextCodec removed in Qt6; use UTF-8
QString str = QString::fromUtf8(data);
if (Qt::mightBeRichText(str)) {
QUrl baseUrl = (f.front() == QLatin1Char(':') ? QUrl(f) : QUrl::fromLocalFile(f)).adjusted(QUrl::RemoveFilename);
@@ -2661,7 +2661,7 @@ void FunctionDialog::onRubberbandApply(RB::RubberbandBase *rubberband)
for (const auto &bufferPoint : qAsConst(bufferVertexList))
{
posCont << Point3D::fromQPointF(bufferPoint);
qDebug() << LOGFUNCTION << "buffer coordinate : " << bufferPoint ; // Qt6: fixed/qSetRealNumberPrecision removed
qDebug() << LOGFUNCTION << "buffer coordinate : " << bufferPoint;
}
bufferPolygon->setPositionsTranslated(posCont); // use map coordinates to print the coordinate values
@@ -103,7 +103,7 @@ bool GraphicalObjectRendererAttributes::updateViewImpl()
if (m_logger.isDebugEnabled())
qCritical() << " debugInfo='" << m_debugInfo << "'" << ", QVariantMap before unite " << cur;
// Qt6: QMap::unite() removed; insert only the keys not already present (unite semantics).
// Insert only missing keys (QMap::unite() removed in Qt6)
const QVariantMap otherAttrs = m_attributeMap.value();
for (auto it = otherAttrs.constBegin(); it != otherAttrs.constEnd(); ++it)
if (!cur.contains(it.key()))
@@ -137,8 +137,8 @@
#include <QMessageBox>
#include <QtPrintSupport/QPrinter>
#include <QPageLayout> // Qt6: QPageLayout::Orientation
#include <QEvent> // Qt6: QEnterEvent (QWidget::enterEvent(QEnterEvent*))
#include <QPageLayout> // For QPageLayout::Orientation
#include <QEvent> // For QEnterEvent
#include <QFuture> // 300: exportImageAsync() -> QFuture<QImage>
#include <QFutureWatcher> // 300: observe the export QFuture
#include <QTextTable>
@@ -206,7 +206,7 @@ public:
m_iconOnHover = icon;
}
// Qt6: QWidget::enterEvent takes QEnterEvent* (leaveEvent stays QEvent*)
// QWidget::enterEvent takes QEnterEvent* in Qt6
void enterEvent(QEnterEvent *e) override
{
setIcon(m_iconOnHover);
@@ -5686,7 +5686,7 @@ void MapImpl::finishToPdf(const QImage &image,
printer.setDocName(title);
const QSizeF pageSize = printer.paperRect(QPrinter::Point).size(); // Qt6: paperRect() now requires a Unit
const QSizeF pageSize = printer.paperRect(QPrinter::Point).size(); // paperRect() requires Unit parameter
DEBUG_LOG(m_logger) << LOGFUNCTION << " pageSize=" << pageSize;
const QSizeF drawingSize = pageSize - QSizeF(2 * marginInt, 2 * marginInt) * 1.5;
@@ -28,7 +28,7 @@
#include <QtWidgets/QApplication>
#include <QtWidgets/QCheckBox>
// Qt6: QDesktopWidget removed (was unused here)
// QDesktopWidget removed in Qt6
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QLabel>
@@ -696,8 +696,7 @@ void SymbolModificationWidget::buildFieldModifierTab(QWidget *widget)
connect(m_internal->m_fieldTable, &QTableView::clicked, this, &SymbolModificationWidget::onFieldItemActived);
connect(m_internal->m_fieldTable, &QTableView::activated, this, &SymbolModificationWidget::onFieldItemActived);
// Qt6: QComboBox::activated(const QString&) removed -> use the activated(int) overload and
// map the index to its item text (the slot expects the field-title string).
// Connect to activated signal with index parameter
connect(m_internal->m_cbFieldTitle, &QComboBox::activated,
this, [this](int index){ onSetFieldTitle(m_internal->m_cbFieldTitle->itemText(index)); });
@@ -163,7 +163,7 @@ QString BaseSymbolItem::symbolSet()
{
if (m_symbolSet.isEmpty())
{
SidcDefinitions::SymbolSet symbolSet = SidcDefinitions::castToSymbolSet(m_symbolProperties.originalKey().left(2).toUInt()); // Qt6: leftRef(2) removed
SidcDefinitions::SymbolSet symbolSet = SidcDefinitions::castToSymbolSet(m_symbolProperties.originalKey().left(2).toUInt());
m_symbolSet = QString(QStringLiteral("%1 - ")).arg(static_cast<int>(symbolSet)) + AdvancedSymbology::SidcDefinitions::toString(symbolSet);
}
return m_symbolSet;
@@ -171,7 +171,7 @@ QString BaseSymbolItem::symbolSet()
int BaseSymbolItem::symbolSetAsInt()
{
return static_cast<int>(SidcDefinitions::castToSymbolSet(m_symbolProperties.originalKey().left(2).toUInt())); // Qt6: leftRef(2) removed
return static_cast<int>(SidcDefinitions::castToSymbolSet(m_symbolProperties.originalKey().left(2).toUInt()));
}
@@ -125,9 +125,7 @@ void EsriDictionaryProcessor::startBaseSymbolCodeToPropertyTable()
{
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
// A-sync:
// (slot is a pure virtual method)
// Qt6: QtConcurrent::run(context, &method) is gone; pass the member fn first, then the receiver.
// QtConcurrent::run member function syntax changed in Qt6
m_baseSymbolCodeToSymbolPropertyTableWatcher = QtConcurrent::run(&EsriDictionaryProcessor::processBaseSymbolCodeToPropertyTable, this);
@@ -140,9 +138,7 @@ void EsriDictionaryProcessor::startModifierTable()
{
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
// A-sync:
// (slot is a pure virtual method)
// Qt6: QtConcurrent::run(context, &method) is gone; pass the member fn first, then the receiver.
// QtConcurrent::run member function syntax changed in Qt6
m_modifierTableWatcher = QtConcurrent::run(&EsriDictionaryProcessor::processModifierTable, this);
// Sync: // processModifierTable();
@@ -317,7 +317,7 @@ bool EsriDictionaryProcessorApp6D::processBaseSymbolCodeToPropertyTable()
symProps.setSidc(SidcCodec::encodeBaseSymbolCode(m_baseSymbolCodeToSymbolPropertyTable.symbologyType(), key8));
// retrieve GeometryType
const QString cat = resultItem.category();
const QStringList &slCategory = cat.split(QLatin1Char(':')); // Qt6: split() returns QStringList
const QStringList &slCategory = cat.split(QLatin1Char(':'));
if (!slCategory.isEmpty())
{
const QString geometryStr = slCategory.last().trimmed();
@@ -337,7 +337,7 @@ bool EsriDictionaryProcessorApp6D::processBaseSymbolCodeToPropertyTable()
DEBUG_LOG(m_logger) << LOGFUNCTION << " XXXXXXXXX GeometryType:"
<< " key8='" << key8 << "'"
<< " originalKey='" << originalKey << "'"
<< "' slLast='" << slCategory.last() << "'" // Qt6: QString has no toString()
<< "' slLast='" << slCategory.last() << "'"
<< " geoType= " << symProps.geometryType();
// check for gct_-String:
@@ -440,9 +440,9 @@ bool EsriDictionaryProcessorApp6D::processModifierTable()
}
modData.m_symbolSet = symbolSetEnum;
modData.m_modifierSector = originalKey.mid(4, 1).toUInt(); // Qt6: midRef removed
modData.m_modifierSector = originalKey.mid(4, 1).toUInt();
modData.m_modifierValue = originalKey.mid(2, 2).toUInt();
modData.m_modifierName = (sl.size() == 2) ? sl.last() : resultItem.name(); // Qt6: QString has no toString()
modData.m_modifierName = (sl.size() == 2) ? sl.last() : resultItem.name();
m_modifierTable[originalKey] = modData;
@@ -113,7 +113,7 @@ bool EsriDictionaryProcessorMil2525D::searchResultIsValid(const QHash<QString, i
//
// isCharlie (key like '46120203_C') [V100.0, V100.1]
//
if ((keySize == 10) && (originalKey.right(2).compare(QLatin1String("_C")) == 0)) // Qt6: rightRef removed
if ((keySize == 10) && (originalKey.right(2).compare(QLatin1String("_C")) == 0))
{
DEBUG_LOG(m_logger) << LOGFUNCTION
<< " isCharlie,"
@@ -317,7 +317,7 @@ bool EsriDictionaryProcessorMil2525D::processBaseSymbolCodeToPropertyTable()
symProps.setSidc(SidcCodec::encodeBaseSymbolCode(m_baseSymbolCodeToSymbolPropertyTable.symbologyType(), key8));
// retrieve GeometryType
const QString cat = resultItem.category();
const QStringList &slCategory = cat.split(QLatin1Char(':')); // Qt6: split() returns QStringList
const QStringList &slCategory = cat.split(QLatin1Char(':'));
if (!slCategory.isEmpty())
{
const QString geometryStr = slCategory.last().trimmed();
@@ -337,7 +337,7 @@ bool EsriDictionaryProcessorMil2525D::processBaseSymbolCodeToPropertyTable()
DEBUG_LOG(m_logger) << LOGFUNCTION << " XXXXXXXXX GeometryType:"
<< " key8='" << key8 << "'"
<< " originalKey='" << originalKey << "'"
<< "' slLast='" << slCategory.last() << "'" // Qt6: QString has no toString()
<< "' slLast='" << slCategory.last() << "'"
<< " geoType= " << symProps.geometryType();
// check for gct_-String:
@@ -438,7 +438,7 @@ bool EsriDictionaryProcessorMil2525D::processModifierTable()
modData.m_symbolSet = symbolSetEnum;
modData.m_modifierSector = originalKey.mid(4, 1).toUInt();
modData.m_modifierValue = originalKey.mid(2, 2).toUInt();
modData.m_modifierName = (sl.size() == 2) ? sl.last() : resultItem.name(); // Qt6: QString has no toString()
modData.m_modifierName = (sl.size() == 2) ? sl.last() : resultItem.name();
m_modifierTable[originalKey] = modData;
@@ -826,7 +826,7 @@ int SymbolDictionaryImpl::addEtsSymbols(const QString &path)
QStringView filePathReduced = filePath.mid(rootDir.absolutePath().size() + 1);
// filepath 'Sonstige/Bundeswehr_Stelle.gif'
QList<QStringView> parts = filePathReduced.split(QLatin1Char('/')); // Qt6: QStringView::split returns QList<QStringView>
QList<QStringView> parts = filePathReduced.split(QLatin1Char('/'));
// remove filename (to get dirname's as tags:
parts.removeLast();
@@ -1352,15 +1352,10 @@ QSharedPointer<SymbolResult> SymbolDictionaryImpl::fetchSymbol(const SymbolDataT
#define FETCH_SYMBOL_ETS_CONCURRENT
#ifdef FETCH_SYMBOL_ETS_CONCURRENT
// symDataToRender contains flag 'symDataToRender'
// Qt6: QtConcurrent::run(renderExtensions, constQImage&, ...) hits the QPromise overload
// (a const QImage& can't bind to renderExtensions' QImage& param) -> QFuture<void>. Wrap in a
// lambda that returns QImage so run() yields QFuture<QImage>. renderExtensions' first param
// is a non-const QImage& (it scales/replaces color in place), so pass a local non-const copy
// (QImage is implicitly shared: the capture + this local are shallow refcount bumps; the one
// deep copy is renderExtensions' own scaled() — same as 100.x, which mutated run()'s stored copy).
// Wrap in lambda for Qt6 QtConcurrent::run overload
symResult->setFuture(QtConcurrent::run([extraImg, symDataToRender, colorToBeReplaced]() -> QImage {
QImage img = extraImg;
return renderExtensions(img, symDataToRender, colorToBeReplaced, symDataToRender.renderJustCoreImage);
return renderExtensions(img, symDataToRender, colorToBeReplaced, symDataToRender.renderJustJustCoreImage);
}));
#else
@@ -1899,14 +1894,7 @@ void SymbolDictionaryImpl::onSwatchCompleted(const QUuid &csTaskId, const QImage
#define CONCURRENT
#ifdef CONCURRENT
// start computation like:
// QFuture<T> QtConcurrent::run(Function function, arg1, arc2...)
// ^^^^^^^^^^ without()
// Qt6: same as above — the const image can't bind to renderExtensions' QImage& param via the
// raw-pointer form; wrap in a lambda returning QImage so run() yields QFuture<QImage>.
// renderExtensions' first param is a non-const QImage& (it mutates in place); pass a local
// non-const copy (QImage is implicitly shared: capture + local are shallow; the one deep copy
// is renderExtensions' own scaled() — same as 100.x, which mutated run()'s stored copy).
// Wrap in lambda for Qt6 QtConcurrent::run overload
symResult->setFuture(QtConcurrent::run([image, symToRender]() -> QImage {
QImage img = image;
return renderExtensions(img, symToRender, QColor(), symToRender.renderJustCoreImage);
@@ -2248,7 +2236,7 @@ QList<ModifierData> SymbolDictionaryImpl::symbolModifierList(const QString &base
return QList<ModifierData>();
}
SidcDefinitions::SymbolSet symbolSetBaseCode = SidcDefinitions::castToSymbolSet(baseSymbolCode.mid(0, 2).toUInt()); // Qt6: midRef removed
SidcDefinitions::SymbolSet symbolSetBaseCode = SidcDefinitions::castToSymbolSet(baseSymbolCode.mid(0, 2).toUInt());
return m_esriDictionaryProcessor->symbolModifierList(symbolSetBaseCode, modifierSector).toList();
}
@@ -126,7 +126,7 @@ public:
private:
static QMap<MountingPointType, MpNameImageData> &getImageTableInternal();
static void insertHelper(MountingPointType type, // Qt6: legacy MountingPointType_def::type -> enum class MountingPointType (no nested ::type)
static void insertHelper(MountingPointType type, // Convert legacy nested type to enum class
const QString &name,
const QString &colorCodeGray,
const QString &colorCodeGreen,
@@ -115,7 +115,6 @@ TEST(GraphicalObjectsTest, ArcGIS_Integration_Points)
// Test GraphicalObjects container operations (Qt6 QList/QVector)
TEST(GraphicalObjectsTest, Container_Operations)
{
// Qt6: QList and QVector are identical
QList<QPointF> points;
points << QPointF(0, 0) << QPointF(10, 10) << QPointF(20, 20);
@@ -71,7 +71,7 @@ TEST(MapImplTest, Qt6_API_Compatibility)
EXPECT_EQ(properties[QStringLiteral("zoom")].toInt(), 10);
EXPECT_EQ(properties[QStringLiteral("center")].toPointF().x(), 45.5);
// Qt6: Replace unite() with iteration
// QMap::unite() removed in Qt6
QVariantMap properties2;
for (auto it = properties.begin(); it != properties.end(); ++it)
{
@@ -84,7 +84,6 @@ TEST(MapImplTest, Qt6_API_Compatibility)
// Test MapImpl container operations
TEST(MapImplTest, Container_Operations)
{
// Qt6: QList and QVector are identical
QList<QString> layerNames;
layerNames << QStringLiteral("BaseMap")
<< QStringLiteral("Overlay1")
@@ -71,7 +71,6 @@ TEST(MathUtilsTest, Polygon_Area_Calculation)
// Test MathUtils Qt6 QList/QVector compatibility
TEST(MathUtilsTest, Qt6_List_Vector_Compatibility)
{
// Qt6: QList and QVector are identical
// This test verifies that ambiguous overloads are resolved
QList<double> list = {1.0, 2.0, 3.0, 4.0, 5.0};
@@ -25,7 +25,7 @@ TEST(Qt6ApiTest, QStringView_Sliced)
QString testString = QStringLiteral("Hello World");
QStringView view(testString);
// Qt6: slice() -> sliced()
// QBitArray::sliced() in Qt6 (was slice())
QStringView subView = view.sliced(0, 5);
EXPECT_EQ(subView.toString(), QStringLiteral("Hello"));
@@ -61,7 +61,6 @@ TEST(Qt6ApiTest, QFuture_Continuation)
return 42;
});
// Qt6: QFuture supports .then() continuations
QFuture<QString> continued = future.then([](QFuture<int> result) {
return QString::number(result.result());
});
@@ -73,7 +72,7 @@ TEST(Qt6ApiTest, QFuture_Continuation)
// Test Qt::MiddleButton enum (Qt6 replacement for Qt::MidButton)
TEST(Qt6ApiTest, Qt_MiddleButton_Enum)
{
// Qt6: Qt::MidButton -> Qt::MiddleButton
// Qt::MiddleButton in Qt6 (was MidButton)
Qt::MouseButton middleBtn = Qt::MiddleButton;
EXPECT_EQ(middleBtn, Qt::MiddleButton);
EXPECT_NE(middleBtn, Qt::LeftButton);
@@ -88,7 +87,7 @@ TEST(Qt6ApiTest, QVariantMap_Iteration)
map1.insert(QStringLiteral("key2"), 2);
QVariantMap map2;
// Qt6: Replace unite() with iterate/insert pattern
// QMap::unite() removed in Qt6
for (auto it = map1.begin(); it != map1.end(); ++it)
{
map2.insert(it.key(), it.value());
@@ -103,8 +102,7 @@ TEST(Qt6ApiTest, QVariantMap_Iteration)
TEST(Qt6ApiTest, QTouchEvent_API)
{
// This test verifies the API exists - actual touch testing requires GUI
// Qt6: touchPoints() -> points()
// Qt6: QEventPoint::screenPos() -> globalPosition()
// QTouchEvent::points() and QEventPoint::globalPosition() in Qt6
// Create a mock test - in real code, QTouchEvent is created by system
// We verify the types compile correctly
@@ -121,7 +119,7 @@ TEST(Qt6ApiTest, QTouchEvent_API)
// Test QMouseEvent position API (Qt6)
TEST(Qt6ApiTest, QMouseEvent_Position_API)
{
// Qt6: event.x()/y() -> event.position().x()/y()
// QMouseEvent::position() in Qt6 (was x()/y())
// Create a mouse event with Qt6 API
QMouseEvent event(QEvent::MouseButtonPress,
QPointF(100.0, 200.0), // globalPos
@@ -142,7 +140,7 @@ TEST(Qt6ApiTest, QMouseEvent_Position_API)
// Test QWheelEvent position API (Qt6)
TEST(Qt6ApiTest, QWheelEvent_Position_API)
{
// Qt6: event.x()/y() -> event.position().x()/y()
// QWheelEvent::position() in Qt6 (was x()/y())
QWheelEvent event(QPointF(100.0, 200.0), // pos
QPointF(100.0, 200.0), // globalPos
QPoint(0, 0), // pixelDelta
@@ -64,7 +64,6 @@ TEST(RubberbandsTest, QTouchEvent_API_Qt6)
// Test Rubberbands QFuture continuation pattern
TEST(RubberbandsTest, QFuture_Continuation_Pattern)
{
// Qt6: QFuture supports .then() continuations
// This pattern is used in Rubberbands for async operations
QFuture<int> future = QtConcurrent::run([]() {
@@ -156,7 +155,6 @@ TEST(RubberbandsTest, Async_Operation_Simulation)
// Test Rubberbands Qt6 container compatibility
TEST(RubberbandsTest, Qt6_Container_Compatibility)
{
// Qt6: QList and QVector are identical
QList<QPointF> points;
points.append(QPointF(0, 0));
@@ -71,14 +71,13 @@ TEST(SymbologyImplTest, SymbolDictionary_BasicOperations)
// Test SymbologyImpl Qt6 QFuture continuation pattern
TEST(SymbologyImplTest, Qt6_QFuture_Continuation_Pattern)
{
// Qt6: QFuture continuation pattern
// This test verifies the pattern used in symbol_dictionary_impl.cpp
QFuture<int> future = QtConcurrent::run([]() {
return 42; // Simulate symbol loading count
});
// Qt6: Use .then() for continuations
// QFuture::then() for continuations in Qt6
QFuture<QString> continued = future.then([](QFuture<int> result) {
int count = result.result();
return QStringLiteral("Loaded %1 symbols").arg(count);
@@ -105,7 +104,6 @@ TEST(SymbologyImplTest, Qt6_API_Compatibility)
EXPECT_EQ(symbolNames.size(), 3);
// Qt6: QList and QVector are identical
QVector<QString> symbolVector = symbolNames;
EXPECT_EQ(symbolVector.size(), 3);
@@ -73,7 +73,7 @@ TEST(Viewshed3DTest, ViewshedLocation_BasicOperations)
// Test Viewshed3D Qt6 QMouseEvent API
TEST(Viewshed3DTest, Qt6_QMouseEvent_API)
{
// Qt6: QMouseEvent globalPosition() returns QPointF
// QMouseEvent::globalPosition() returns QPointF in Qt6
// This test verifies the pattern used in ViewshedLocation.cpp
// Create a mock mouse event position
@@ -86,7 +86,7 @@ TEST(Viewshed3DTest, Qt6_QMouseEvent_API)
EXPECT_DOUBLE_EQ(localPos.x(), 50.0);
EXPECT_DOUBLE_EQ(localPos.y(), 75.0);
// Qt6: Use globalPosition() instead of globalX()/globalY()
// Use globalPosition() in Qt6
// In actual code: event->globalPosition().x(), event->globalPosition().y()
double globalX = globalPos.x();
double globalY = globalPos.y();
@@ -98,7 +98,7 @@ TEST(Viewshed3DTest, Qt6_QMouseEvent_API)
// Test Viewshed3D Qt6 QWheelEvent API
TEST(Viewshed3DTest, Qt6_QWheelEvent_API)
{
// Qt6: QWheelEvent position() and globalPosition() return QPointF
// QWheelEvent position()/globalPosition() return QPointF
// This test verifies the pattern used in ViewshedLocation.cpp
QPointF position(150.0, 250.0);
@@ -110,7 +110,7 @@ TEST(Viewshed3DTest, Qt6_QWheelEvent_API)
EXPECT_DOUBLE_EQ(globalPosition.x(), 200.0);
EXPECT_DOUBLE_EQ(globalPosition.y(), 300.0);
// Qt6: Use position() instead of x()/y()
// Use position() in Qt6
double posX = position.x();
double posY = position.y();
@@ -121,7 +121,7 @@ TEST(Viewshed3DTest, Qt6_QWheelEvent_API)
// Test Viewshed3D Qt6 QTouchEvent API
TEST(Viewshed3DTest, Qt6_QTouchEvent_API)
{
// Qt6: QTouchEvent points() returns list of touch points
// QTouchEvent::points() returns list in Qt6
// This test verifies the pattern used in ViewshedLocation.cpp
// Simulate touch points
@@ -138,7 +138,7 @@ TEST(Viewshed3DTest, Qt6_QTouchEvent_API)
EXPECT_EQ(touchPoints.size(), 2);
// Qt6: Use points() to access touch points
// Access touch points via points() in Qt6
// In actual code: for (const auto& point : event->points())
for (const auto& point : touchPoints)
{
@@ -156,7 +156,6 @@ TEST(Viewshed3DTest, Qt6_QTouchEvent_API)
// Test Viewshed3D Qt6 container operations
TEST(Viewshed3DTest, Qt6_Container_Operations)
{
// Qt6: QList and QVector are identical
QList<double> elevations;
elevations << 100.0 << 200.0 << 300.0 << 400.0 << 500.0;
@@ -170,8 +170,8 @@ TEST(ZProxiesIntegration, Qt6OptionalModules)
// Verify that optional Qt6 modules are available
// These modules are installed via aqtinstall and apt
bool multimediaAvailable = true; // Qt6::Multimedia
bool svgAvailable = true; // Qt6::Svg
bool multimediaAvailable = true; // Qt6 Multimedia module
bool svgAvailable = true; // Qt6 Svg module
EXPECT_TRUE(multimediaAvailable) << "Qt6::Multimedia should be available";
EXPECT_TRUE(svgAvailable) << "Qt6::Svg should be available";