summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgridlayoutengine_p.h
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2009-08-27 07:30:32 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2009-08-27 08:24:08 (GMT)
commit574fcf93bd5420a7e668466259de5c89b485fef2 (patch)
treeefc70f16e85fe94e3618818f64ab90c1700d5884 /src/gui/graphicsview/qgridlayoutengine_p.h
parent35dbf37c70cd27494e9463b7b75c83ad7a671f1e (diff)
downloadQt-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/qgridlayoutengine_p.h')
-rw-r--r--src/gui/graphicsview/qgridlayoutengine_p.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgridlayoutengine_p.h b/src/gui/graphicsview/qgridlayoutengine_p.h
index 8f3eb13..aab695a 100644
--- a/src/gui/graphicsview/qgridlayoutengine_p.h
+++ b/src/gui/graphicsview/qgridlayoutengine_p.h
@@ -267,7 +267,8 @@ class QGridLayoutItem
{
public:
QGridLayoutItem(QGridLayoutEngine *engine, QGraphicsLayoutItem *layoutItem, int row, int column,
- int rowSpan = 1, int columnSpan = 1, Qt::Alignment alignment = 0);
+ int rowSpan = 1, int columnSpan = 1, Qt::Alignment alignment = 0,
+ int itemAtIndex = -1);
inline int firstRow() const { return q_firstRows[Ver]; }
inline int firstColumn() const { return q_firstRows[Hor]; }
@@ -378,6 +379,7 @@ public:
Qt::Alignment effectiveAlignment(const QGridLayoutItem *layoutItem) const;
+ void insertItem(QGridLayoutItem *item, int index);
void addItem(QGridLayoutItem *item);
void removeItem(QGridLayoutItem *item);
QGridLayoutItem *findLayoutItem(QGraphicsLayoutItem *layoutItem) const;