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
138 return Rect(Point(0, 0),
size());
163 move(pt.x(), pt.y());
168 setSize(sz.width(), sz.height());
173 setSize(sz.width(), sz.height());
193 if (
auto screen =
d->screen())
194 return screen->size();
207 return Core::Item::hardcodedMinimumSize;
212 return int(
d->m_type) & int(t);
218 return object_cast<Core::FloatingWindow *>(
m_controller);
305 if (
isNull() || !other || other->isNull()) {
310 return handle() == other->handle();
318bool View::Private::isInWindow(std::shared_ptr<Core::Window> window)
const
323 if (
auto ourWindow = q->window())
324 return ourWindow->equals(window);
329Size View::Private::parentSize()
const
331 if (
auto p = q->parentView())
336Rect View::Private::windowGeometry()
const
338 if (Core::Window::Ptr window = q->window())
339 return window->geometry();
344void View::Private::closeRootView()
346 if (
auto view = q->rootView())
350Screen::Ptr View::Private::screen()
const
352 if (Core::Window::Ptr window = q->window())
353 return window->screen();
358void View::Private::setAboutToBeDestroyed()
360 m_aboutToBeDestroyed =
true;
363bool View::Private::aboutToBeDestroyed()
const
365 return m_aboutToBeDestroyed;
370 KDDW_DEBUG(
"View::dumpDebug: controller={}, type={}, rootController={}\n", (
void * )
m_controller,
int(
d->type()), (
void * )
rootView()->
controller());
389 return p->controller();
406void View::Private::requestClose(CloseEvent *e)
408 closeRequested.emit(e);
411Rect View::Private::globalGeometry()
const
413 Rect geo = q->geometry();
414 if (!q->isRootView())
415 geo.moveTopLeft(q->mapToGlobal(Point(0, 0)));
422 KDDW_ERROR(
"Shouldn't be called on this platform");
426std::shared_ptr<Core::Window> View::Private::transientWindow()
const
428 if (
auto w = q->window())
429 return w->transientParent();
436 d->resized.emit(Size(w, h));
442 return onResize(sz.width(), sz.height());
448 if ((one && !two) || (!one && two))
459 d->m_viewEventFilters.push_back(filter);
464 d->m_viewEventFilters.erase(
465 std::remove(
d->m_viewEventFilters.begin(),
d->m_viewEventFilters.end(), filter),
466 d->m_viewEventFilters.end());
472 if (ev->type() == Event::Move) {
473 if (filter->onMoveEvent(
this))
475 }
else if (
auto me = mouseEvent(ev)) {
476 if (filter->onMouseEvent(
this, me))
479 switch (ev->type()) {
480 case Event::MouseButtonPress:
481 if (filter->onMouseButtonPress(
this, me))
484 case Event::MouseButtonRelease:
485 if (filter->onMouseButtonRelease(
this, me))
488 case Event::MouseMove:
489 if (filter->onMouseButtonMove(
this, me))
492 case Event::MouseButtonDblClick:
493 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.