QHeaderView: rename private 'offset' to avoid clash with QAIVP::offset()
QAIVP has a function named 'offset()' which is hidden by QHVP::offset variable. Therefore rename the QHVP::offset to headerOffset Pick-to: 6.6 6.5 Change-Id: Iadb18b8f18197925daa72af243483a044c1d94e7 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit 15884aba8fc697ce3c2b9b5f7dea14093f037f03) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
36f01b7f56
commit
13198306c8
@ -387,7 +387,7 @@ Qt::Orientation QHeaderView::orientation() const
|
|||||||
int QHeaderView::offset() const
|
int QHeaderView::offset() const
|
||||||
{
|
{
|
||||||
Q_D(const QHeaderView);
|
Q_D(const QHeaderView);
|
||||||
return d->offset;
|
return d->headerOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -401,10 +401,10 @@ int QHeaderView::offset() const
|
|||||||
void QHeaderView::setOffset(int newOffset)
|
void QHeaderView::setOffset(int newOffset)
|
||||||
{
|
{
|
||||||
Q_D(QHeaderView);
|
Q_D(QHeaderView);
|
||||||
if (d->offset == (int)newOffset)
|
if (d->headerOffset == newOffset)
|
||||||
return;
|
return;
|
||||||
int ndelta = d->offset - newOffset;
|
int ndelta = d->headerOffset - newOffset;
|
||||||
d->offset = newOffset;
|
d->headerOffset = newOffset;
|
||||||
if (d->orientation == Qt::Horizontal)
|
if (d->orientation == Qt::Horizontal)
|
||||||
d->viewport->scroll(isRightToLeft() ? -ndelta : ndelta, 0);
|
d->viewport->scroll(isRightToLeft() ? -ndelta : ndelta, 0);
|
||||||
else
|
else
|
||||||
@ -560,7 +560,7 @@ int QHeaderView::visualIndexAt(int position) const
|
|||||||
|
|
||||||
if (d->reverse())
|
if (d->reverse())
|
||||||
vposition = d->viewport->width() - vposition - 1;
|
vposition = d->viewport->width() - vposition - 1;
|
||||||
vposition += d->offset;
|
vposition += d->headerOffset;
|
||||||
|
|
||||||
if (vposition > d->length)
|
if (vposition > d->length)
|
||||||
return -1;
|
return -1;
|
||||||
@ -650,7 +650,7 @@ int QHeaderView::sectionViewportPosition(int logicalIndex) const
|
|||||||
int position = sectionPosition(logicalIndex);
|
int position = sectionPosition(logicalIndex);
|
||||||
if (position < 0)
|
if (position < 0)
|
||||||
return position; // the section was hidden
|
return position; // the section was hidden
|
||||||
int offsetPosition = position - d->offset;
|
int offsetPosition = position - d->headerOffset;
|
||||||
if (d->reverse())
|
if (d->reverse())
|
||||||
return d->viewport->width() - (offsetPosition + sectionSize(logicalIndex));
|
return d->viewport->width() - (offsetPosition + sectionSize(logicalIndex));
|
||||||
return offsetPosition;
|
return offsetPosition;
|
||||||
@ -2493,9 +2493,9 @@ void QHeaderView::paintEvent(QPaintEvent *e)
|
|||||||
for (int a = 0, i = 0; i < d->sectionItems.count(); ++i) {
|
for (int a = 0, i = 0; i < d->sectionItems.count(); ++i) {
|
||||||
QColor color((i & 4 ? 255 : 0), (i & 2 ? 255 : 0), (i & 1 ? 255 : 0));
|
QColor color((i & 4 ? 255 : 0), (i & 2 ? 255 : 0), (i & 1 ? 255 : 0));
|
||||||
if (d->orientation == Qt::Horizontal)
|
if (d->orientation == Qt::Horizontal)
|
||||||
painter.fillRect(a - d->offset, 0, d->sectionItems.at(i).size, 4, color);
|
painter.fillRect(a - d->headerOffset, 0, d->sectionItems.at(i).size, 4, color);
|
||||||
else
|
else
|
||||||
painter.fillRect(0, a - d->offset, 4, d->sectionItems.at(i).size, color);
|
painter.fillRect(0, a - d->headerOffset, 4, d->sectionItems.at(i).size, color);
|
||||||
a += d->sectionItems.at(i).size;
|
a += d->sectionItems.at(i).size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2597,7 +2597,7 @@ void QHeaderView::mouseMoveEvent(QMouseEvent *e)
|
|||||||
if (visual == 0 && logicalIndex(0) == 0 && !d->allowUserMoveOfSection0)
|
if (visual == 0 && logicalIndex(0) == 0 && !d->allowUserMoveOfSection0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const int posThreshold = d->headerSectionPosition(visual) - d->offset + d->headerSectionSize(visual) / 2;
|
const int posThreshold = d->headerSectionPosition(visual) - d->headerOffset + d->headerSectionSize(visual) / 2;
|
||||||
const int checkPos = d->reverse() ? d->viewport->width() - pos : pos;
|
const int checkPos = d->reverse() ? d->viewport->width() - pos : pos;
|
||||||
int moving = visualIndex(d->section);
|
int moving = visualIndex(d->section);
|
||||||
int oldTarget = d->target;
|
int oldTarget = d->target;
|
||||||
@ -2621,7 +2621,7 @@ void QHeaderView::mouseMoveEvent(QMouseEvent *e)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case QHeaderViewPrivate::SelectSections: {
|
case QHeaderViewPrivate::SelectSections: {
|
||||||
int logical = logicalIndexAt(qMax(-d->offset, pos));
|
int logical = logicalIndexAt(qMax(-d->headerOffset, pos));
|
||||||
if (logical == -1 && pos > 0)
|
if (logical == -1 && pos > 0)
|
||||||
logical = logicalIndex(d->lastVisibleVisualIndex());
|
logical = logicalIndex(d->lastVisibleVisualIndex());
|
||||||
if (logical == d->pressed)
|
if (logical == d->pressed)
|
||||||
@ -3043,7 +3043,7 @@ int QHeaderView::horizontalOffset() const
|
|||||||
{
|
{
|
||||||
Q_D(const QHeaderView);
|
Q_D(const QHeaderView);
|
||||||
if (d->orientation == Qt::Horizontal)
|
if (d->orientation == Qt::Horizontal)
|
||||||
return d->offset;
|
return d->headerOffset;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3058,7 +3058,7 @@ int QHeaderView::verticalOffset() const
|
|||||||
{
|
{
|
||||||
Q_D(const QHeaderView);
|
Q_D(const QHeaderView);
|
||||||
if (d->orientation == Qt::Vertical)
|
if (d->orientation == Qt::Vertical)
|
||||||
return d->offset;
|
return d->headerOffset;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ public:
|
|||||||
|
|
||||||
QHeaderViewPrivate()
|
QHeaderViewPrivate()
|
||||||
: state(NoState),
|
: state(NoState),
|
||||||
offset(0),
|
headerOffset(0),
|
||||||
sortIndicatorOrder(Qt::DescendingOrder),
|
sortIndicatorOrder(Qt::DescendingOrder),
|
||||||
sortIndicatorSection(0),
|
sortIndicatorSection(0),
|
||||||
sortIndicatorShown(false),
|
sortIndicatorShown(false),
|
||||||
@ -232,7 +232,7 @@ public:
|
|||||||
|
|
||||||
enum State { NoState, ResizeSection, MoveSection, SelectSections, NoClear } state;
|
enum State { NoState, ResizeSection, MoveSection, SelectSections, NoClear } state;
|
||||||
|
|
||||||
int offset;
|
int headerOffset;
|
||||||
Qt::Orientation orientation;
|
Qt::Orientation orientation;
|
||||||
Qt::SortOrder sortIndicatorOrder;
|
Qt::SortOrder sortIndicatorOrder;
|
||||||
int sortIndicatorSection;
|
int sortIndicatorSection;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user