• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kalarm/lib

  • sources
  • kde-4.12
  • kdepim
  • kalarm
  • lib
packedlayout.h
Go to the documentation of this file.
1 /*
2  * packedlayout.h - layout to pack items into rows
3  * Program: kalarm
4  * Copyright © 2007 by David Jarvie <djarvie@kde.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 #ifndef PACKEDLAYOUT_H
21 #define PACKEDLAYOUT_H
22 
23 #include <QLayout>
24 #include <QList>
25 
26 
33 class PackedLayout : public QLayout
34 {
35  public:
40  PackedLayout(QWidget* parent, Qt::Alignment alignment);
41  explicit PackedLayout(Qt::Alignment alignment);
42  ~PackedLayout();
43  // Override QLayout methods
44  virtual bool hasHeightForWidth() const { return true; }
45  virtual int heightForWidth(int w) const;
46  virtual int count() const { return mItems.count(); }
47  virtual void addItem(QLayoutItem* item);
48  virtual QLayoutItem* itemAt(int index) const;
49  virtual QLayoutItem* takeAt(int index);
50  virtual void setGeometry(const QRect& r);
51  virtual QSize sizeHint() const { return minimumSize(); }
52  virtual QSize minimumSize() const;
53  virtual Qt::Orientations expandingDirections() const { return Qt::Vertical | Qt::Horizontal; }
54  virtual void invalidate() { mWidthCached = mHeightCached = false; }
55 
56  private:
57  int arrange(const QRect&, bool set) const;
58  QList<QLayoutItem*> mItems;
59  Qt::Alignment mAlignment;
60  mutable int mWidthCached;
61  mutable int mHeightCached;
62 };
63 
64 #endif // PACKEDLAYOUT_H
65 
66 // vim: et sw=4:
PackedLayout::itemAt
virtual QLayoutItem * itemAt(int index) const
Definition: packedlayout.cpp:53
PackedLayout::minimumSize
virtual QSize minimumSize() const
Definition: packedlayout.cpp:82
PackedLayout::takeAt
virtual QLayoutItem * takeAt(int index)
Definition: packedlayout.cpp:58
QWidget
PackedLayout::setGeometry
virtual void setGeometry(const QRect &r)
Definition: packedlayout.cpp:75
PackedLayout::sizeHint
virtual QSize sizeHint() const
Definition: packedlayout.h:51
PackedLayout::~PackedLayout
~PackedLayout()
Definition: packedlayout.cpp:38
PackedLayout::PackedLayout
PackedLayout(QWidget *parent, Qt::Alignment alignment)
Constructor.
Definition: packedlayout.cpp:24
PackedLayout::heightForWidth
virtual int heightForWidth(int w) const
Definition: packedlayout.cpp:65
QLayout
PackedLayout::hasHeightForWidth
virtual bool hasHeightForWidth() const
Definition: packedlayout.h:44
PackedLayout
The PackedLayout class packs a group of widgets into rows.
Definition: packedlayout.h:33
PackedLayout::invalidate
virtual void invalidate()
Definition: packedlayout.h:54
PackedLayout::count
virtual int count() const
Definition: packedlayout.h:46
set
void set(quint32, const QString &, const QString &, const QString &, const QString &, time_t)
PackedLayout::expandingDirections
virtual Qt::Orientations expandingDirections() const
Definition: packedlayout.h:53
PackedLayout::addItem
virtual void addItem(QLayoutItem *item)
Definition: packedlayout.cpp:47
QList< QLayoutItem * >
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:59:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kalarm/lib

Skip menu "kalarm/lib"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal