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:
33 files changed
+54
-91
No files matched your search
+1
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
+1
-1
@@ -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>
|
||||
|
||||
+1
-2
@@ -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)); });
|
||||
|
||||
|
||||
+2
-2
@@ -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()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-6
@@ -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();
|
||||
|
||||
+4
-4
@@ -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;
|
||||
|
||||
|
||||
+4
-4
@@ -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;
|
||||
|
||||
|
||||
+5
-17
@@ -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();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user