TD: port to Qt6

* in QtConcurrent::run the order of 1st and 2nd argument are swapped
* QtConcurrent::run asserts that the argument of the passed function pointer is not non-const
* Used methods of QFontDatabase are static in Qt5 and Qt6
* QTextStream::setCodec() has been removed in Qt6
* Argument of enterEvent() has changed from QEvent to QEnterEvent
* QTextCharFormat::setFamily() is deprecated
This commit is contained in:
wmayer
2023-03-15 23:49:46 +01:00
committed by WandererFan
parent 04db253b8a
commit 16e27eecc7
13 changed files with 43 additions and 12 deletions

View File

@@ -390,7 +390,11 @@ TechDraw::GeometryObjectPtr DrawViewPart::buildGeometryObject(TopoDS_Shape& shap
//https://github.com/KDE/clazy/blob/1.11/docs/checks/README-connect-3arg-lambda.md
connectHlrWatcher = QObject::connect(&m_hlrWatcher, &QFutureWatcherBase::finished,
&m_hlrWatcher, [this] { this->onHlrFinished(); });
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
m_hlrFuture = QtConcurrent::run(go.get(), &GeometryObject::projectShape, shape, viewAxis);
#else
m_hlrFuture = QtConcurrent::run(&GeometryObject::projectShape, go.get(), shape, viewAxis);
#endif
m_hlrWatcher.setFuture(m_hlrFuture);
waitingForHlr(true);
}
@@ -430,7 +434,11 @@ void DrawViewPart::onHlrFinished(void)
connectFaceWatcher =
QObject::connect(&m_faceWatcher, &QFutureWatcherBase::finished, &m_faceWatcher,
[this] { this->onFacesFinished(); });
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
m_faceFuture = QtConcurrent::run(this, &DrawViewPart::extractFaces);
#else
m_faceFuture = QtConcurrent::run(&DrawViewPart::extractFaces, this);
#endif
m_faceWatcher.setFuture(m_faceFuture);
waitingForFaces(true);
}