Yuhang Zhao
2023-12-07 86403b4e99f901f687050ce9a91a8e539331cebb
remove not needed result
5个文件已修改
33 ■■■■ 已修改文件
src/core/contexts/win32windowcontext.cpp 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/core/windowitemdelegate.cpp 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/core/windowitemdelegate.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/widgets/widgetitemdelegate.cpp 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/widgets/widgetitemdelegate_p.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/core/contexts/win32windowcontext.cpp
@@ -869,7 +869,7 @@
                const WindowPart currentWindowPart = lastHitTestResult;
                if (message == WM_NCMOUSEMOVE) {
                    if (currentWindowPart != WindowPart::ChromeButton) {
                        std::ignore = m_delegate->resetQtGrabbedControl();
                        m_delegate->resetQtGrabbedControl();
                        if (mouseLeaveBlocked) {
                            emulateClientAreaMessage(hWnd, message, wParam, lParam,
                                                     WM_NCMOUSELEAVE);
@@ -931,7 +931,7 @@
                        // window from client area, which means we will get previous window part as
                        // HTCLIENT if the mouse leaves window from client area and enters window
                        // from non-client area, but it has no bad effect.
                        std::ignore = m_delegate->resetQtGrabbedControl();
                        m_delegate->resetQtGrabbedControl();
                    }
                }
                break;
src/core/windowitemdelegate.cpp
@@ -6,8 +6,6 @@
    WindowItemDelegate::~WindowItemDelegate() = default;
    bool WindowItemDelegate::resetQtGrabbedControl() const {
        return true;
    }
    void WindowItemDelegate::resetQtGrabbedControl() const {}
}
src/core/windowitemdelegate.h
@@ -26,7 +26,7 @@
        virtual bool isHostSizeFixed(const QObject *host) const = 0;
        // Callbacks
        virtual bool resetQtGrabbedControl() const;
        virtual void resetQtGrabbedControl() const;
    private:
        Q_DISABLE_COPY_MOVE(WindowItemDelegate)
src/widgets/widgetitemdelegate.cpp
@@ -56,18 +56,17 @@
        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;
    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;
    }
}
src/widgets/widgetitemdelegate_p.h
@@ -23,7 +23,7 @@
        QWindow * hostWindow(const QObject *host) const override;
        bool isHostSizeFixed(const QObject *host) const override;
        bool resetQtGrabbedControl() const override;
        void resetQtGrabbedControl() const override;
    };
}