Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef QBOXLAYOUT_H
00043 #define QBOXLAYOUT_H
00044
00045 #include <QtGui/qlayout.h>
00046 #ifdef QT_INCLUDE_COMPAT
00047 #include <QtGui/qwidget.h>
00048 #endif
00049
00050 #include <limits.h>
00051
00052 QT_BEGIN_HEADER
00053
00054 QT_BEGIN_NAMESPACE
00055
00056 QT_MODULE(Gui)
00057
00058 class QBoxLayoutPrivate;
00059
00060 class Q_GUI_EXPORT QBoxLayout : public QLayout
00061 {
00062 Q_OBJECT
00063 Q_DECLARE_PRIVATE(QBoxLayout)
00064 public:
00065 enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop,
00066 Down = TopToBottom, Up = BottomToTop };
00067
00068 explicit QBoxLayout(Direction, QWidget *parent = 0);
00069
00070 #ifdef QT3_SUPPORT
00071 QT3_SUPPORT_CONSTRUCTOR QBoxLayout(QWidget *parent, Direction, int border = 0, int spacing = -1,
00072 const char *name = 0);
00073 QT3_SUPPORT_CONSTRUCTOR QBoxLayout(QLayout *parentLayout, Direction, int spacing = -1,
00074 const char *name = 0);
00075 QT3_SUPPORT_CONSTRUCTOR QBoxLayout(Direction, int spacing, const char *name = 0);
00076 #endif
00077 ~QBoxLayout();
00078
00079 Direction direction() const;
00080 void setDirection(Direction);
00081
00082 void addSpacing(int size);
00083 void addStretch(int stretch = 0);
00084 void addSpacerItem(QSpacerItem *spacerItem);
00085 void addWidget(QWidget *, int stretch = 0, Qt::Alignment alignment = 0);
00086 void addLayout(QLayout *layout, int stretch = 0);
00087 void addStrut(int);
00088 void addItem(QLayoutItem *);
00089
00090 void insertSpacing(int index, int size);
00091 void insertStretch(int index, int stretch = 0);
00092 void insertSpacerItem(int index, QSpacerItem *spacerItem);
00093 void insertWidget(int index, QWidget *widget, int stretch = 0, Qt::Alignment alignment = 0);
00094 void insertLayout(int index, QLayout *layout, int stretch = 0);
00095
00096 int spacing() const;
00097 void setSpacing(int spacing);
00098
00099 bool setStretchFactor(QWidget *w, int stretch);
00100 bool setStretchFactor(QLayout *l, int stretch);
00101 void setStretch(int index, int stretch);
00102 int stretch(int index) const;
00103
00104 QSize sizeHint() const;
00105 QSize minimumSize() const;
00106 QSize maximumSize() const;
00107
00108 bool hasHeightForWidth() const;
00109 int heightForWidth(int) const;
00110 int minimumHeightForWidth(int) const;
00111
00112 Qt::Orientations expandingDirections() const;
00113 void invalidate();
00114 QLayoutItem *itemAt(int) const;
00115 QLayoutItem *takeAt(int);
00116 int count() const;
00117 void setGeometry(const QRect&);
00118 #ifdef QT3_SUPPORT
00119 inline QT3_SUPPORT int findWidget(QWidget* w) {return indexOf(w);}
00120 #endif
00121 protected:
00122
00123 void insertItem(int index, QLayoutItem *);
00124
00125 private:
00126 Q_DISABLE_COPY(QBoxLayout)
00127 };
00128
00129 class Q_GUI_EXPORT QHBoxLayout : public QBoxLayout
00130 {
00131 Q_OBJECT
00132 public:
00133 QHBoxLayout();
00134 explicit QHBoxLayout(QWidget *parent);
00135 ~QHBoxLayout();
00136
00137 #ifdef QT3_SUPPORT
00138 QT3_SUPPORT_CONSTRUCTOR QHBoxLayout(QWidget *parent, int border,
00139 int spacing = -1, const char *name = 0);
00140 QT3_SUPPORT_CONSTRUCTOR QHBoxLayout(QLayout *parentLayout,
00141 int spacing = -1, const char *name = 0);
00142 QT3_SUPPORT_CONSTRUCTOR QHBoxLayout(int spacing, const char *name = 0);
00143 #endif
00144
00145 private:
00146 Q_DISABLE_COPY(QHBoxLayout)
00147 };
00148
00149 class Q_GUI_EXPORT QVBoxLayout : public QBoxLayout
00150 {
00151 Q_OBJECT
00152 public:
00153 QVBoxLayout();
00154 explicit QVBoxLayout(QWidget *parent);
00155 ~QVBoxLayout();
00156
00157 #ifdef QT3_SUPPORT
00158 QT3_SUPPORT_CONSTRUCTOR QVBoxLayout(QWidget *parent, int border,
00159 int spacing = -1, const char *name = 0);
00160 QT3_SUPPORT_CONSTRUCTOR QVBoxLayout(QLayout *parentLayout,
00161 int spacing = -1, const char *name = 0);
00162 QT3_SUPPORT_CONSTRUCTOR QVBoxLayout(int spacing, const char *name = 0);
00163 #endif
00164
00165 private:
00166 Q_DISABLE_COPY(QVBoxLayout)
00167 };
00168
00169 QT_END_NAMESPACE
00170
00171 QT_END_HEADER
00172
00173 #endif // QBOXLAYOUT_H