Make QGridLayout::getItemPosition() const.

This commit addresses a long-standing Qt 5 to-do. Whilst a trivial
change, it is binary incompatible.

Task-number: QTBUG-1433
Change-Id: I6e31e47fd5791cb6f1373e2696ffc95f7174f0b0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
Jason McDonald 2012-03-27 01:05:41 +10:00 committed by Qt by Nokia
parent 15e9b77cac
commit 6a1d1165c2
2 changed files with 5 additions and 5 deletions

View File

@ -167,9 +167,9 @@ public:
return item;
}
void getItemPosition(int index, int *row, int *column, int *rowSpan, int *columnSpan) {
void getItemPosition(int index, int *row, int *column, int *rowSpan, int *columnSpan) const {
if (index < things.count()) {
QGridBox *b = things.at(index);
const QGridBox *b = things.at(index);
int toRow = b->toRow(rr);
int toCol = b->toCol(cc);
*row = b->row;
@ -1347,9 +1347,9 @@ QLayoutItem *QGridLayout::takeAt(int index)
\sa itemAtPosition(), itemAt()
*/
void QGridLayout::getItemPosition(int index, int *row, int *column, int *rowSpan, int *columnSpan)
void QGridLayout::getItemPosition(int index, int *row, int *column, int *rowSpan, int *columnSpan) const
{
Q_D(QGridLayout);
Q_D(const QGridLayout);
d->getItemPosition(index, row, column, rowSpan, columnSpan);
}

View File

@ -120,7 +120,7 @@ public:
void addItem(QLayoutItem *item, int row, int column, int rowSpan = 1, int columnSpan = 1, Qt::Alignment = 0);
void setDefaultPositioning(int n, Qt::Orientation orient);
void getItemPosition(int idx, int *row, int *column, int *rowSpan, int *columnSpan);
void getItemPosition(int idx, int *row, int *column, int *rowSpan, int *columnSpan) const;
protected:
void addItem(QLayoutItem *);