source: trunk/src/gui/graphicsview/qgraphicsgridlayout.h@ 508

Last change on this file since 508 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 5.2 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4** Contact: Qt Software Information ([email protected])
5**
6** This file is part of the QtGui module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial Usage
10** Licensees holding valid Qt Commercial licenses may use this file in
11** accordance with the Qt Commercial License Agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Nokia.
14**
15** GNU Lesser General Public License Usage
16** Alternatively, this file may be used under the terms of the GNU Lesser
17** General Public License version 2.1 as published by the Free Software
18** Foundation and appearing in the file LICENSE.LGPL included in the
19** packaging of this file. Please review the following information to
20** ensure the GNU Lesser General Public License version 2.1 requirements
21** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22**
23** In addition, as a special exception, Nokia gives you certain
24** additional rights. These rights are described in the Nokia Qt LGPL
25** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
26** package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you are unsure which license is appropriate for your use, please
37** contact the sales department at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef QGRAPHICSGRIDLAYOUT_H
43#define QGRAPHICSGRIDLAYOUT_H
44
45#include <QtGui/qgraphicsitem.h>
46#include <QtGui/qgraphicslayout.h>
47
48QT_BEGIN_HEADER
49
50QT_BEGIN_NAMESPACE
51
52QT_MODULE(Gui)
53
54#if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW
55
56class QGraphicsGridLayoutPrivate;
57
58class Q_GUI_EXPORT QGraphicsGridLayout : public QGraphicsLayout
59{
60public:
61 QGraphicsGridLayout(QGraphicsLayoutItem *parent = 0);
62 virtual ~QGraphicsGridLayout();
63
64 void addItem(QGraphicsLayoutItem *item, int row, int column, int rowSpan, int columnSpan,
65 Qt::Alignment alignment = 0);
66 inline void addItem(QGraphicsLayoutItem *item, int row, int column, Qt::Alignment alignment = 0);
67
68 void setHorizontalSpacing(qreal spacing);
69 qreal horizontalSpacing() const;
70 void setVerticalSpacing(qreal spacing);
71 qreal verticalSpacing() const;
72 void setSpacing(qreal spacing);
73
74 void setRowSpacing(int row, qreal spacing);
75 qreal rowSpacing(int row) const;
76 void setColumnSpacing(int column, qreal spacing);
77 qreal columnSpacing(int column) const;
78
79 void setRowStretchFactor(int row, int stretch);
80 int rowStretchFactor(int row) const;
81 void setColumnStretchFactor(int column, int stretch);
82 int columnStretchFactor(int column) const;
83
84 void setRowMinimumHeight(int row, qreal height);
85 qreal rowMinimumHeight(int row) const;
86 void setRowPreferredHeight(int row, qreal height);
87 qreal rowPreferredHeight(int row) const;
88 void setRowMaximumHeight(int row, qreal height);
89 qreal rowMaximumHeight(int row) const;
90 void setRowFixedHeight(int row, qreal height);
91
92 void setColumnMinimumWidth(int column, qreal width);
93 qreal columnMinimumWidth(int column) const;
94 void setColumnPreferredWidth(int column, qreal width);
95 qreal columnPreferredWidth(int column) const;
96 void setColumnMaximumWidth(int column, qreal width);
97 qreal columnMaximumWidth(int column) const;
98 void setColumnFixedWidth(int column, qreal width);
99
100 void setRowAlignment(int row, Qt::Alignment alignment);
101 Qt::Alignment rowAlignment(int row) const;
102 void setColumnAlignment(int column, Qt::Alignment alignment);
103 Qt::Alignment columnAlignment(int column) const;
104
105 void setAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment);
106 Qt::Alignment alignment(QGraphicsLayoutItem *item) const;
107
108 int rowCount() const;
109 int columnCount() const;
110
111 QGraphicsLayoutItem *itemAt(int row, int column) const;
112
113 // inherited from QGraphicsLayout
114 int count() const;
115 QGraphicsLayoutItem *itemAt(int index) const;
116 void removeAt(int index);
117
118 void invalidate();
119
120 // inherited from QGraphicsLayoutItem
121 void setGeometry(const QRectF &rect);
122 QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
123
124 // ####
125 //QRect cellRect(int row, int column, int rowSpan = 1, int columnSpan = 1) const;
126 //QSizePolicy::ControlTypes controlTypes(LayoutSide side) const;
127
128private:
129 Q_DISABLE_COPY(QGraphicsGridLayout)
130 Q_DECLARE_PRIVATE(QGraphicsGridLayout)
131};
132
133inline void QGraphicsGridLayout::addItem(QGraphicsLayoutItem *aitem, int arow, int acolumn, Qt::Alignment aalignment)
134{ addItem(aitem, arow, acolumn, 1, 1, aalignment); }
135
136#endif
137
138QT_END_NAMESPACE
139
140QT_END_HEADER
141
142#endif
143
Note: See TracBrowser for help on using the repository browser.