Added Window::framePosition()

This commit is contained in:
Sergio Martins
2022-05-31 11:32:42 +01:00
parent b201737149
commit bc6417c923
3 changed files with 8 additions and 0 deletions

View File

@@ -42,3 +42,7 @@ void Window::startSystemMove()
qFatal("Not needed in this platform"); qFatal("Not needed in this platform");
} }
QPoint Window::framePosition() const
{
return frameGeometry().topLeft();
}

View File

@@ -52,6 +52,9 @@ public:
/// This ignores any frame (native decos the window has) /// This ignores any frame (native decos the window has)
virtual void setPosition(QPoint targetPos) = 0; virtual void setPosition(QPoint targetPos) = 0;
/// @brif Returns the position of the top-left corner, including native frame.
QPoint framePosition() const;
/// @brief Sets the position of the window at targetPos /// @brief Sets the position of the window at targetPos
virtual void setFramePosition(QPoint targetPos) = 0; virtual void setFramePosition(QPoint targetPos) = 0;

View File

@@ -81,6 +81,7 @@ void Window_qt::setFramePosition(QPoint targetPos)
m_window->setFramePosition(targetPos); m_window->setFramePosition(targetPos);
} }
// TODOv2: this is setting the frame position ?
void Window_qt::setPosition(QPoint targetPos) void Window_qt::setPosition(QPoint targetPos)
{ {
m_window->setFramePosition(targetPos); m_window->setFramePosition(targetPos);