summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qstyleditemdelegate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/itemviews/qstyleditemdelegate.cpp')
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp
index 716df2c729..43b640fd69 100644
--- a/src/widgets/itemviews/qstyleditemdelegate.cpp
+++ b/src/widgets/itemviews/qstyleditemdelegate.cpp
@@ -514,12 +514,13 @@ void QStyledItemDelegate::updateEditorGeometry(QWidget *editor,
QStyle *style = widget ? widget->style() : QApplication::style();
QRect geom = style->subElementRect(QStyle::SE_ItemViewItemText, &opt, widget);
- if ( editor->layoutDirection() == Qt::RightToLeft) {
- const int delta = qSmartMinSize(editor).width() - geom.width();
- if (delta > 0) {
- //we need to widen the geometry
+ const int delta = qSmartMinSize(editor).width() - geom.width();
+ if (delta > 0) {
+ //we need to widen the geometry
+ if (editor->layoutDirection() == Qt::RightToLeft)
geom.adjust(-delta, 0, 0, 0);
- }
+ else
+ geom.adjust(0, 0, delta, 0);
}
editor->setGeometry(geom);