2
* Copyright (c) 2006 Sean C. Rhea (srhea@srhea.net)
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the Free
6
* Software Foundation; either version 2 of the License, or (at your option)
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14
* You should have received a copy of the GNU General Public License along
15
* with this program; if not, write to the Free Software Foundation, Inc., 51
16
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
#ifndef _GC_GcWindowLayout_h
20
#define _GC_GcWindowLayout_h
25
#include <QWidgetItem>
27
// A simple layout manager that lays out widgets
28
// left to right and top to bottom. So as widgets
29
// are resized and their neighbour won't fit to
30
// the right they move down.
31
class GcWindowLayout : public QLayout
34
GcWindowLayout(QWidget *parent, int margin = -1, int hSpacing = -1, int vSpacing = -1);
35
GcWindowLayout(int margin = -1, int hSpacing = -1, int vSpacing = -1);
38
void addItem(QLayoutItem *item);
39
void insert(int index, QWidget *item);
41
int horizontalSpacing() const;
42
int verticalSpacing() const;
43
Qt::Orientations expandingDirections() const;
44
bool hasHeightForWidth() const;
45
int heightForWidth(int) const;
47
QLayoutItem *itemAt(int index) const;
48
QSize minimumSize() const;
49
void setGeometry(const QRect &rect);
50
QSize sizeHint() const;
51
QLayoutItem *takeAt(int index);
54
int smartSpacing(QStyle::PixelMetric pm) const;
55
int doLayout(const QRect &rect, bool testOnly) const;
57
QList<QLayoutItem *> itemList;