| | |
| | | |
| | | WidgetItemDelegate::~WidgetItemDelegate() = default; |
| | | |
| | | QWindow *WidgetItemDelegate::window(QObject *obj) const { |
| | | QWindow *WidgetItemDelegate::window(const QObject *obj) const { |
| | | return static_cast<const QWidget *>(obj)->windowHandle(); |
| | | } |
| | | |
| | |
| | | return {originPoint, size}; |
| | | } |
| | | |
| | | QWindow *WidgetItemDelegate::hostWindow(QObject *host) const { |
| | | QWindow *WidgetItemDelegate::hostWindow(const QObject *host) const { |
| | | return static_cast<const QWidget *>(host)->windowHandle(); |
| | | } |
| | | |
| | |
| | | return static_cast<const QWidget *>(host)->isActiveWindow(); |
| | | } |
| | | |
| | | void WidgetItemDelegate::resetQtGrabbedControl() const { |
| | | void WidgetItemDelegate::resetQtGrabbedControl(QObject *host) const { |
| | | Q_UNUSED(host); |
| | | if (!qt_button_down) { |
| | | return; |
| | | } |
| | |
| | | const auto event = new QMouseEvent( |
| | | QEvent::MouseButtonRelease, invalidPos, invalidPos, invalidPos, Qt::LeftButton, |
| | | QGuiApplication::mouseButtons() ^ Qt::LeftButton, QGuiApplication::keyboardModifiers()); |
| | | QApplication::postEvent(qt_button_down, event); |
| | | QCoreApplication::postEvent(qt_button_down, event); |
| | | qt_button_down = nullptr; |
| | | } |
| | | |
| | | Qt::WindowStates WidgetItemDelegate::getWindowState(const QObject *host) const { |
| | | return static_cast<const QWidget *>(host)->windowState(); |
| | | } |
| | | |
| | | void WidgetItemDelegate::setWindowState(QObject *host, Qt::WindowStates state) const { |
| | | static_cast<QWidget *>(host)->setWindowState(state); |
| | | } |
| | | |
| | | void WidgetItemDelegate::setCursorShape(QObject *host, Qt::CursorShape shape) const { |
| | | static_cast<QWidget *>(host)->setCursor(QCursor(shape)); |
| | | } |
| | | |
| | | void WidgetItemDelegate::restoreCursorShape(QObject *host) const { |
| | | static_cast<QWidget *>(host)->unsetCursor(); |
| | | } |
| | | |
| | | Qt::WindowFlags WidgetItemDelegate::getWindowFlags(const QObject *host) const { |
| | | return static_cast<const QWidget *>(host)->windowFlags(); |
| | | } |
| | | |
| | | void WidgetItemDelegate::setWindowFlags(QObject *host, Qt::WindowFlags flags) const { |
| | | static_cast<QWidget *>(host)->setWindowFlags(flags); |
| | | } |
| | | |
| | | } |