Sine Striker
2023-12-11 b1cc4e7de641a9e6ef866744d7775d45813bad8d
src/widgets/widgetitemdelegate.cpp
@@ -56,18 +56,21 @@
        return false;
    }
    bool WidgetItemDelegate::resetQtGrabbedControl() const {
        if (qt_button_down) {
            static constexpr const auto invalidPos = QPoint{std::numeric_limits<int>::lowest(), std::numeric_limits<int>::lowest()};
            const auto event =
                new QMouseEvent(QEvent::MouseButtonRelease, invalidPos, invalidPos, invalidPos,
                                Qt::LeftButton, QGuiApplication::mouseButtons() ^ Qt::LeftButton,
                                QGuiApplication::keyboardModifiers());
            QApplication::postEvent(qt_button_down, event);
            qt_button_down = nullptr;
            return true;
    bool WidgetItemDelegate::isWindowActive(const QObject *host) const {
        return static_cast<const QWidget *>(host)->isActiveWindow();
    }
    void WidgetItemDelegate::resetQtGrabbedControl() const {
        if (!qt_button_down) {
            return;
        }
        return false;
        static constexpr const auto invalidPos = QPoint{std::numeric_limits<int>::lowest(), std::numeric_limits<int>::lowest()};
        const auto event =
            new QMouseEvent(QEvent::MouseButtonRelease, invalidPos, invalidPos, invalidPos,
                            Qt::LeftButton, QGuiApplication::mouseButtons() ^ Qt::LeftButton,
                            QGuiApplication::keyboardModifiers());
        QApplication::postEvent(qt_button_down, event);
        qt_button_down = nullptr;
    }
}