Rename {from,to}DOMRect() → {from,to}DomRect()

Because it's QDomNode, not QDOMNode, either (abbreviations aren't
supposed to be all-caps in Qt).

Found in API review.

Pick-to: 6.5
Change-Id: I37bcd8c38d396709d11c4eab035cdfd2145eb245
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2023-02-07 14:26:29 +01:00
parent fed5f24454
commit 81ce878f55
5 changed files with 13 additions and 13 deletions

View File

@ -18,9 +18,9 @@ QT_BEGIN_NAMESPACE
\since 6.5 \since 6.5
\ingroup platform-type-conversions \ingroup platform-type-conversions
\sa toDOMRect() \sa toDomRect()
*/ */
QRectF QRectF::fromDOMRect(emscripten::val domRect) QRectF QRectF::fromDomRect(emscripten::val domRect)
{ {
Q_ASSERT_X(domRect["constructor"]["name"].as<std::string>() == "DOMRect", Q_FUNC_INFO, Q_ASSERT_X(domRect["constructor"]["name"].as<std::string>() == "DOMRect", Q_FUNC_INFO,
"Passed object is not a DOMRect"); "Passed object is not a DOMRect");
@ -35,9 +35,9 @@ QRectF QRectF::fromDOMRect(emscripten::val domRect)
\since 6.5 \since 6.5
\ingroup platform-type-conversions \ingroup platform-type-conversions
\sa fromDOMRect() \sa fromDomRect()
*/ */
emscripten::val QRectF::toDOMRect() const emscripten::val QRectF::toDomRect() const
{ {
return emscripten::val::global("DOMRect").new_(left(), top(), width(), height()); return emscripten::val::global("DOMRect").new_(left(), top(), width(), height());
} }

View File

@ -592,8 +592,8 @@ public:
#endif #endif
#if defined(Q_OS_WASM) || defined(Q_QDOC) #if defined(Q_OS_WASM) || defined(Q_QDOC)
[[nodiscard]] static QRectF fromDOMRect(emscripten::val domRect); [[nodiscard]] static QRectF fromDomRect(emscripten::val domRect);
[[nodiscard]] emscripten::val toDOMRect() const; [[nodiscard]] emscripten::val toDomRect() const;
#endif #endif
private: private:

View File

@ -28,9 +28,9 @@ void syncCSSClassWith(emscripten::val element, std::string cssClassName, bool fl
QPointF mapPoint(emscripten::val source, emscripten::val target, const QPointF &point) QPointF mapPoint(emscripten::val source, emscripten::val target, const QPointF &point)
{ {
const auto sourceBoundingRect = const auto sourceBoundingRect =
QRectF::fromDOMRect(source.call<emscripten::val>("getBoundingClientRect")); QRectF::fromDomRect(source.call<emscripten::val>("getBoundingClientRect"));
const auto targetBoundingRect = const auto targetBoundingRect =
QRectF::fromDOMRect(target.call<emscripten::val>("getBoundingClientRect")); QRectF::fromDomRect(target.call<emscripten::val>("getBoundingClientRect"));
const auto offset = sourceBoundingRect.topLeft() - targetBoundingRect.topLeft(); const auto offset = sourceBoundingRect.topLeft() - targetBoundingRect.topLeft();
return point + offset; return point + offset;

View File

@ -312,9 +312,9 @@ bool QWasmWindow::isVisible() const
QMargins QWasmWindow::frameMargins() const QMargins QWasmWindow::frameMargins() const
{ {
const auto frameRect = const auto frameRect =
QRectF::fromDOMRect(m_qtWindow.call<emscripten::val>("getBoundingClientRect")); QRectF::fromDomRect(m_qtWindow.call<emscripten::val>("getBoundingClientRect"));
const auto canvasRect = const auto canvasRect =
QRectF::fromDOMRect(m_windowContents.call<emscripten::val>("getBoundingClientRect")); QRectF::fromDomRect(m_windowContents.call<emscripten::val>("getBoundingClientRect"));
return QMarginsF(canvasRect.left() - frameRect.left(), canvasRect.top() - frameRect.top(), return QMarginsF(canvasRect.left() - frameRect.left(), canvasRect.top() - frameRect.top(),
frameRect.right() - canvasRect.right(), frameRect.right() - canvasRect.right(),
frameRect.bottom() - canvasRect.bottom()) frameRect.bottom() - canvasRect.bottom())

View File

@ -198,8 +198,8 @@ void Resizer::startResize(Qt::Edges resizeEdges, const PointerEvent &event)
window->minimumHeight() - window->geometry().height()); window->minimumHeight() - window->geometry().height());
const auto frameRect = const auto frameRect =
QRectF::fromDOMRect(m_windowElement.call<emscripten::val>("getBoundingClientRect")); QRectF::fromDomRect(m_windowElement.call<emscripten::val>("getBoundingClientRect"));
const auto screenRect = QRectF::fromDOMRect( const auto screenRect = QRectF::fromDomRect(
m_window->platformScreen()->element().call<emscripten::val>("getBoundingClientRect")); m_window->platformScreen()->element().call<emscripten::val>("getBoundingClientRect"));
const int maxGrowTop = frameRect.top() - screenRect.top(); const int maxGrowTop = frameRect.top() - screenRect.top();
@ -363,7 +363,7 @@ void TitleBar::setWidth(int width)
QRectF TitleBar::geometry() const QRectF TitleBar::geometry() const
{ {
return QRectF::fromDOMRect(m_element.call<emscripten::val>("getBoundingClientRect")); return QRectF::fromDomRect(m_element.call<emscripten::val>("getBoundingClientRect"));
} }
bool TitleBar::onPointerDown(const PointerEvent &event) bool TitleBar::onPointerDown(const PointerEvent &event)