1
/****************************************************************************
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
5
** This file is part of the gui module of the Qt Toolkit.
7
** This file may be distributed under the terms of the Q Public License
8
** as defined by Trolltech AS of Norway and appearing in the file
9
** LICENSE.QPL included in the packaging of this file.
11
** This file may be distributed and/or modified under the terms of the
12
** GNU General Public License version 2 as published by the Free Software
13
** Foundation and appearing in the file LICENSE.GPL included in the
14
** packaging of this file.
16
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
17
** information about Qt Commercial License Agreements.
18
** See http://www.trolltech.com/qpl/ for QPL licensing information.
19
** See http://www.trolltech.com/gpl/ for GPL licensing information.
21
** Contact info@trolltech.com if any conditions of this licensing are
24
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
25
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27
****************************************************************************/
32
#include "QtGui/qlayout.h"
33
#ifdef QT_INCLUDE_COMPAT
34
#include "QtGui/qwidget.h"
41
class QBoxLayoutPrivate;
43
class Q_GUI_EXPORT QBoxLayout : public QLayout
46
Q_DECLARE_PRIVATE(QBoxLayout)
48
enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop,
49
Down = TopToBottom, Up = BottomToTop };
51
explicit QBoxLayout(Direction, QWidget *parent = 0);
54
QT3_SUPPORT_CONSTRUCTOR QBoxLayout(QWidget *parent, Direction, int border = 0, int spacing = -1,
55
const char *name = 0);
56
QT3_SUPPORT_CONSTRUCTOR QBoxLayout(QLayout *parentLayout, Direction, int spacing = -1,
57
const char *name = 0);
58
QT3_SUPPORT_CONSTRUCTOR QBoxLayout(Direction, int spacing, const char *name = 0);
62
Direction direction() const;
63
void setDirection(Direction);
65
void addSpacing(int size);
66
void addStretch(int stretch = 0);
67
void addWidget(QWidget *, int stretch = 0, Qt::Alignment alignment = 0);
68
void addLayout(QLayout *layout, int stretch = 0);
70
void addItem(QLayoutItem *);
72
void insertSpacing(int index, int size);
73
void insertStretch(int index, int stretch = 0);
74
void insertWidget(int index, QWidget *widget, int stretch = 0, Qt::Alignment alignment = 0);
75
void insertLayout(int index, QLayout *layout, int stretch = 0);
77
bool setStretchFactor(QWidget *w, int stretch);
78
bool setStretchFactor(QLayout *l, int stretch);
80
QSize sizeHint() const;
81
QSize minimumSize() const;
82
QSize maximumSize() const;
84
bool hasHeightForWidth() const;
85
int heightForWidth(int) const;
86
int minimumHeightForWidth(int) const;
88
Qt::Orientations expandingDirections() const;
90
QLayoutItem *itemAt(int) const;
91
QLayoutItem *takeAt(int);
93
void setGeometry(const QRect&);
95
inline QT3_SUPPORT int findWidget(QWidget* w) {return indexOf(w);}
98
void insertItem(int index, QLayoutItem *);
101
Q_DISABLE_COPY(QBoxLayout)
104
class Q_GUI_EXPORT QHBoxLayout : public QBoxLayout
109
explicit QHBoxLayout(QWidget *parent);
113
QT3_SUPPORT_CONSTRUCTOR QHBoxLayout(QWidget *parent, int border,
114
int spacing = -1, const char *name = 0);
115
QT3_SUPPORT_CONSTRUCTOR QHBoxLayout(QLayout *parentLayout,
116
int spacing = -1, const char *name = 0);
117
QT3_SUPPORT_CONSTRUCTOR QHBoxLayout(int spacing, const char *name = 0);
121
Q_DISABLE_COPY(QHBoxLayout)
124
class Q_GUI_EXPORT QVBoxLayout : public QBoxLayout
129
explicit QVBoxLayout(QWidget *parent);
133
QT3_SUPPORT_CONSTRUCTOR QVBoxLayout(QWidget *parent, int border,
134
int spacing = -1, const char *name = 0);
135
QT3_SUPPORT_CONSTRUCTOR QVBoxLayout(QLayout *parentLayout,
136
int spacing = -1, const char *name = 0);
137
QT3_SUPPORT_CONSTRUCTOR QVBoxLayout(int spacing, const char *name = 0);
141
Q_DISABLE_COPY(QVBoxLayout)
144
#endif // QT_NO_LAYOUT
146
#endif // QBOXLAYOUT_H