14#include "qtwidgets/views/ViewWrapper_p.h"
24Window::~Window() =
default;
34Window::Window(
QWidget *topLevel)
39 setProperty(
"kddockwidgets_qwidget", QVariant::fromValue<QWidget *>(topLevel));
42std::shared_ptr<Core::View> Window::rootView()
const
47 if (
auto widget = m_window->property(
"kddockwidgets_qwidget").value<
QWidget *>())
48 return QtWidgets::ViewWrapper::create(widget);
50 qWarning() << Q_FUNC_INFO <<
"Window does not have a root";
54Core::Window::Ptr Window::transientParent()
const
56 if (
QWindow *w = m_window->transientParent())
57 return Core::Window::Ptr(
new QtWidgets::Window(w));
62void Window::setGeometry(
QRect geo)
64 if (
auto v = rootView()) {
69 Window::setGeometry(geo);
73void Window::setVisible(
bool is)
75 if (
auto v = rootView()) {
80 Window::setVisible(is);
84bool Window::supportsHonouringLayoutMinSize()
const
92 if (
auto v = rootView()) {
94 delete static_cast<QtWidgets::ViewWrapper *
>(v.get())->widget();