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:
parent
fed5f24454
commit
81ce878f55
@ -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());
|
||||||
}
|
}
|
||||||
|
@ -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:
|
||||||
|
@ -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;
|
||||||
|
@ -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())
|
||||||
|
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user