summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2023-10-22 14:02:20 +0200
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2023-11-21 00:19:19 +0200
commit7e362f76a6a6b0eb0cad2d2426063524f41fc16c (patch)
tree3f65a8983ae62294c63cbde94d320e008381e985 /src/widgets/itemviews
parentb03557287fef291fc0a79ba2dc7c0f8bb3a0547b (diff)
QStyledItemDelegate/TreeView: fix showing lineedit editor
When the text alignment is AlignRight the opened editor is wrongly aligned and therefore the text can not be read. There is no reason to align the editor window on the right only because of the text alignment. Also remove the hack to not let occupy the editor the whole cell in a QTreeView but in a QTableView. Fixes: QTBUG-98525 Change-Id: I6f2d88e461bcfd505adde745041b5d4fdf679201 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'src/widgets/itemviews')
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp
index 038b0bdcd0..871c0163c9 100644
--- a/src/widgets/itemviews/qstyleditemdelegate.cpp
+++ b/src/widgets/itemviews/qstyleditemdelegate.cpp
@@ -477,15 +477,7 @@ void QStyledItemDelegate::updateEditorGeometry(QWidget *editor,
QStyleOptionViewItem opt = option;
initStyleOption(&opt, index);
- // let the editor take up all available space
- //if the editor is not a QLineEdit
- //or it is in a QTableView
-#if QT_CONFIG(tableview) && QT_CONFIG(lineedit)
- if (qobject_cast<QExpandingLineEdit*>(editor) && !qobject_cast<const QTableView*>(widget))
- opt.showDecorationSelected = editor->style()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, nullptr, editor);
- else
-#endif
- opt.showDecorationSelected = true;
+ opt.showDecorationSelected = editor->style()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, nullptr, editor);
QStyle *style = widget ? widget->style() : QApplication::style();
QRect geom = style->subElementRect(QStyle::SE_ItemViewItemText, &opt, widget);