YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
flowlayout.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
10/****************************************************************************
11**
12** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
13** Contact: http://www.qt-project.org/legal
14**
15** This file is part of the examples of the Qt Toolkit.
16**
17** $QT_BEGIN_LICENSE:BSD$
18** You may use this file under the terms of the BSD license as follows:
19**
20** "Redistribution and use in source and binary forms, with or without
21** modification, are permitted provided that the following conditions are
22** met:
23** * Redistributions of source code must retain the above copyright
24** notice, this list of conditions and the following disclaimer.
25** * Redistributions in binary form must reproduce the above copyright
26** notice, this list of conditions and the following disclaimer in
27** the documentation and/or other materials provided with the
28** distribution.
29** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
30** of its contributors may be used to endorse or promote products derived
31** from this software without specific prior written permission.
32**
33**
34** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
35** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
36** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
37** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
38** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
39** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
41** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
42** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
43** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
44** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
45**
46** $QT_END_LICENSE$
47**
48****************************************************************************/
49
50#ifndef FLOWLAYOUT_H
51#define FLOWLAYOUT_H
52
53#include <QLayout>
54#include <QRect>
55#include <QStyle>
56#include <yarp/conf/compiler.h>
57
58class FlowLayout : public QLayout
59{
60public:
61 explicit FlowLayout(QWidget *parent, int margin = -1, int hSpacing = -1, int vSpacing = -1);
62 explicit FlowLayout(int margin = -1, int hSpacing = -1, int vSpacing = -1);
64
65 void addItem(QLayoutItem *item) override;
66 int horizontalSpacing() const;
67 int verticalSpacing() const;
68 Qt::Orientations expandingDirections() const override;
69 bool hasHeightForWidth() const override;
70 int heightForWidth(int) const override;
71 int count() const override;
72 QLayoutItem *itemAt(int index) const override;
73 QSize minimumSize() const override;
74 void setGeometry(const QRect &rect) override;
75 QSize sizeHint() const override;
76 QLayoutItem *takeAt(int index) override;
77
78private:
79 int doLayout(const QRect &rect, bool testOnly) const;
80 int smartSpacing(QStyle::PixelMetric pm) const;
81
82 QList<QLayoutItem *> itemList;
83 int m_hSpace;
84 int m_vSpace;
85};
86
87#endif // FLOWLAYOUT_H
Original license follows:
Definition flowlayout.h:59
int horizontalSpacing() const
int verticalSpacing() const
int heightForWidth(int) const override
QLayoutItem * itemAt(int index) const override
QSize minimumSize() const override
bool hasHeightForWidth() const override
int count() const override
QSize sizeHint() const override
void setGeometry(const QRect &rect) override
QLayoutItem * takeAt(int index) override
Qt::Orientations expandingDirections() const override
void addItem(QLayoutItem *item) override