diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2023-10-22 14:02:20 +0200 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2023-11-21 00:19:19 +0200 |
commit | 7e362f76a6a6b0eb0cad2d2426063524f41fc16c (patch) | |
tree | 3f65a8983ae62294c63cbde94d320e008381e985 /src/widgets/styles/qcommonstyle.cpp | |
parent | b03557287fef291fc0a79ba2dc7c0f8bb3a0547b (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/styles/qcommonstyle.cpp')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 3fca57a03f..a2810737ca 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -1160,12 +1160,8 @@ void QCommonStylePrivate::viewItemLayout(const QStyleOptionViewItem *opt, QRect checkRect->size(), check); *pixmapRect = QStyle::alignedRect(opt->direction, opt->decorationAlignment, pixmapRect->size(), decoration); - // the text takes up all available space, unless the decoration is not shown as selected - if (opt->showDecorationSelected) - *textRect = display; - else - *textRect = QStyle::alignedRect(opt->direction, opt->displayAlignment, - textRect->size().boundedTo(display.size()), display); + // the textRect takes up all remaining size + *textRect = display; } else { *checkRect = check; *pixmapRect = decoration; |