Commit 6af4910a authored by Maksim Demyanov's avatar Maksim Demyanov Committed by Sergio Martins
Browse files

Formating readme qt6 files

parent b183b331
......@@ -2,52 +2,71 @@ Warn against deprecated API in Qt6
The code is fixed when possible.
QDate::toString(Qt::DateFormat format, QCalendar cal) becomes QDate::toString(Qt::DateFormat format)
* `QDate::toString(Qt::DateFormat format, QCalendar cal)` becomes `QDate::toString(Qt::DateFormat format)`.
QDateTime(const QDate &) becomes QDate::startOfDay().
* `QDateTime(const QDate &)` becomes `QDate::startOfDay()`.
QDir dir; dir = "..." becomes QDir dir; dir.setPath("...");
QDir::addResourceSearchPath() becomes QDir::addSearchPath() with prefix.
Only warning are emitted for addResourceSearchPath.
* `QDir dir; dir = "..."` becomes `QDir dir; dir.setPath("...")`.
QProcess::start() becomes QProcess::startCommand().
* `QDir::addResourceSearchPath()` becomes `QDir::addSearchPath()` with prefix.
QResource::isCompressed() is replaced with QResource::compressionAlgorithm()
* Only warning are emitted for `addResourceSearchPath`.
QSignalMapper::mapped() is replaced with QSignalMapper::mappedInt, mappedString, mappedObject depending on the argument of the function.
* `QProcess::start()` becomes `QProcess::startCommand()`.
QString::SplitBehavior is replaced with Qt::SplitBehavior.
* `QResource::isCompressed()` is replaced with `QResource::compressionAlgorithm()`.
Qt::MatchRegExp is replaced with Qt::MatchRegularExpression.
* `QSignalMapper::mapped()` is replaced with `QSignalMapper::mappedInt`, `QSignalMapper::mappedString`, `QSignalMapper::mappedObject` depending on the argument of the function.
QTextStream functions are replaced by the one under the Qt namespace.
* `QString::SplitBehavior` is replaced with `Qt::SplitBehavior`.
QVariant operators '<' '<=' '>' '>=' are replaced with QVariant::compare() function.
QVariant v1; QVariant v2; 'v1 < v2' becomes 'QVariant::compare(v1, v2) < 0'.
* `Qt::MatchRegExp` is replaced with `Qt::MatchRegularExpression`.
QWizard::visitedPages() is replaced with QWizard::visitedIds().
* `QTextStream` functions are replaced by the one under the Qt namespace.
QButtonGroup buttonClicked/Pressed/Released/Toggled(int) is replaced with QButtonGroup::idClicked/Pressed/Released/Toggled(int).
* `QVariant` operators '`<`' '`<=`' '`>`' '`>=`' are replaced with `QVariant::compare()` function.
QCombobox::activated(const QString &) and highlighted(const QString &) are replaced with QComboBox::textActivated or textHighlighted respectively.
* `QVariant v1; QVariant v2; 'v1 < v2'` becomes '`QVariant::compare(v1, v2) < 0`'.
* `QWizard::visitedPages()` is replaced with `QWizard::visitedIds()`.
* `QButtonGroup buttonClicked/Pressed/Released/Toggled(int)` is replaced with `QButtonGroup::idClicked/Pressed/Released/Toggled(int)`.
* `QCombobox::activated(const QString &)` and `highlighted(const QString &)` are replaced with `QComboBox::textActivated` or `textHighlighted` respectively.
Warning for:
Usage of QMap::insertMulti, uniqueKeys, values, unite, to be replaced manumally with QMultiMap versions.
Usage of QHash::uniqueKeys, to be replaced manumally with QMultiHash versions.
Usage of QLinkedList, to be replaced manually with std::list.
Usage of global qrand() and qsrand(), to be replaced manually using QRandomGenerator.
Usage of QTimeLine::curveShape and setCurveShape, to be replaced manually using QTimeLine::easingCurve and QTimeLine::setEasingCurve.
Usage of QSet and QHash biderectional iterator. Code has to be ported manually using forward iterator.
Usage of QMacCocoaViewContainer, to be replaced manually using QWindow::fromWinId and QWidget::createWindowContainer instead.
Usage of QMacNativeWidget, to be replaced manually using QWidget::winId instead.
Usage of QComboBox::SizeAdjustPolicy::AdjustToMinimumContentsLength, to be replaced manually using AdjustToContents or AdjustToContentsOnFirstShow.
Usage of QComboBox::currentIndexChanged(const QString &), to be replaced manually using currentIndexChanged(int) instead, and getting the text using itemText(index).
Usage of QSplashScreen(QWidget *parent,...), to be replaced manually with the constructor taking a QScreen *.
Usage of QTextBrowser::highlighted(const QString &), to be replaced manually with highlighted(const QUrl &).
Usage of QDockWidget::AllDockWidgetFeatures, to be replaced manually with DockWidgetClosable|DockWidgetMovable|DockWidgetFloatable.
Usage of QDirModel, to be replaced manually with QFileSystemModel.
Usage of QGraphicsView::matrix, setMatrix(const QMatrix &) and resetMatrix, to be replaced manually with QGraphicsView::transform, setTransform(const QTransform &) and resetTransfrom.
Usage of the following QStyle enum: QStyle::PixelMetrix::PM_DefaultTopLevelMargin, PM_DefaultChildMargin, PM_DefaultLayoutSpacing and QStyle::SubElement::SE_DialogButtonBoxLayoutItem.
* Usage of `QMap::insertMulti`, `uniqueKeys`, `values`, `unite`, to be replaced with QMultiMap versions.
* Usage of `QHash::uniqueKeys`, to be replaced with `QMultiHash` versions.
* Usage of `LinkedList`, to be replaced with `std::list`.
* Usage of global `qrand()` and `qsrand()`, to be replaced using `QRandomGenerator`.
* Usage of `QTimeLine::curveShape` and `QTimeLine::setCurveShape`, to be replaced using `QTimeLine::easingCurve` and `QTimeLine::setEasingCurve`.
* Usage of `QSet` and `QHash` biderectional iterator. Code has to be ported using forward iterator.
* Usage of `QMacCocoaViewContainer`, to be replaced using `QWindow::fromWinId` and `QWidget::createWindowContainer` instead.
* Usage of `QMacNativeWidget`, to be replaced using `QWidget::winId` instead.
* Usage of `QComboBox::SizeAdjustPolicy::AdjustToMinimumContentsLength`, to be replaced using `AdjustToContents` or `AdjustToContentsOnFirstShow`.
* Usage of `QComboBox::currentIndexChanged(const QString &)`, to be replaced using `currentIndexChanged(int)` instead, and getting the text using `itemText(index)`.
* Usage of `QSplashScreen(QWidget *parent,...)`, to be replaced with the constructor taking a `QScreen *`.
* Usage of `QTextBrowser::highlighted(const QString &)`, to be replaced with `highlighted(const QUrl &)`.
* Usage of `QDockWidget::AllDockWidgetFeatures`, to be replaced with `DockWidgetClosable|DockWidgetMovable|DockWidgetFloatable`.
* Usage of `QDirModel`, to be replaced with `QFileSystemModel`.
* Usage of `QGraphicsView::matrix`, `setMatrix(const QMatrix &)` and `resetMatrix`, to be replaced with `QGraphicsView::transform`, `setTransform(const QTransform &)` and `resetTransfrom`.
* Usage of the following QStyle enum: `QStyle::PixelMetrix::PM_DefaultTopLevelMargin`, `PM_DefaultChildMargin`, `PM_DefaultLayoutSpacing` and `QStyle::SubElement::SE_DialogButtonBoxLayoutItem`.
This fix-it is intended to aid the user porting from Qt5 to Qt6.
Run this check with Qt5. The produced fixed code will compile on Qt6.
Warns against forward declaration that are present in <QtCore/qcontainerfwd.h>
# qt6-fwd-fixes
Warns against forward declaration that are present in `<QtCore/qcontainerfwd.h>`
Include the file instead if not already included.
......@@ -2,6 +2,8 @@ Warns against include headers that have changed in Qt6.
Replaces the code with the correct one.
Full list:
```
ActiveQt/QAxAggregated replaced by QtAxServer/QAxAggregated
ActiveQt/QAxBase replaced by QtAxContainer/QAxBase
ActiveQt/QAxBindable replaced by QtAxServer/QAxBindable
......@@ -172,6 +174,7 @@ QtWidgets/qopenglwidget.h replaced by QtOpenGLWidge
QtWidgets/qshortcut.h replaced by QtGui/qshortcut.h
QtWidgets/qundogroup.h replaced by QtGui/qundogroup.h
QtWidgets/qundostack.h replaced by QtGui/qundostack.h
```
This fix-it is intended to aid the user porting from Qt5 to Qt6.
Run this check with Qt5. The produced fixed code will compile on Qt6.
# qt6-qhash-signature
Warns and corrects the signature for qHash.
uint qHash(MyType x, uint seed) is replaced with size_t qHash(MyType x, size_t seed)
Also corrects the signature for qHashBits, qHashRange and qHashRangeCommutative.
Warns and corrects the signature for `qHash`.
`uint qHash(MyType x, uint seed)` is replaced with `size_t qHash(MyType x, size_t seed)`
Also corrects the signature for `qHashBits`, `qHashRange` and `qHashRangeCommutative`.
This fix-it is intended to aid the user porting from Qt5 to Qt6.
Run this check with Qt5. The produced fixed code will compile on Qt6.
\ No newline at end of file
Run this check with Qt5. The produced fixed code will compile on Qt6.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment