casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tqlayout.h
Go to the documentation of this file.
1 #ifndef TQFLOWLAYOUT_H
2 #define TQFLOWLAYOUT_H
3 
4 #include <casa/aips.h>
5 
6 #include <graphics/X11/X_enter.h>
7 #include <QLayout>
8 #include <QRect>
9 #include <QWidgetItem>
10 #include <graphics/X11/X_exit.h>
11 
12 
13 namespace casa { //# NAMESPACE CASA - BEGIN
14 
15 
16 
17 class FlowLayout : public QLayout
18  {
19  public:
20  FlowLayout(QWidget *parent, int margin = 0, int spacing = -1);
21  FlowLayout(int spacing = -1);
22  ~FlowLayout();
23 
24  void addItem(QLayoutItem *item);
25  Qt::Orientations expandingDirections() const;
26  bool hasHeightForWidth() const;
27  int heightForWidth(int) const;
28  int count() const;
29  QLayoutItem *itemAt(int index) const;
30  QSize minimumSize() const;
31  void setGeometry(const QRect &rect);
32  QSize sizeHint() const;
33  QLayoutItem *takeAt(int index);
34 
35  private:
36  int doLayout(const QRect &rect, bool testOnly) const;
37 
38  QList<QLayoutItem *> itemList;
39 };
40 
41 
42 class BorderLayout : public QLayout
43 {
44 public:
46 
47  BorderLayout(QWidget *parent, int margin = 0, int spacing = -1);
48  BorderLayout(int spacing = -1);
49  ~BorderLayout();
50 
51  void addItem(QLayoutItem *item);
52  void addWidget(QWidget *widget, Position position);
53  Qt::Orientations expandingDirections() const;
54  bool hasHeightForWidth() const;
55  int count() const;
56  QLayoutItem *itemAt(int index) const;
57  QSize minimumSize() const;
58  void setGeometry(const QRect &rect);
59  QSize sizeHint() const;
60  QLayoutItem *takeAt(int index);
61 
62  void add(QLayoutItem *item, Position position);
63 
64 private:
65  struct ItemWrapper
66  {
67  ItemWrapper(QLayoutItem *i, Position p) {
68  item = i;
69  position = p;
70  }
71 
72  QLayoutItem *item;
74  };
75 
77  QSize calculateSize(SizeType sizeType) const;
78 
79  QList<ItemWrapper *> list;
80 };
81 
82 } //# NAMESPACE CASA - END
83 
84 #endif
int heightForWidth(int) const
void setGeometry(const QRect &rect)
void addWidget(QWidget *widget, Position position)
ItemWrapper(QLayoutItem *i, Position p)
Definition: tqlayout.h:67
QLayoutItem * takeAt(int index)
bool hasHeightForWidth() const
int count() const
void addItem(QLayoutItem *item)
QSize sizeHint() const
QList< QLayoutItem * > itemList
Definition: tqlayout.h:38
Qt::Orientations expandingDirections() const
int doLayout(const QRect &rect, bool testOnly) const
BorderLayout(QWidget *parent, int margin=0, int spacing=-1)
void addItem(QLayoutItem *item)
void setGeometry(const QRect &rect)
QLayoutItem * itemAt(int index) const
Qt::Orientations expandingDirections() const
QLayoutItem * takeAt(int index)
FlowLayout(QWidget *parent, int margin=0, int spacing=-1)
QLayoutItem * itemAt(int index) const
int count() const
QSize minimumSize() const
bool hasHeightForWidth() const
QSize sizeHint() const
QList< ItemWrapper * > list
Definition: tqlayout.h:79
QSize minimumSize() const
QSize calculateSize(SizeType sizeType) const
void add(QLayoutItem *item, Position position)