66 lines
2.0 KiB
Diff
66 lines
2.0 KiB
Diff
|
|
From 72166cc21f423f9c7a93f4773080dced6bfa8564 Mon Sep 17 00:00:00 2001
|
||
|
|
From: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||
|
|
Date: Tue, 24 Sep 2024 14:54:44 +0800
|
||
|
|
Subject: [PATCH] fix(QCompleter): Adjust the height of the QCompleter Popup
|
||
|
|
pop-up
|
||
|
|
MIME-Version: 1.0
|
||
|
|
Content-Type: text/plain; charset=UTF-8
|
||
|
|
Content-Transfer-Encoding: 8bit
|
||
|
|
|
||
|
|
- 针对QCompleter Popup弹出的高度进行调整
|
||
|
|
|
||
|
|
Closes #42329
|
||
|
|
---
|
||
|
|
style/src/style.cpp | 7 +++----
|
||
|
|
1 file changed, 3 insertions(+), 4 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/style/src/style.cpp b/style/src/style.cpp
|
||
|
|
index 6fba993..000fe11 100644
|
||
|
|
--- a/style/src/style.cpp
|
||
|
|
+++ b/style/src/style.cpp
|
||
|
|
@@ -170,6 +170,8 @@ int Style::pixelMetric(QStyle::PixelMetric metric, const QStyleOption *option, c
|
||
|
|
switch (metric)
|
||
|
|
{
|
||
|
|
case PM_DefaultFrameWidth:
|
||
|
|
+ if (qobject_cast<const QAbstractScrollArea *>(widget))
|
||
|
|
+ return 2;
|
||
|
|
return 6;
|
||
|
|
case PM_SpinBoxFrameWidth:
|
||
|
|
return 2;
|
||
|
|
@@ -182,7 +184,6 @@ int Style::pixelMetric(QStyle::PixelMetric metric, const QStyleOption *option, c
|
||
|
|
case PM_FocusFrameVMargin:
|
||
|
|
case PM_FocusFrameHMargin:
|
||
|
|
return 2;
|
||
|
|
-
|
||
|
|
// 布局默认边距
|
||
|
|
case PM_LayoutLeftMargin:
|
||
|
|
case PM_LayoutTopMargin:
|
||
|
|
@@ -199,7 +200,7 @@ int Style::pixelMetric(QStyle::PixelMetric metric, const QStyleOption *option, c
|
||
|
|
return 6;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
-
|
||
|
|
+
|
||
|
|
// 布局默认间距
|
||
|
|
case PM_LayoutHorizontalSpacing:
|
||
|
|
case PM_LayoutVerticalSpacing:
|
||
|
|
@@ -268,7 +269,6 @@ int Style::pixelMetric(QStyle::PixelMetric metric, const QStyleOption *option, c
|
||
|
|
case PM_TabCloseIndicatorWidth:
|
||
|
|
case PM_TabCloseIndicatorHeight:
|
||
|
|
return pixelMetric(PM_SmallIconSize, option, widget);
|
||
|
|
-
|
||
|
|
// scrollbars
|
||
|
|
case PM_ScrollBarExtent:
|
||
|
|
return 5;
|
||
|
|
@@ -317,7 +317,6 @@ int Style::pixelMetric(QStyle::PixelMetric metric, const QStyleOption *option, c
|
||
|
|
return 1;
|
||
|
|
case PM_DockWidgetSeparatorExtent:
|
||
|
|
return 1;
|
||
|
|
-
|
||
|
|
default: // fallback
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|