Tianchi  v0.0.2 build 20130701
C++ library for Qt with VC & mingW
tcflowlayout.h
1 // **************************************************************************
2 // Tianchi C++ library for Qt (open source)
3 // 天池共享源码库
4 // 版权所有 (C) Qt Project
5 // 授权协议:LGPL
6 // **************************************************************************
7 // 文档说明:流式布局FlowLayout
8 // ==========================================================================
9 // 开发日志:
10 // 日期 人员 说明
11 // --------------------------------------------------------------------------
12 // 2013.04.21 XChinux 修改自Qt examples&demos里的flowlayout示例
13 //
14 // ==========================================================================
16 // ==========================================================================
17 #ifndef TIANCHI_TCFLOWLAYOUT_H
18 #define TIANCHI_TCFLOWLAYOUT_H
19 
20 #include <tianchi/tcglobal.h>
21 #include <QLayout>
22 
23 class TcFlowLayoutPrivate;
24 
26 class TIANCHI_API TcFlowLayout : public QLayout
27 {
28 public:
29  TcFlowLayout(QWidget *parent, int margin = -1, int hSpacing = -1,
30  int vSpacing = -1);
31  TcFlowLayout(int margin = -1, int hSpacing = -1, int vSpacing = -1);
32  virtual ~TcFlowLayout();
33 
34  void addItem(QLayoutItem *item);
35  int horizontalSpacing() const;
36  int verticalSpacing() const;
37  Qt::Orientations expandingDirections() const;
38  bool hasHeightForWidth() const;
39  int heightForWidth(int) const;
40  int count() const;
41  QLayoutItem *itemAt(int index) const;
42  QSize minimumSize() const;
43  void setGeometry(const QRect &rect);
44  QSize sizeHint() const;
45  QLayoutItem *takeAt(int index);
46 
47 private:
48  Q_DISABLE_COPY(TcFlowLayout)
49  Q_DECLARE_PRIVATE(TcFlowLayout)
50  TcFlowLayoutPrivate* const d_ptr;
51 };
52 
53 #endif