Marlin  1.17.1
 All Classes Namespaces Functions Variables Enumerations Friends Pages
flowlayout.h
1 /****************************************************************************
2 **
3 ** Copyright (C) 2004-2006 Trolltech ASA. All rights reserved.
4 **
5 ** This file is part of the example classes of the Qt Toolkit.
6 **
7 ** This file may be used under the terms of the GNU General Public
8 ** License version 2.0 as published by the Free Software Foundation
9 ** and appearing in the file LICENSE.GPL included in the packaging of
10 ** this file. Please review the following information to ensure GNU
11 ** General Public Licensing requirements will be met:
12 ** http://www.trolltech.com/products/qt/opensource.html
13 **
14 ** If you are unsure which license is appropriate for your use, please
15 ** review the following information:
16 ** http://www.trolltech.com/products/qt/licensing.html or contact the
17 ** sales department at sales@trolltech.com.
18 **
19 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21 **
22 ****************************************************************************/
23 
24 #ifndef FLOWLAYOUT_H
25 #define FLOWLAYOUT_H
26 
27 #include <QLayout>
28 #include <QRect>
29 #include <QWidgetItem>
30 
31 class FlowLayout : public QLayout
32 {
33 public:
34  FlowLayout(QWidget *parent, int margin = 0, int spacing = -1);
35  FlowLayout(int spacing = -1);
36  ~FlowLayout();
37 
38  void addItem(QLayoutItem *item);
39  Qt::Orientations expandingDirections() const;
40  bool hasHeightForWidth() const;
41  int heightForWidth(int) const;
42  int count() const;
43  QLayoutItem *itemAt(int index) const;
44  QSize minimumSize() const;
45  void setGeometry(const QRect &rect);
46  QSize sizeHint() const;
47  QLayoutItem *takeAt(int index);
48 
49 private:
50  int doLayout(const QRect &rect, bool testOnly) const;
51 
52  QList<QLayoutItem *> itemList{};
53 };
54 
55 #endif
Definition: flowlayout.h:31