diff options
author | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-08-27 07:30:32 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-08-27 08:24:08 (GMT) |
commit | 574fcf93bd5420a7e668466259de5c89b485fef2 (patch) | |
tree | efc70f16e85fe94e3618818f64ab90c1700d5884 /src/gui/graphicsview/qgraphicslinearlayout.cpp | |
parent | 35dbf37c70cd27494e9463b7b75c83ad7a671f1e (diff) | |
download | Qt-574fcf93bd5420a7e668466259de5c89b485fef2.zip Qt-574fcf93bd5420a7e668466259de5c89b485fef2.tar.gz Qt-574fcf93bd5420a7e668466259de5c89b485fef2.tar.bz2 |
Make sure itemAt() reflects the visual order.
This means it should respect the order that was defined with
insertItem() and addItem().
Note that this is not strictly necessary (as now explicitly written in
the docs for QGraphicsLayout::itemAt()), but commit
2ec56d158dc140f68efb45e2e0613f0e4026ddf6 broke the order and for people
that relied on this that commit caused a regression.
In addition, after commit 2ec56d158dc140f68efb45e2e0613f0e4026ddf6 it
was not longer possible to query the "item at visual index". Thus,
instead of adding another function (like QGGL::itemAt(int,int)) we make
sure that itemAt() also returns the "item at visual index".
Diffstat (limited to 'src/gui/graphicsview/qgraphicslinearlayout.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicslinearlayout.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicslinearlayout.cpp b/src/gui/graphicsview/qgraphicslinearlayout.cpp index 185780a..1b271e5 100644 --- a/src/gui/graphicsview/qgraphicslinearlayout.cpp +++ b/src/gui/graphicsview/qgraphicslinearlayout.cpp @@ -277,7 +277,7 @@ void QGraphicsLinearLayout::insertItem(int index, QGraphicsLayoutItem *item) Q_ASSERT(item); d->fixIndex(&index); d->engine.insertRow(index, d->orientation); - new QGridLayoutItem(&d->engine, item, d->gridRow(index), d->gridColumn(index)); + new QGridLayoutItem(&d->engine, item, d->gridRow(index), d->gridColumn(index), 1, 1, 0, index); invalidate(); } @@ -471,6 +471,7 @@ int QGraphicsLinearLayout::count() const /*! \reimp + When iterating from 0 and up, it will return the items in the visual arranged order. */ QGraphicsLayoutItem *QGraphicsLinearLayout::itemAt(int index) const { |