[KLF Backend][KLF Tools][KLF Home]
KLatexFormula Project
klfflowlayout.h
Go to the documentation of this file.
1/***************************************************************************
2 * file klfflowlayout.h
3 * This file is part of the KLatexFormula Project.
4 * Copyright (C) 2011 by Philippe Faist
5 * philippe.faist at bluewin.ch
6 * *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program; if not, write to the *
19 * Free Software Foundation, Inc., *
20 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21 ***************************************************************************/
22/* $Id$ */
23
24#ifndef KLFFLOWLAYOUT_H
25#define KLFFLOWLAYOUT_H
26
27#include <QLayout>
28#include <QWidget>
29#include <QLayoutItem>
30
31
32struct KLFFlowLayoutPrivate;
33
34
38class KLFFlowLayout : public QLayout
39{
40 Q_OBJECT
41
42 Q_ENUMS(Flush)
43 Q_PROPERTY(Flush flush READ flush WRITE setFlush) ;
45 Q_PROPERTY(int verticalSpacing READ verticalSpacing WRITE setVerticalSpacing) ;
46
47public:
49 enum Flush {
50 NoFlush = 0,
54 };
55
56 KLFFlowLayout(QWidget *parent, int margin = -1, int hspacing = -1, int vspacing = -1);
57 virtual ~KLFFlowLayout();
58
61 virtual void addItem(QLayoutItem *item)
62 { addItem(item, 0, 0); }
63 virtual void addItem(QLayoutItem *item, int hstretch, int vstretch);
64 virtual void addLayout(QLayout *l, int hstretch = 0, int vstretch = 0);
65 virtual void addWidget(QWidget *w, int hstretch = 0, int vstretch = 0, Qt::Alignment align = 0);
66 int horizontalSpacing() const;
67 int verticalSpacing() const;
68 Flush flush() const;
69 virtual int count() const;
70 virtual QLayoutItem *itemAt(int index) const;
71 virtual QLayoutItem *takeAt(int index);
73 virtual bool hasHeightForWidth() const;
74 virtual int heightForWidth(int width) const;
75 virtual QSize minimumSize() const;
76 virtual QSize maximumSize() const;
77 virtual QSize sizeHint() const;
78
79 void setGeometry(const QRect &rect);
80
81 virtual void invalidate();
82
83 virtual bool event(QEvent *event);
84 virtual bool eventFilter(QObject *obj, QEvent *event);
85
86public slots:
87 void clearAll(bool deleteItems = true);
88 void setHorizontalSpacing(int spacing);
89 void setVerticalSpacing(int spacing);
90 void setFlush(Flush f);
91
92private:
93
94 KLFFlowLayoutPrivate *d;
95};
96
97
98
99
100
101
102
103#endif
A Layout that places widgets left to right, top to bottom.
Definition: klfflowlayout.h:39
virtual int heightForWidth(int width) const
virtual QSize minimumSize() const
virtual int count() const
virtual QLayoutItem * itemAt(int index) const
virtual void invalidate()
virtual QLayoutItem * takeAt(int index)
void clearAll(bool deleteItems=true)
virtual QSize maximumSize() const
virtual void addWidget(QWidget *w, int hstretch=0, int vstretch=0, Qt::Alignment align=0)
virtual void addItem(QLayoutItem *item)
Definition: klfflowlayout.h:61
virtual QSize sizeHint() const
virtual bool hasHeightForWidth() const
void setGeometry(const QRect &rect)
void setFlush(Flush f)
virtual void addLayout(QLayout *l, int hstretch=0, int vstretch=0)
@ FlushEnd
Leave all extra space at beginning of line.
Definition: klfflowlayout.h:53
@ NoFlush
Give the extra space to the widgets to stretch, don't flush.
Definition: klfflowlayout.h:50
@ FlushSparse
Distribute the extra space inbetween the widgets to fill the line.
Definition: klfflowlayout.h:51
@ FlushBegin
Leave all extra space at end of line.
Definition: klfflowlayout.h:52
virtual bool eventFilter(QObject *obj, QEvent *event)
virtual Qt::Orientations expandingDirections() const
virtual bool event(QEvent *event)
void setVerticalSpacing(int spacing)
void setHorizontalSpacing(int spacing)
virtual ~KLFFlowLayout()
typedef Alignment
typedef Orientations

Generated by doxygen 1.9.5