ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
flowlayout.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <QLayout>
11 #include <QRect>
12 #include <QStyle>
13 
14 #include "../qPCL.h"
15 
16 class QPCL_ENGINE_LIB_API FlowLayout : public QLayout {
17 public:
18  explicit FlowLayout(QWidget *parent,
19  int margin = -1,
20  int hSpacing = -1,
21  int vSpacing = -1);
22  explicit FlowLayout(int margin = -1, int hSpacing = -1, int vSpacing = -1);
23  ~FlowLayout();
24 
25  void clear();
26  void addItem(QLayoutItem *item) Q_DECL_OVERRIDE;
27  int horizontalSpacing() const;
28  int verticalSpacing() const;
29  Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE;
30  bool hasHeightForWidth() const Q_DECL_OVERRIDE;
31  int heightForWidth(int) const Q_DECL_OVERRIDE;
32  int count() const Q_DECL_OVERRIDE;
33  QLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE;
34  QSize minimumSize() const Q_DECL_OVERRIDE;
35  void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
36  QSize sizeHint() const Q_DECL_OVERRIDE;
37  QLayoutItem *takeAt(int index) Q_DECL_OVERRIDE;
38 
39 private:
40  int doLayout(const QRect &rect, bool testOnly) const;
41  int smartSpacing(QStyle::PixelMetric pm) const;
42 
43  QList<QLayoutItem *> itemList;
44  int m_hSpace;
45  int m_vSpace;
46 };
int count
#define Q_DECL_OVERRIDE
Definition: qcustomplot.h:130
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15