diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-07-06 15:46:38 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-07-09 11:56:02 +0200 |
commit | e62dde53f093dd2c404a65cf99e854081396632b (patch) | |
tree | 920c3ca9711d166ab9cd1628885a1d4162caf0df | |
parent | 3b363345a3e75eb10827f67b995ae9472a6d0e8e (diff) |
Remove outdated QT_VERSION_CHECKs
Pick-to: 6.2
Change-Id: I4c4b78af0bd7da5912b5e0136f9cfdb3c4268a7e
Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
13 files changed, 0 insertions, 197 deletions
diff --git a/src/core/profile_io_data_qt.h b/src/core/profile_io_data_qt.h index b9503eca8..6bd555dbf 100644 --- a/src/core/profile_io_data_qt.h +++ b/src/core/profile_io_data_qt.h @@ -142,12 +142,7 @@ private: QString m_httpCachePath; QString m_storageName; bool m_inMemoryOnly; -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - QMutex m_mutex{QMutex::Recursive}; - using QRecursiveMutex = QMutex; -#else QRecursiveMutex m_mutex; -#endif int m_httpCacheMaxSize = 0; BrowsingDataRemoverObserverQt m_removerObserver; QString m_dataPath; diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index e52976138..7f7d7bcaa 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -700,11 +700,7 @@ void RenderWidgetHostViewQt::OnUpdateTextInputStateCalled(content::TextInputMana } ui::TextInputType type = getTextInputType(); -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) m_delegate->setInputMethodHints(toQtInputMethodHints(getTextInputType()) | Qt::ImhNoPredictiveText | Qt::ImhNoTextHandles | Qt::ImhNoEditMenu); -#else - m_delegate->setInputMethodHints(toQtInputMethodHints(getTextInputType()) | Qt::ImhNoPredictiveText); -#endif QString surroundingText = toQt(state->value); // Remove IME composition text from the surrounding text if (state->composition.has_value()) diff --git a/src/core/render_widget_host_view_qt_delegate_client.cpp b/src/core/render_widget_host_view_qt_delegate_client.cpp index eb0a0ff12..0f218ab6c 100644 --- a/src/core/render_widget_host_view_qt_delegate_client.cpp +++ b/src/core/render_widget_host_view_qt_delegate_client.cpp @@ -406,12 +406,8 @@ QVariant RenderWidgetHostViewQtDelegateClient::inputMethodQuery(Qt::InputMethodQ // TODO: Implement this return QVariant(); // No limit. case Qt::ImHints: -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) return int(toQtInputMethodHints(m_rwhv->getTextInputType()) | Qt::ImhNoPredictiveText | Qt::ImhNoTextHandles | Qt::ImhNoEditMenu); -#else - return int(toQtInputMethodHints(m_rwhv->getTextInputType()) | Qt::ImhNoPredictiveText); -#endif default: return QVariant(); } diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp index aa5ea4036..b82877bac 100644 --- a/src/core/web_event_factory.cpp +++ b/src/core/web_event_factory.cpp @@ -950,7 +950,6 @@ static ui::DomKey domKeyForQtKey(int qtKey) return ui::DomKey::ZENKAKU; case Qt::Key_Zenkaku_Hankaku: return ui::DomKey::ZENKAKU_HANKAKU; -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) // Dead keys (ui/events/keycodes/keyboard_code_conversion_xkb.cc) case Qt::Key_Dead_Grave: return ui::DomKey::DeadKeyFromCombiningCharacter(0x0300); @@ -1018,7 +1017,6 @@ static ui::DomKey domKeyForQtKey(int qtKey) return ui::DomKey::DeadKeyFromCombiningCharacter(0x00A4); case Qt::Key_Dead_Greek: return ui::DomKey::DeadKeyFromCombiningCharacter(0x037E); -#endif // General-Purpose Function Keys case Qt::Key_F1: return ui::DomKey::F1; @@ -1580,9 +1578,7 @@ blink::WebMouseWheelEvent::Phase toBlinkPhase(QWheelEvent *ev) { switch (ev->phase()) { case Qt::NoScrollPhase: -#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) case Qt::ScrollMomentum: -#endif return blink::WebMouseWheelEvent::kPhaseNone; case Qt::ScrollBegin: return blink::WebMouseWheelEvent::kPhaseBegan; @@ -1601,15 +1597,10 @@ blink::WebMouseWheelEvent WebEventFactory::toWebWheelEvent(QWheelEvent *ev) webEvent.SetType(webEventTypeForEvent(ev)); webEvent.SetModifiers(modifiersForEvent(ev)); webEvent.SetTimeStamp(base::TimeTicks::Now()); -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - webEvent.SetPositionInWidget(ev->x(), ev->y()); - webEvent.SetPositionInScreen(ev->globalX(), ev->globalY()); -#else webEvent.SetPositionInWidget(static_cast<float>(ev->position().x()), static_cast<float>(ev->position().y())); webEvent.SetPositionInScreen(static_cast<float>(ev->globalPosition().x()), static_cast<float>(ev->globalPosition().y())); -#endif webEvent.wheel_ticks_x = static_cast<float>(ev->angleDelta().x()) / QWheelEvent::DefaultDeltasPerStep; webEvent.wheel_ticks_y = static_cast<float>(ev->angleDelta().y()) / QWheelEvent::DefaultDeltasPerStep; @@ -1640,15 +1631,10 @@ bool WebEventFactory::coalesceWebWheelEvent(blink::WebMouseWheelEvent &webEvent, #endif webEvent.SetTimeStamp(base::TimeTicks::Now()); -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - webEvent.SetPositionInWidget(ev->x(), ev->y()); - webEvent.SetPositionInScreen(ev->globalX(), ev->globalY()); -#else webEvent.SetPositionInWidget(static_cast<float>(ev->position().x()), static_cast<float>(ev->position().y())); webEvent.SetPositionInScreen(static_cast<float>(ev->globalPosition().x()), static_cast<float>(ev->globalPosition().y())); -#endif webEvent.wheel_ticks_x += static_cast<float>(ev->angleDelta().x()) / QWheelEvent::DefaultDeltasPerStep; webEvent.wheel_ticks_y += static_cast<float>(ev->angleDelta().y()) / QWheelEvent::DefaultDeltasPerStep; diff --git a/src/pdf/quick/qquicktableviewextra.cpp b/src/pdf/quick/qquicktableviewextra.cpp index 2b59d6c6e..017764a95 100644 --- a/src/pdf/quick/qquicktableviewextra.cpp +++ b/src/pdf/quick/qquicktableviewextra.cpp @@ -62,132 +62,17 @@ QQuickTableViewExtra::QQuickTableViewExtra(QObject *parent) : QObject(parent) QPoint QQuickTableViewExtra::cellAtPos(qreal x, qreal y) const { QPointF position(x, y); -#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) return m_tableView->cellAtPos(position); -#else - if (!m_tableView->boundingRect().contains(position)) - return QPoint(-1, -1); - - const QQuickItem *contentItem = m_tableView->contentItem(); - - for (const QQuickItem *child : contentItem->childItems()) { - const QPointF posInChild = m_tableView->mapToItem(child, position); - if (child->boundingRect().contains(posInChild)) { - const auto context = qmlContext(child); - const int column = context->contextProperty("column").toInt(); - const int row = context->contextProperty("row").toInt(); - return QPoint(column, row); - } - } - - return QPoint(-1, -1); -#endif } QQuickItem *QQuickTableViewExtra::itemAtCell(const QPoint &cell) const { -#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) return m_tableView->itemAtCell(cell); -#else - const QQuickItem *contentItem = m_tableView->contentItem(); - - for (QQuickItem *child : contentItem->childItems()) { - const auto context = qmlContext(child); - const int column = context->contextProperty("column").toInt(); - const int row = context->contextProperty("row").toInt(); - if (QPoint(column, row) == cell) - return child; - } - - return nullptr; -#endif } void QQuickTableViewExtra::positionViewAtCell(const QPoint &cell, Qt::Alignment alignment, const QPointF &offset) { -#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) m_tableView->positionViewAtCell(cell, alignment, offset); -#else - // Note: this fallback implementation assumes all cells to be of the same size! - - if (cell.x() < 0 || cell.x() > m_tableView->columns() - 1) - return; - if (cell.y() < 0 || cell.y() > m_tableView->rows() - 1) - return; - - Qt::Alignment verticalAlignment = alignment & (Qt::AlignTop | Qt::AlignVCenter | Qt::AlignBottom); - Qt::Alignment horizontalAlignment = alignment & (Qt::AlignLeft | Qt::AlignHCenter | Qt::AlignRight); - - const QQuickItem *contentItem = m_tableView->contentItem(); - const QQuickItem *randomChild = contentItem->childItems().first(); - const qreal cellWidth = randomChild->width(); - const qreal cellHeight = randomChild->height(); - - if (!verticalAlignment && !horizontalAlignment) { - qmlWarning(this) << "No valid alignment specified"; - return; - } - - if (horizontalAlignment) { - qreal newPosX = 0; - const qreal columnPosLeft = int(cell.x() * (cellWidth + m_tableView->columnSpacing())); - m_tableView->setContentX(0); - m_tableView->forceLayout(); - m_tableView->setContentX(columnPosLeft); - m_tableView->forceLayout(); - - switch (horizontalAlignment) { - case Qt::AlignLeft: - newPosX = m_tableView->contentX() + offset.x(); - break; - case Qt::AlignHCenter: - newPosX = m_tableView->contentX() - - m_tableView->width() / 2 - + (cellWidth / 2) - + offset.x(); - break; - case Qt::AlignRight: - newPosX = m_tableView->contentX() - - m_tableView->width() - + cellWidth - + offset.x(); - break; - } - - m_tableView->setContentX(newPosX); - m_tableView->forceLayout(); - } - - if (verticalAlignment) { - qreal newPosY = 0; - const qreal rowPosTop = int(cell.y() * (cellHeight + m_tableView->rowSpacing())); - m_tableView->setContentY(0); - m_tableView->forceLayout(); - m_tableView->setContentY(rowPosTop); - m_tableView->forceLayout(); - - switch (verticalAlignment) { - case Qt::AlignTop: - newPosY = m_tableView->contentY() + offset.y(); - break; - case Qt::AlignVCenter: - newPosY = m_tableView->contentY() - - m_tableView->height() / 2 - + (cellHeight / 2) - + offset.y(); - break; - case Qt::AlignBottom: - newPosY = m_tableView->contentY() - - m_tableView->height() - + cellHeight - + offset.y(); - break; - } - - m_tableView->setContentY(newPosY); - m_tableView->forceLayout(); - } -#endif } QT_END_NAMESPACE diff --git a/src/webenginequick/api/qquickwebengineclientcertificateselection.cpp b/src/webenginequick/api/qquickwebengineclientcertificateselection.cpp index 3a42366b6..e06cfa4d2 100644 --- a/src/webenginequick/api/qquickwebengineclientcertificateselection.cpp +++ b/src/webenginequick/api/qquickwebengineclientcertificateselection.cpp @@ -39,8 +39,6 @@ #include "qquickwebengineclientcertificateselection_p.h" -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) - #include "client_cert_select_controller.h" QT_BEGIN_NAMESPACE @@ -223,5 +221,3 @@ QUrl QQuickWebEngineClientCertificateSelection::host() const } QT_END_NAMESPACE - -#endif // QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) diff --git a/src/webenginequick/api/qquickwebengineclientcertificateselection_p.h b/src/webenginequick/api/qquickwebengineclientcertificateselection_p.h index 1171692bd..54cf54cfb 100644 --- a/src/webenginequick/api/qquickwebengineclientcertificateselection_p.h +++ b/src/webenginequick/api/qquickwebengineclientcertificateselection_p.h @@ -61,8 +61,6 @@ #include <QtQml/QQmlListProperty> #include <QtQml/qqmlregistration.h> -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) - namespace QtWebEngineCore { class ClientCertSelectController; } @@ -139,6 +137,4 @@ Q_DECLARE_METATYPE(QQuickWebEngineClientCertificateOption *) Q_DECLARE_METATYPE(QQmlListProperty<QQuickWebEngineClientCertificateOption>) Q_DECLARE_METATYPE(QQuickWebEngineClientCertificateSelection *) -#endif - #endif // QQUICKWEBENGINECERTSELECTION_P_H diff --git a/src/webenginequick/api/qquickwebengineview.cpp b/src/webenginequick/api/qquickwebengineview.cpp index 7688c38cd..23d89440d 100644 --- a/src/webenginequick/api/qquickwebengineview.cpp +++ b/src/webenginequick/api/qquickwebengineview.cpp @@ -299,15 +299,11 @@ void QQuickWebEngineViewPrivate::allowCertificateError(const QWebEngineCertifica void QQuickWebEngineViewPrivate::selectClientCert( const QSharedPointer<QtWebEngineCore::ClientCertSelectController> &controller) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) Q_Q(QQuickWebEngineView); QQuickWebEngineClientCertificateSelection *certSelection = new QQuickWebEngineClientCertificateSelection(controller); // mark the object for gc by creating temporary jsvalue qmlEngine(q)->newQObject(certSelection); Q_EMIT q->selectClientCertificate(certSelection); -#else - Q_UNUSED(controller); -#endif } static QQuickWebEngineView::Feature toFeature(QtWebEngineCore::ProfileAdapter::PermissionType type) diff --git a/src/webenginequick/render_widget_host_view_qt_delegate_quick.cpp b/src/webenginequick/render_widget_host_view_qt_delegate_quick.cpp index 38d787bd4..a2b089ec7 100644 --- a/src/webenginequick/render_widget_host_view_qt_delegate_quick.cpp +++ b/src/webenginequick/render_widget_host_view_qt_delegate_quick.cpp @@ -94,11 +94,7 @@ QRectF RenderWidgetHostViewQtDelegateQuick::viewGeometry() const const QPointF p2 = mapToGlobal(mapFromScene(QPointF(width(), height()))); QRectF geometry = QRectF(p1, p2).normalized(); // But keep the size untransformed to behave like other QQuickItems. -#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) geometry.setSize(size()); -#else - geometry.setSize(QSizeF(width(), height())); -#endif return geometry; } diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp index 63dbf0452..7bc64531a 100644 --- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp +++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp @@ -1006,11 +1006,7 @@ void tst_QQuickWebEngineView::changeLocale() QTRY_VERIFY(!evaluateJavaScriptSync(viewDE.data(), "document.body").isNull()); QTRY_VERIFY(!evaluateJavaScriptSync(viewDE.data(), "document.body.innerText").isNull()); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) errorLines = evaluateJavaScriptSync(viewDE.data(), "document.body.innerText").toString().split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts); -#else - errorLines = evaluateJavaScriptSync(viewDE.data(), "document.body.innerText").toString().split(QRegularExpression("[\r\n]"), QString::SkipEmptyParts); -#endif QCOMPARE(errorLines.first().toUtf8(), QByteArrayLiteral("Die Website ist nicht erreichbar")); QLocale::setDefault(QLocale("en")); @@ -1020,11 +1016,7 @@ void tst_QQuickWebEngineView::changeLocale() QTRY_VERIFY(!evaluateJavaScriptSync(viewEN.data(), "document.body").isNull()); QTRY_VERIFY(!evaluateJavaScriptSync(viewEN.data(), "document.body.innerText").isNull()); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) errorLines = evaluateJavaScriptSync(viewEN.data(), "document.body.innerText").toString().split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts); -#else - errorLines = evaluateJavaScriptSync(viewEN.data(), "document.body.innerText").toString().split(QRegularExpression("[\r\n]"), QString::SkipEmptyParts); -#endif QCOMPARE(errorLines.first().toUtf8(), QByteArrayLiteral("This site can\xE2\x80\x99t be reached")); // Reset error page @@ -1037,11 +1029,7 @@ void tst_QQuickWebEngineView::changeLocale() QTRY_VERIFY(!evaluateJavaScriptSync(viewDE.data(), "document.body").isNull()); QTRY_VERIFY(!evaluateJavaScriptSync(viewDE.data(), "document.body.innerText").isNull()); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) errorLines = evaluateJavaScriptSync(viewDE.data(), "document.body.innerText").toString().split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts); -#else - errorLines = evaluateJavaScriptSync(viewDE.data(), "document.body.innerText").toString().split(QRegularExpression("[\r\n]"), QString::SkipEmptyParts); -#endif QCOMPARE(errorLines.first().toUtf8(), QByteArrayLiteral("Die Website ist nicht erreichbar")); } @@ -1188,9 +1176,6 @@ void tst_QQuickWebEngineView::focusChild_data() void tst_QQuickWebEngineView::focusChild() { -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 1) - QSKIP("Requires newer base Qt"); -#endif auto traverseToWebDocumentAccessibleInterface = [](QAccessibleInterface *iface) -> QAccessibleInterface * { QFETCH(QList<QAccessible::Role>, ancestorRoles); for (int i = 0; i < ancestorRoles.size(); ++i) { diff --git a/tests/auto/widgets/accessibility/tst_accessibility.cpp b/tests/auto/widgets/accessibility/tst_accessibility.cpp index 479e265da..0aabf0f6d 100644 --- a/tests/auto/widgets/accessibility/tst_accessibility.cpp +++ b/tests/auto/widgets/accessibility/tst_accessibility.cpp @@ -159,9 +159,6 @@ void tst_Accessibility::focusChild_data() void tst_Accessibility::focusChild() { -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 1) - QSKIP("Requires newer base Qt"); -#endif auto traverseToWebDocumentAccessibleInterface = [](QAccessibleInterface *iface) -> QAccessibleInterface * { QFETCH(QList<QAccessible::Role>, ancestorRoles); for (int i = 0; i < ancestorRoles.size(); ++i) { diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp index bf8e9b471..38f3b04e7 100644 --- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp +++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp @@ -347,12 +347,7 @@ protected: } private: -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - mutable QMutex m_mutex{QMutex::Recursive}; - using QRecursiveMutex = QMutex; -#else mutable QRecursiveMutex m_mutex; -#endif QByteArray m_data; QBasicTimer m_timer; int m_bytesRead; diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp index c996507cc..6466cac23 100644 --- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp +++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp @@ -1180,11 +1180,7 @@ void tst_QWebEngineView::changeLocale() QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpyDE.count(), 1, 20000); QTRY_VERIFY(!toPlainTextSync(viewDE.page()).isEmpty()); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) errorLines = toPlainTextSync(viewDE.page()).split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts); -#else - errorLines = toPlainTextSync(viewDE.page()).split(QRegularExpression("[\r\n]"), QString::SkipEmptyParts); -#endif QCOMPARE(errorLines.first().toUtf8(), QByteArrayLiteral("Die Website ist nicht erreichbar")); QLocale::setDefault(QLocale("en")); @@ -1194,11 +1190,7 @@ void tst_QWebEngineView::changeLocale() QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpyEN.count(), 1, 20000); QTRY_VERIFY(!toPlainTextSync(viewEN.page()).isEmpty()); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) errorLines = toPlainTextSync(viewEN.page()).split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts); -#else - errorLines = toPlainTextSync(viewEN.page()).split(QRegularExpression("[\r\n]"), QString::SkipEmptyParts); -#endif QCOMPARE(errorLines.first().toUtf8(), QByteArrayLiteral("This site can\xE2\x80\x99t be reached")); // Reset error page @@ -1211,11 +1203,7 @@ void tst_QWebEngineView::changeLocale() QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpyDE.count(), 1, 20000); QTRY_VERIFY(!toPlainTextSync(viewDE.page()).isEmpty()); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) errorLines = toPlainTextSync(viewDE.page()).split(QRegularExpression("[\r\n]"), Qt::SkipEmptyParts); -#else - errorLines = toPlainTextSync(viewDE.page()).split(QRegularExpression("[\r\n]"), QString::SkipEmptyParts); -#endif QCOMPARE(errorLines.first().toUtf8(), QByteArrayLiteral("Die Website ist nicht erreichbar")); } @@ -1566,11 +1554,7 @@ void tst_QWebEngineView::postData() QStringList lines = QString::fromLocal8Bit(rawData).split("\r\n"); // examine request -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) QStringList request = lines[0].split(" ", Qt::SkipEmptyParts); -#else - QStringList request = lines[0].split(" ", QString::SkipEmptyParts); -#endif bool requestOk = request.length() > 2 && request[2].toUpper().startsWith("HTTP/") && request[0].toUpper() == "POST" |