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:
1 parent
062bf8f96e
commit
87235db012
33 files changed
+54
-91
No files matched your search
@@ -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";
|
||||
|
||||
Reference in new issue
Block a user