13#include "core/View_p.h"
14#include "core/Utils_p.h"
15#include "core/layouting/Item_p.h"
25#include "core/Logging_p.h"
27#include "core/Window_p.h"
44 if (type == ViewType::ViewWrapper)
45 return new Controller(ViewType::ViewWrapper, view);
61 d->beingDestroyed.emit();
71#ifdef KDDW_FRONTEND_FLUTTER
72 const auto children = m_childViews;
73 for (
auto child : children)
82QString View::Private::id()
const
92void View::Private::free()
95 KDDW_ERROR(
"Free already called");
107bool View::Private::freed()
const
133 return Rect(Point(0, 0),
size());
158 move(pt.x(), pt.y());
163 setSize(sz.width(), sz.height());
168 setSize(sz.width(), sz.height());
188 if (
auto screen =
d->screen())
189 return screen->size();
202 return Core::Item::hardcodedMinimumSize;
207 return int(
d->m_type) & int(t);
213 return object_cast<Core::FloatingWindow *>(
m_controller);
300 if (
isNull() || !other || other->isNull()) {
305 return handle() == other->handle();
313bool View::Private::isInWindow(std::shared_ptr<Core::Window> window)
const
318 if (
auto ourWindow = q->window())
319 return ourWindow->equals(window);
324Size View::Private::parentSize()
const
326 if (
auto p = q->parentView())
331Rect View::Private::windowGeometry()
const
333 if (Core::Window::Ptr window = q->window())
334 return window->geometry();
339void View::Private::closeRootView()
341 if (
auto view = q->rootView())
345Screen::Ptr View::Private::screen()
const
347 if (Core::Window::Ptr window = q->window())
348 return window->screen();
353void View::Private::setAboutToBeDestroyed()
355 m_aboutToBeDestroyed =
true;
358bool View::Private::aboutToBeDestroyed()
const
360 return m_aboutToBeDestroyed;
365 KDDW_DEBUG(
"View::dumpDebug: controller={}, type={}, rootController={}\n", (
void * )
m_controller,
int(
d->type()), (
void * )
rootView()->
controller());
374 return p->controller();
391void View::Private::requestClose(CloseEvent *e)
393 closeRequested.emit(e);
396Rect View::Private::globalGeometry()
const
398 Rect geo = q->geometry();
399 if (!q->isRootView())
400 geo.moveTopLeft(q->mapToGlobal(Point(0, 0)));
407 KDDW_ERROR(
"Shouldn't be called on this platform");
411std::shared_ptr<Core::Window> View::Private::transientWindow()
const
413 if (
auto w = q->window())
414 return w->transientParent();
421 d->resized.emit(Size(w, h));
427 return onResize(sz.width(), sz.height());
433 if ((one && !two) || (!one && two))
444 d->m_viewEventFilters.push_back(filter);
449 d->m_viewEventFilters.erase(
450 std::remove(
d->m_viewEventFilters.begin(),
d->m_viewEventFilters.end(), filter),
451 d->m_viewEventFilters.end());
457 if (ev->type() == Event::Move) {
458 if (filter->onMoveEvent(
this))
460 }
else if (
auto me = mouseEvent(ev)) {
461 if (filter->onMouseEvent(
this, me))
464 switch (ev->type()) {
465 case Event::MouseButtonPress:
466 if (filter->onMouseButtonPress(
this, me))
469 case Event::MouseButtonRelease:
470 if (filter->onMouseButtonRelease(
this, me))
473 case Event::MouseMove:
474 if (filter->onMouseButtonMove(
this, me))
477 case Event::MouseButtonDblClick:
478 if (filter->onMouseDoubleClick(
this, me))
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
A MultiSplitter with support for drop indicators when hovering over.
The MainWindow base-class that's shared between QtWidgets and QtQuick stack.