Zhao Yuhang
2023-12-22 e33059ee1ef7e1be07490ad0245676ded42589f4
src/widgets/widgetitemdelegate.cpp
@@ -4,7 +4,7 @@
#include <QtWidgets/QWidget>
#include <QtWidgets/QApplication>
extern Q_WIDGETS_EXPORT QWidget *qt_button_down;
extern Q_DECL_IMPORT QWidget *qt_button_down;
namespace QWK {
@@ -47,12 +47,6 @@
        if (!minSize.isEmpty() && !maxSize.isEmpty() && (minSize == maxSize)) {
            return true;
        }
        // Usually set by the user.
        const QSizePolicy sizePolicy = widget->sizePolicy();
        if ((sizePolicy.horizontalPolicy() == QSizePolicy::Fixed) &&
            (sizePolicy.verticalPolicy() == QSizePolicy::Fixed)) {
            return true;
        }
        return false;
    }
@@ -78,11 +72,11 @@
        return static_cast<const QWidget *>(host)->windowState();
    }
    void WidgetItemDelegate::setWindowState(QObject *host, const Qt::WindowStates &state) const {
    void WidgetItemDelegate::setWindowState(QObject *host, Qt::WindowStates state) const {
        static_cast<QWidget *>(host)->setWindowState(state);
    }
    void WidgetItemDelegate::setCursorShape(QObject *host, const Qt::CursorShape shape) const {
    void WidgetItemDelegate::setCursorShape(QObject *host, Qt::CursorShape shape) const {
        static_cast<QWidget *>(host)->setCursor(QCursor(shape));
    }
@@ -94,8 +88,12 @@
        return static_cast<const QWidget *>(host)->windowFlags();
    }
    void WidgetItemDelegate::setWindowFlags(QObject *host, const Qt::WindowFlags &flags) const {
    void WidgetItemDelegate::setWindowFlags(QObject *host, Qt::WindowFlags flags) const {
        static_cast<QWidget *>(host)->setWindowFlags(flags);
    }
    void WidgetItemDelegate::bringWindowToTop(QObject *host) const {
        static_cast<QWidget *>(host)->raise();
    }
}