summaryrefslogtreecommitdiffstats
path: root/examples/layouts/flowlayout/flowlayout.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/layouts/flowlayout/flowlayout.h')
-rw-r--r--examples/layouts/flowlayout/flowlayout.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/examples/layouts/flowlayout/flowlayout.h b/examples/layouts/flowlayout/flowlayout.h
index f864d8e..bab7f36 100644
--- a/examples/layouts/flowlayout/flowlayout.h
+++ b/examples/layouts/flowlayout/flowlayout.h
@@ -45,15 +45,17 @@
#include <QLayout>
#include <QRect>
#include <QWidgetItem>
-
+//! [0]
class FlowLayout : public QLayout
{
public:
- FlowLayout(QWidget *parent, int margin = -1, int spacing = 0);
- FlowLayout(int spacing = 0);
+ FlowLayout(QWidget *parent, int margin = -1, int hSpacing = -1, int vSpacing = -1);
+ FlowLayout(int margin = -1, int hSpacing = -1, int vSpacing = -1);
~FlowLayout();
void addItem(QLayoutItem *item);
+ int horizontalSpacing() const;
+ int verticalSpacing() const;
Qt::Orientations expandingDirections() const;
bool hasHeightForWidth() const;
int heightForWidth(int) const;
@@ -66,8 +68,12 @@ public:
private:
int doLayout(const QRect &rect, bool testOnly) const;
+ int smartSpacing(QStyle::PixelMetric pm) const;
QList<QLayoutItem *> itemList;
+ int m_hSpace;
+ int m_vSpace;
};
+//! [0]
#endif