[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: klfflowlayout.h 962 2016-12-27 10:25:56Z phfaist $ */
23 
24 #ifndef KLFFLOWLAYOUT_H
25 #define KLFFLOWLAYOUT_H
26 
27 #include <QLayout>
28 #include <QWidget>
29 #include <QLayoutItem>
30 
31 
32 struct KLFFlowLayoutPrivate;
33 
34 
38 class 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 
47 public:
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);
72  virtual Qt::Orientations expandingDirections() const;
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 
86 public slots:
87  void clearAll(bool deleteItems = true);
88  void setHorizontalSpacing(int spacing);
89  void setVerticalSpacing(int spacing);
90  void setFlush(Flush f);
91 
92 private:
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:38
int horizontalSpacing() const
virtual void addWidget(QWidget *w, int hstretch=0, int vstretch=0, Qt::Alignment align=0)
virtual ~KLFFlowLayout()
virtual void addLayout(QLayout *l, int hstretch=0, int vstretch=0)
virtual bool event(QEvent *event)
void setHorizontalSpacing(int spacing)
Distribute the extra space inbetween the widgets to fill the line.
Definition: klfflowlayout.h:51
void setVerticalSpacing(int spacing)
virtual QLayoutItem * itemAt(int index) const
int verticalSpacing() const
virtual int heightForWidth(int width) const
virtual bool eventFilter(QObject *obj, QEvent *event)
virtual int count() const
Leave all extra space at end of line.
Definition: klfflowlayout.h:52
typedef Alignment
virtual bool hasHeightForWidth() const
void setFlush(Flush f)
Flush flush() const
virtual QSize maximumSize() const
virtual void invalidate()
KLFFlowLayout(QWidget *parent, int margin=-1, int hspacing=-1, int vspacing=-1)
Leave all extra space at beginning of line.
Definition: klfflowlayout.h:53
virtual Qt::Orientations expandingDirections() const
virtual QLayoutItem * takeAt(int index)
virtual QSize minimumSize() const
virtual QSize sizeHint() const
typedef Orientations
void setGeometry(const QRect &rect)
virtual void addItem(QLayoutItem *item)
Definition: klfflowlayout.h:61
Give the extra space to the widgets to stretch, don&#39;t flush.
Definition: klfflowlayout.h:50
void clearAll(bool deleteItems=true)

Generated by doxygen 1.8.13