kexi
kexiflowlayout.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KEXIFLOWLAYOUT_H
00021 #define KEXIFLOWLAYOUT_H
00022
00023 #include <qlayout.h>
00024 #include <qptrlist.h>
00025
00027 class KEXIGUIUTILS_EXPORT KexiFlowLayout : public QLayout
00028 {
00029 public:
00030 KexiFlowLayout(QWidget *parent, int border=0, int space=-1, const char *name=0);
00031 KexiFlowLayout(QLayout* parent, int space=-1, const char *name=0);
00032 KexiFlowLayout(int space=-1, const char *name=0);
00033
00034 ~KexiFlowLayout();
00035
00038 QPtrList<QWidget>* widgetList() const;
00039
00041 void setOrientation(Orientation orientation) { m_orientation = orientation; }
00042
00044 Qt::Orientation orientation() const { return m_orientation; }
00045
00046 void setJustified(bool justify) { m_justify = justify; }
00047 bool isJustified() const { return m_justify; }
00048
00049 virtual void addItem(QLayoutItem *item);
00050 virtual void addSpacing(int size);
00051 virtual QLayoutIterator iterator();
00052 virtual void invalidate();
00053
00054 virtual bool hasHeightForWidth() const;
00055 virtual int heightForWidth(int width) const;
00056 virtual QSize sizeHint() const;
00057 virtual QSize minimumSize() const;
00058 virtual QSizePolicy::ExpandData expanding() const;
00059
00060 virtual bool isEmpty();
00061
00062 protected:
00063 virtual void setGeometry(const QRect&);
00064 int simulateLayout(const QRect &r);
00065 int doHorizontalLayout(const QRect&, bool testonly = false);
00066 int doVerticalLayout(const QRect&, bool testonly = false);
00067
00068 private:
00069 QPtrList<QLayoutItem> m_list;
00070 int m_cached_width;
00071 int m_cached_hfw;
00072 bool m_justify;
00073 Orientation m_orientation;
00074 QSize m_cached_sizeHint;
00075 QSize m_cached_minSize;
00076 };
00077
00078 #endif
00079
|