diff options
Diffstat (limited to 'debian/patches/0226-qtreeview-column_resize_when_needed.diff')
-rw-r--r-- | debian/patches/0226-qtreeview-column_resize_when_needed.diff | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/debian/patches/0226-qtreeview-column_resize_when_needed.diff b/debian/patches/0226-qtreeview-column_resize_when_needed.diff deleted file mode 100644 index 986b652..0000000 --- a/debian/patches/0226-qtreeview-column_resize_when_needed.diff +++ /dev/null @@ -1,104 +0,0 @@ -qt-bugs@ issue : N209927 -Trolltech task ID : 210390 -bugs.kde.org number : None -applied: no -author: Rafael Fernández López <ereslibre@kde.org> - -If we have no header, or not visible header on a QTreeView, we can end up with -an unusable widget if we expand lots of child widgets of the kind - -a - b - c - d - ... - -This patch assures that if no header is shown, or if we only have one column (so -no other columns become shrinked), the contents will be visible. - ---- a/src/gui/itemviews/qtreeview.h -+++ b/src/gui/itemviews/qtreeview.h -@@ -229,6 +229,7 @@ - Q_PRIVATE_SLOT(d_func(), void _q_columnsAboutToBeRemoved(const QModelIndex &, int, int)) - Q_PRIVATE_SLOT(d_func(), void _q_columnsRemoved(const QModelIndex &, int, int)) - Q_PRIVATE_SLOT(d_func(), void _q_modelAboutToBeReset()) -+ Q_PRIVATE_SLOT(d_func(), void _q_forceColumnResizeToFitContents()) - }; - - #endif // QT_NO_TREEVIEW ---- a/src/gui/itemviews/qtreeview.cpp -+++ b/src/gui/itemviews/qtreeview.cpp -@@ -248,6 +248,19 @@ - - connect(d->model, SIGNAL(modelAboutToBeReset()), SLOT(_q_modelAboutToBeReset())); - -+ // we connect these signals from the model to a slot that will call -+ // resizeColumnToContents. This is important because if we call it only on -+ // expand() method, when we expand a node, the filling of the model can be -+ // delayed. So, we call it again after the model has finished its job. -+ connect(d->model, SIGNAL(layoutChanged()), -+ this, SLOT(_q_forceColumnResizeToFitContents())); -+ connect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)), -+ this, SLOT(_q_forceColumnResizeToFitContents())); -+ connect(d->model, SIGNAL(rowsRemoved(QModelIndex,int,int)), -+ this, SLOT(_q_forceColumnResizeToFitContents())); -+ -+ -+ - if (d->sortingEnabled) - sortByColumn(header()->sortIndicatorSection()); - } -@@ -2815,6 +2828,8 @@ - } - if (model->canFetchMore(index)) - model->fetchMore(index); -+ -+ _q_forceColumnResizeToFitContents(); - } - - void QTreeViewPrivate::collapse(int item, bool emitSignal) -@@ -2854,6 +2869,8 @@ - else - emit q->collapsed(modelIndex); - } -+ -+ _q_forceColumnResizeToFitContents(); - } - - void QTreeViewPrivate::prepareAnimatedOperation(int item, AnimatedOperation::Type type) -@@ -2965,6 +2982,25 @@ - viewItems.clear(); - } - -+void QTreeViewPrivate::_q_forceColumnResizeToFitContents() -+{ -+ Q_Q(QTreeView); -+ -+ /** -+ * if: -+ * -+ * a) The tree view has no header (user cannot resize the column) OR -+ * b) The tree view has a header, but hidden (user cannot resize the column) OR -+ * c) The tree view has a visible header, but with _only_ one (or zero) column (that -+ * means: no other information will be affected). -+ * -+ * We can expand the column to make the contents properly visible. -+ */ -+ if (!header || !header->isVisible() || ((header->count() - header->hiddenSectionCount()) <= 1)) { -+ q->resizeColumnToContents(q->currentIndex().column()); -+ } -+} -+ - void QTreeViewPrivate::_q_columnsAboutToBeRemoved(const QModelIndex &parent, int start, int end) - { - Q_UNUSED(parent); ---- a/src/gui/itemviews/qtreeview_p.h -+++ b/src/gui/itemviews/qtreeview_p.h -@@ -101,6 +101,7 @@ - QPixmap after; - }; - -+ void _q_forceColumnResizeToFitContents(); - void expand(int item, bool emitSignal); - void collapse(int item, bool emitSignal); - |