#include "quickitemdelegate_p.h" #include #include namespace QWK { QuickItemDelegate::QuickItemDelegate() : WindowItemDelegate() { } QuickItemDelegate::~QuickItemDelegate() = default; QWindow *QuickItemDelegate::window(const QObject *obj) const { return static_cast(obj)->window(); } bool QuickItemDelegate::isEnabled(const QObject *obj) const { return static_cast(obj)->isEnabled(); } bool QuickItemDelegate::isVisible(const QObject *obj) const { return static_cast(obj)->isVisible(); } QRect QuickItemDelegate::mapGeometryToScene(const QObject *obj) const { auto item = static_cast(obj); const QPointF originPoint = item->mapToScene(QPointF(0.0, 0.0)); const QSizeF size = item->size(); return QRectF(originPoint, size).toRect(); } QWindow *QuickItemDelegate::hostWindow(const QObject *host) const { return static_cast(const_cast(host)); } bool QuickItemDelegate::isHostSizeFixed(const QObject *host) const { // ### TOOD return false; } bool QuickItemDelegate::isWindowActive(const QObject *host) const { return static_cast(host)->isActive(); } Qt::WindowStates QuickItemDelegate::getWindowState(const QObject *host) const { return static_cast(host)->windowStates(); } void QuickItemDelegate::setWindowState(QObject *host, const Qt::WindowStates &state) const { static_cast(host)->setWindowStates(state); } void QuickItemDelegate::setCursorShape(QObject *host, const Qt::CursorShape shape) const { static_cast(host)->setCursor(QCursor(shape)); } void QuickItemDelegate::restoreCursorShape(QObject *host) const { static_cast(host)->unsetCursor(); } Qt::WindowFlags QuickItemDelegate::getWindowFlags(const QObject *host) const { return static_cast(host)->flags(); } void QuickItemDelegate::setWindowFlags(QObject *host, const Qt::WindowFlags &flags) const { static_cast(host)->setFlags(flags); } }