From f041cd599f2ba58906958f6886b9cd25e180d0af Mon Sep 17 00:00:00 2001
From: Yuhang Zhao <zhaoyuhang@rankyee.com>
Date: 周三, 06 12月 2023 10:28:34 +0800
Subject: [PATCH] add more const

---
 src/widgets/widgetitemdelegate.cpp |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/widgets/widgetitemdelegate.cpp b/src/widgets/widgetitemdelegate.cpp
index 974f755..6378f36 100644
--- a/src/widgets/widgetitemdelegate.cpp
+++ b/src/widgets/widgetitemdelegate.cpp
@@ -12,15 +12,15 @@
 
     WidgetItemDelegate::~WidgetItemDelegate() = default;
 
-    QWindow *WidgetItemDelegate::window(QObject *obj) const {
+    QWindow *WidgetItemDelegate::window(const QObject *obj) const {
         return static_cast<const QWidget *>(obj)->windowHandle();
     }
 
-    bool WidgetItemDelegate::isEnabled(QObject *obj) const {
+    bool WidgetItemDelegate::isEnabled(const QObject *obj) const {
         return static_cast<const QWidget *>(obj)->isEnabled();
     }
 
-    bool WidgetItemDelegate::isVisible(QObject *obj) const {
+    bool WidgetItemDelegate::isVisible(const QObject *obj) const {
         return static_cast<const QWidget *>(obj)->isVisible();
     }
 
@@ -31,11 +31,11 @@
         return {originPoint, size};
     }
 
-    QWindow *WidgetItemDelegate::hostWindow(QObject *host) const {
+    QWindow *WidgetItemDelegate::hostWindow(const QObject *host) const {
         return static_cast<const QWidget *>(host)->windowHandle();
     }
 
-    bool WidgetItemDelegate::isHostSizeFixed(QObject *host) const {
+    bool WidgetItemDelegate::isHostSizeFixed(const QObject *host) const {
         const auto widget = static_cast<const QWidget *>(host);
         // "Qt::MSWindowsFixedSizeDialogHint" is used cross-platform actually.
         if (widget->windowFlags() & Qt::MSWindowsFixedSizeDialogHint) {

--
Gitblit v1.9.1