13#include "../qtcommon/Screen_p.h"
14#include "../qtcommon/Window_p.h"
15#include "../qtcommon/Platform.h"
21#include <QtGui/private/qhighdpiscaling_p.h>
36void Window::onScreenChanged(
QObject *context, WindowScreenChangedCallback callback)
41 context = context ? context : m_window;
57QRect Window::geometry()
const
59 return m_window->geometry();
62void Window::setProperty(
const char *name,
const QVariant &value)
65 m_window->setProperty(name, value);
68bool Window::isVisible()
const
70 return m_window->isVisible();
73WId Window::handle()
const
75 if (m_window->handle())
76 return m_window->winId();
80QWindow *Window::qtWindow()
const
85bool Window::equals(std::shared_ptr<Core::Window> other)
const
87 auto otherQt =
static_cast<Window *
>(other.get());
88 return other && otherQt->m_window == m_window;
91void Window::setFramePosition(
QPoint targetPos)
93 m_window->setFramePosition(targetPos);
96QRect Window::frameGeometry()
const
98 return m_window->frameGeometry();
101void Window::resize(
int width,
int height)
103 m_window->resize(width, height);
106bool Window::isActive()
const
108 return m_window->isActive();
113 return m_window->mapFromGlobal(globalPos);
118 return m_window->mapToGlobal(localPos);
121Core::Screen::Ptr Window::screen()
const
123 return std::make_shared<Screen_qt>(m_window->screen());
126void Window::destroy()
131QVariant Window::property(
const char *name)
const
133 return m_window->property(name);
136QSize Window::minSize()
const
138 return m_window->minimumSize();
141QSize Window::maxSize()
const
143 return m_window->maximumSize();
148 return QHighDpi::fromNativePixels(nativePos, m_window.data());
151void Window::startSystemMove()
153 m_window->startSystemMove();
156void Window::setGeometry(
QRect geo)
158 m_window->setGeometry(geo);
161void Window::setVisible(
bool is)
163 m_window->setVisible(is);
166bool Window::isFullScreen()
const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void screenChanged(QScreen *screen)