Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 1473382 Details for
Bug 1611166
systemmonitor, ksysguard - failed apply last configuration
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
qtbase qheaderview backport 5.11 -> 5.10
qtbase-qheaderview_backport_5.11.patch (text/plain), 20.32 KB, created by
painless.roaster
on 2018-08-05 07:51:23 UTC
(
hide
)
Description:
qtbase qheaderview backport 5.11 -> 5.10
Filename:
MIME Type:
Creator:
painless.roaster
Created:
2018-08-05 07:51:23 UTC
Size:
20.32 KB
patch
obsolete
>--- qtbase-everywhere-src-5.10.1/src/widgets/itemviews/qheaderview_p.h.orig 2018-02-08 19:24:48.000000000 +0100 >+++ qtbase-everywhere-src-5.10.1/src/widgets/itemviews/qheaderview_p.h 2018-08-04 16:30:30.121776495 +0200 >@@ -120,8 +120,12 @@ > void updateHiddenSections(int logicalFirst, int logicalLast); > void resizeSections(QHeaderView::ResizeMode globalMode, bool useGlobalMode = false); > void _q_sectionsRemoved(const QModelIndex &,int,int); >- void _q_layoutAboutToBeChanged(); >- void _q_layoutChanged() override; >+ void _q_sectionsAboutToBeMoved(const QModelIndex &sourceParent, int logicalStart, int logicalEnd, const QModelIndex &destinationParent, int logicalDestination); >+ void _q_sectionsMoved(const QModelIndex &sourceParent, int logicalStart, int logicalEnd, const QModelIndex &destinationParent, int logicalDestination); >+ void _q_sectionsAboutToBeChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), >+ QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint); >+ void _q_sectionsChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), >+ QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint); > > bool isSectionSelected(int section) const; > bool isFirstVisibleSection(int section) const; >--- qtbase-everywhere-src-5.10.1/src/widgets/itemviews/qheaderview.h.orig 2018-02-08 19:24:48.000000000 +0100 >+++ qtbase-everywhere-src-5.10.1/src/widgets/itemviews/qheaderview.h 2018-08-04 16:30:36.631832959 +0200 >@@ -53,6 +53,7 @@ > class Q_WIDGETS_EXPORT QHeaderView : public QAbstractItemView > { > Q_OBJECT >+ Q_PROPERTY(bool firstSectionMovable READ isFirstSectionMovable WRITE setFirstSectionMovable) > Q_PROPERTY(bool showSortIndicator READ isSortIndicatorShown WRITE setSortIndicatorShown) > Q_PROPERTY(bool highlightSections READ highlightSections WRITE setHighlightSections) > Q_PROPERTY(bool stretchLastSection READ stretchLastSection WRITE setStretchLastSection) >@@ -118,6 +119,8 @@ > inline QT_DEPRECATED void setMovable(bool movable) { setSectionsMovable(movable); } > inline QT_DEPRECATED bool isMovable() const { return sectionsMovable(); } > #endif >+ void setFirstSectionMovable(bool movable); >+ bool isFirstSectionMovable() const; > > void setSectionsClickable(bool clickable); > bool sectionsClickable() const; >@@ -250,7 +253,12 @@ > > private: > Q_PRIVATE_SLOT(d_func(), void _q_sectionsRemoved(const QModelIndex &parent, int logicalFirst, int logicalLast)) >- Q_PRIVATE_SLOT(d_func(), void _q_layoutAboutToBeChanged()) >+ Q_PRIVATE_SLOT(d_func(), void _q_sectionsAboutToBeMoved(const QModelIndex &sourceParent, int logicalStart, int logicalEnd, const QModelIndex &destinationParent, int logicalDestination)) >+ Q_PRIVATE_SLOT(d_func(), void _q_sectionsMoved(const QModelIndex &sourceParent, int logicalStart, int logicalEnd, const QModelIndex &destinationParent, int logicalDestination)) >+ Q_PRIVATE_SLOT(d_func(), void _q_sectionsAboutToBeChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), >+ QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint)) >+ Q_PRIVATE_SLOT(d_func(), void _q_sectionsChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), >+ QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint)) > Q_DECLARE_PRIVATE(QHeaderView) > Q_DISABLE_COPY(QHeaderView) > }; >--- qtbase-everywhere-src-5.10.1/src/widgets/itemviews/qheaderview.cpp.orig 2018-02-08 19:24:48.000000000 +0100 >+++ qtbase-everywhere-src-5.10.1/src/widgets/itemviews/qheaderview.cpp 2018-08-04 16:30:27.170750899 +0200 >@@ -361,7 +361,9 @@ > QObject::disconnect(d->model, SIGNAL(columnsRemoved(QModelIndex,int,int)), > this, SLOT(_q_sectionsRemoved(QModelIndex,int,int))); > QObject::disconnect(d->model, SIGNAL(columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)), >- this, SLOT(_q_layoutAboutToBeChanged())); >+ this, SLOT(_q_sectionsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int))); >+ QObject::disconnect(d->model, SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)), >+ this, SLOT(_q_sectionsMoved(QModelIndex,int,int,QModelIndex,int))); > } else { > QObject::disconnect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)), > this, SLOT(sectionsInserted(QModelIndex,int,int))); >@@ -370,12 +372,16 @@ > QObject::disconnect(d->model, SIGNAL(rowsRemoved(QModelIndex,int,int)), > this, SLOT(_q_sectionsRemoved(QModelIndex,int,int))); > QObject::disconnect(d->model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)), >- this, SLOT(_q_layoutAboutToBeChanged())); >+ this, SLOT(_q_sectionsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int))); >+ QObject::disconnect(d->model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), >+ this, SLOT(_q_sectionsMoved(QModelIndex,int,int,QModelIndex,int))); > } > QObject::disconnect(d->model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)), > this, SLOT(headerDataChanged(Qt::Orientation,int,int))); >- QObject::disconnect(d->model, SIGNAL(layoutAboutToBeChanged()), >- this, SLOT(_q_layoutAboutToBeChanged())); >+ QObject::disconnect(d->model, SIGNAL(layoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)), >+ this, SLOT(_q_sectionsAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint))); >+ QObject::disconnect(d->model, SIGNAL(layoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)), >+ this, SLOT(_q_sectionsChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint))); > } > > if (model && model != QAbstractItemModelPrivate::staticEmptyModel()) { >@@ -387,7 +393,9 @@ > QObject::connect(model, SIGNAL(columnsRemoved(QModelIndex,int,int)), > this, SLOT(_q_sectionsRemoved(QModelIndex,int,int))); > QObject::connect(model, SIGNAL(columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)), >- this, SLOT(_q_layoutAboutToBeChanged())); >+ this, SLOT(_q_sectionsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int))); >+ QObject::connect(model, SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)), >+ this, SLOT(_q_sectionsMoved(QModelIndex,int,int,QModelIndex,int))); > } else { > QObject::connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)), > this, SLOT(sectionsInserted(QModelIndex,int,int))); >@@ -396,12 +404,16 @@ > QObject::connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)), > this, SLOT(_q_sectionsRemoved(QModelIndex,int,int))); > QObject::connect(model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)), >- this, SLOT(_q_layoutAboutToBeChanged())); >+ this, SLOT(_q_sectionsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int))); >+ QObject::connect(model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), >+ this, SLOT(_q_sectionsMoved(QModelIndex,int,int,QModelIndex,int))); > } > QObject::connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)), > this, SLOT(headerDataChanged(Qt::Orientation,int,int))); >- QObject::connect(model, SIGNAL(layoutAboutToBeChanged()), >- this, SLOT(_q_layoutAboutToBeChanged())); >+ QObject::connect(model, SIGNAL(layoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)), >+ this, SLOT(_q_sectionsAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint))); >+ QObject::connect(model, SIGNAL(layoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)), >+ this, SLOT(_q_sectionsChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint))); > } > > d->state = QHeaderViewPrivate::NoClear; >@@ -608,7 +620,7 @@ > return -1; > > if (d->reverse()) >- vposition = d->viewport->width() - vposition; >+ vposition = d->viewport->width() - vposition - 1; > vposition += d->offset; > > if (vposition > d->length) >@@ -874,6 +886,10 @@ > if (logical < 0 || logical >= count() || size < 0 || size > maxSizeSection) > return; > >+ // make sure to not exceed bounds when setting size programmatically >+ if (size > 0) >+ size = qBound(minimumSectionSize(), size, maximumSectionSize()); >+ > if (isSectionHidden(logical)) { > d->hiddenSectionSize.insert(logical, size); > return; >@@ -1103,10 +1119,15 @@ > /*! > \since 5.0 > >- If \a movable is true, the header may be moved by the user; otherwise it >- is fixed in place. >+ If \a movable is true, the header sections may be moved by the user; >+ otherwise they are fixed in place. >+ >+ When used in combination with QTreeView, the first column is not >+ movable (since it contains the tree structure), by default. >+ You can make it movable with setFirstSectionMovable(true). > > \sa sectionsMovable(), sectionMoved() >+ \sa setFirstSectionMovable() > */ > > void QHeaderView::setSectionsMovable(bool movable) >@@ -1131,6 +1152,9 @@ > Returns \c true if the header can be moved by the user; otherwise returns > false. > >+ By default, sections are movable in QTreeView (except for the first one), >+ and not movable in QTableView. >+ > \sa setSectionsMovable() > */ > >@@ -1151,6 +1175,37 @@ > */ > > /*! >+ \property QHeaderView::firstSectionMovable >+ \brief Whether the first column can be moved by the user >+ >+ This property controls whether the first column can be moved by the user. >+ In a QTreeView, the first column holds the tree structure and is >+ therefore non-movable by default, even after setSectionsMovable(true). >+ >+ It can be made movable again, for instance in the case of flat lists >+ without a tree structure, by calling this method. >+ In such a scenario, it is recommended to call QTreeView::setRootIsDecorated(false) >+ as well. >+ >+ Setting it to true has no effect unless setSectionsMovable(true) is called >+ as well. >+ >+ \sa setSectionsMovable() >+ \since 5.11 >+*/ >+void QHeaderView::setFirstSectionMovable(bool movable) >+{ >+ Q_D(QHeaderView); >+ d->allowUserMoveOfSection0 = movable; >+} >+ >+bool QHeaderView::isFirstSectionMovable() const >+{ >+ Q_D(const QHeaderView); >+ return d->allowUserMoveOfSection0; >+} >+ >+/*! > \since 5.0 > > If \a clickable is true, the header will respond to single clicks. >@@ -1608,9 +1663,25 @@ > Q_D(QHeaderView); > if (size < -1 || size > maxSizeSection) > return; >+ // larger new min size - check current section sizes >+ const bool needSizeCheck = size > d->minimumSectionSize; > d->minimumSectionSize = size; > if (d->minimumSectionSize > maximumSectionSize()) >- d->maximumSectionSize = size; >+ setMaximumSectionSize(size); >+ >+ if (needSizeCheck) { >+ if (d->hasAutoResizeSections()) { >+ d->doDelayedResizeSections(); >+ } else { >+ for (int visual = 0; visual < d->sectionCount(); ++visual) { >+ if (d->isVisualIndexHidden(visual)) >+ continue; >+ if (d->headerSectionSize(visual) < d->minimumSectionSize) >+ resizeSection(logicalIndex(visual), size); >+ } >+ } >+ } >+ > } > > /*! >@@ -1647,7 +1718,22 @@ > if (minimumSectionSize() > size) > d->minimumSectionSize = size; > >+ // smaller new max size - check current section sizes >+ const bool needSizeCheck = size < d->maximumSectionSize; > d->maximumSectionSize = size; >+ >+ if (needSizeCheck) { >+ if (d->hasAutoResizeSections()) { >+ d->doDelayedResizeSections(); >+ } else { >+ for (int visual = 0; visual < d->sectionCount(); ++visual) { >+ if (d->isVisualIndexHidden(visual)) >+ continue; >+ if (d->headerSectionSize(visual) > d->maximumSectionSize) >+ resizeSection(logicalIndex(visual), size); >+ } >+ } >+ } > } > > >@@ -2062,8 +2148,33 @@ > viewport->update(); > } > >-void QHeaderViewPrivate::_q_layoutAboutToBeChanged() >+void QHeaderViewPrivate::_q_sectionsAboutToBeMoved(const QModelIndex &sourceParent, int logicalStart, int logicalEnd, const QModelIndex &destinationParent, int logicalDestination) >+{ >+ if (sourceParent != root || destinationParent != root) >+ return; // we only handle changes in the root level >+ Q_UNUSED(logicalStart); >+ Q_UNUSED(logicalEnd); >+ Q_UNUSED(logicalDestination); >+ _q_sectionsAboutToBeChanged(); >+} >+ >+void QHeaderViewPrivate::_q_sectionsMoved(const QModelIndex &sourceParent, int logicalStart, int logicalEnd, const QModelIndex &destinationParent, int logicalDestination) >+{ >+ if (sourceParent != root || destinationParent != root) >+ return; // we only handle changes in the root level >+ Q_UNUSED(logicalStart); >+ Q_UNUSED(logicalEnd); >+ Q_UNUSED(logicalDestination); >+ _q_sectionsChanged(); >+} >+ >+void QHeaderViewPrivate::_q_sectionsAboutToBeChanged(const QList<QPersistentModelIndex> &, >+ QAbstractItemModel::LayoutChangeHint hint) > { >+ if ((hint == QAbstractItemModel::VerticalSortHint && orientation == Qt::Horizontal) || >+ (hint == QAbstractItemModel::HorizontalSortHint && orientation == Qt::Vertical)) >+ return; >+ > //if there is no row/column we can't have mapping for columns > //because no QModelIndex in the model would be valid > // ### this is far from being bullet-proof and we would need a real system to >@@ -2075,20 +2186,30 @@ > layoutChangePersistentSections.clear(); > layoutChangePersistentSections.reserve(std::min(10, sectionItems.count())); > // after layoutChanged another section can be last stretched section >- if (stretchLastSection) { >+ if (stretchLastSection && lastSectionLogicalIdx >= 0 && lastSectionLogicalIdx < sectionItems.count()) { > const int visual = visualIndex(lastSectionLogicalIdx); >- sectionItems[visual].size = lastSectionSize; >+ if (visual >= 0 && visual < sectionItems.size()) { >+ auto &itemRef = sectionItems[visual]; >+ if (itemRef.size != lastSectionSize) { >+ length += lastSectionSize - itemRef.size; >+ itemRef.size = lastSectionSize; >+ } >+ } > } > for (int i = 0; i < sectionItems.size(); ++i) { >- const auto &s = sectionItems.at(i); >+ auto s = sectionItems.at(i); > // only add if the section is not default and not visually moved > if (s.size == defaultSectionSize && !s.isHidden && s.resizeMode == globalResizeMode) > continue; > >+ const int logical = logicalIndex(i); >+ if (s.isHidden) >+ s.size = hiddenSectionSize.value(logical); >+ > // ### note that we are using column or row 0 > layoutChangePersistentSections.append({orientation == Qt::Horizontal >- ? model->index(0, logicalIndex(i), root) >- : model->index(logicalIndex(i), 0, root), >+ ? model->index(0, logical, root) >+ : model->index(logical, 0, root), > s}); > > if (layoutChangePersistentSections.size() > 1000) >@@ -2096,8 +2217,13 @@ > } > } > >-void QHeaderViewPrivate::_q_layoutChanged() >+void QHeaderViewPrivate::_q_sectionsChanged(const QList<QPersistentModelIndex> &, >+ QAbstractItemModel::LayoutChangeHint hint) > { >+ if ((hint == QAbstractItemModel::VerticalSortHint && orientation == Qt::Horizontal) || >+ (hint == QAbstractItemModel::HorizontalSortHint && orientation == Qt::Vertical)) >+ return; >+ > Q_Q(QHeaderView); > viewport->update(); > >@@ -2113,6 +2239,30 @@ > return; > } > >+ bool hasPersistantIndexes = false; >+ for (const auto &item : oldPersistentSections) { >+ if (item.index.isValid()) { >+ hasPersistantIndexes = true; >+ break; >+ } >+ } >+ >+ // Though far from perfect we here try to retain earlier/existing behavior >+ // ### See QHeaderViewPrivate::_q_layoutAboutToBeChanged() >+ // When we don't have valid hasPersistantIndexes it can be due to >+ // - all sections are default sections >+ // - the row/column 0 which is used for persistent indexes is gone >+ // - all non-default sections were removed >+ // case one is trivial, in case two we assume nothing else changed (it's the best >+ // guess we can do - everything else can not be handled correctly for now) >+ // case three can not be handled correctly with layoutChanged - removeSections >+ // should be used instead for this >+ if (!hasPersistantIndexes) { >+ if (oldCount != newCount) >+ q->initializeSections(); >+ return; >+ } >+ > // adjust section size > if (newCount != oldCount) { > const int min = qBound(0, oldCount, newCount - 1); >@@ -2575,7 +2725,7 @@ > statusTip = d->model->headerData(logical, d->orientation, Qt::StatusTipRole).toString(); > if (d->shouldClearStatusTip || !statusTip.isEmpty()) { > QStatusTipEvent tip(statusTip); >- QCoreApplication::sendEvent(d->parent, &tip); >+ QCoreApplication::sendEvent(d->parent ? d->parent : this, &tip); > d->shouldClearStatusTip = !statusTip.isEmpty(); > } > #endif // !QT_NO_STATUSTIP >@@ -2806,14 +2956,18 @@ > if (isSortIndicatorShown() && sortIndicatorSection() == logicalIndex && isHeaderArrowOnTheSide) > margin += style()->pixelMetric(QStyle::PM_HeaderMarkSize, 0, this); > >- if (d->textElideMode != Qt::ElideNone) >- opt.text = opt.fontMetrics.elidedText(opt.text, d->textElideMode , rect.width() - margin); >- >- QVariant variant = d->model->headerData(logicalIndex, d->orientation, >+ const QVariant variant = d->model->headerData(logicalIndex, d->orientation, > Qt::DecorationRole); > opt.icon = qvariant_cast<QIcon>(variant); > if (opt.icon.isNull()) > opt.icon = qvariant_cast<QPixmap>(variant); >+ if (!opt.icon.isNull()) // see CT_HeaderSection >+ margin += style()->pixelMetric(QStyle::PM_SmallIconSize, 0, this) + >+ style()->pixelMetric(QStyle::PM_HeaderMargin, 0, this); >+ >+ if (d->textElideMode != Qt::ElideNone) >+ opt.text = opt.fontMetrics.elidedText(opt.text, d->textElideMode , rect.width() - margin); >+ > QVariant foregroundBrush = d->model->headerData(logicalIndex, d->orientation, > Qt::ForegroundRole); > if (foregroundBrush.canConvert<QBrush>()) >@@ -3424,9 +3578,11 @@ > int logicalIndex = q->logicalIndex(i); > sectionSize = qMax(viewSectionSizeHint(logicalIndex), > q->sectionSizeHint(logicalIndex)); >- if (sectionSize > q->maximumSectionSize()) >- sectionSize = q->maximumSectionSize(); > } >+ sectionSize = qBound(q->minimumSectionSize(), >+ sectionSize, >+ q->maximumSectionSize()); >+ > section_sizes.append(sectionSize); > lengthToStretch -= sectionSize; > } >@@ -3923,7 +4079,7 @@ > QVector<SectionItem> newSectionItems; > for (int u = 0; u < sectionItemsIn.count(); ++u) { > int count = sectionItemsIn.at(u).tmpDataStreamSectionCount; >- if (count > 0) >+ if (count > 1) > sectionItemsIn[u].size /= count; > for (int n = 0; n < count; ++n) > newSectionItems.append(sectionItemsIn[u]);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1611166
: 1473382