Plasma
stackedlayout.h
Go to the documentation of this file.
00001 /* 00002 Copyright (C) 2009 Igor Trindade Oliveira <igor.oliveira@indt.org.br> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Lesser General Public 00006 License as published by the Free Software Foundation; either 00007 version 2.1 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Lesser General Public License for more details. 00013 00014 You should have received a copy of the GNU Lesser General Public 00015 License along with this library. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #ifndef STACKEDLAYOUT_H 00019 #define STACKEDLAYOUT_H 00020 00021 /* TODO: document the methods */ 00022 00023 #include <QGraphicsLayout> 00024 #include <QList> 00025 #include <QObject> 00026 00027 class StackedLayout : public QObject, public QGraphicsLayout 00028 { 00029 Q_OBJECT 00030 Q_INTERFACES(QGraphicsLayout) 00031 00032 public: 00033 explicit StackedLayout(QGraphicsLayoutItem *parent = 0); 00034 ~StackedLayout(); 00035 00036 void setGeometry(const QRectF &rect); 00037 QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const; 00038 int count() const; 00039 QGraphicsLayoutItem *itemAt(int i) const; 00040 00041 void insertWidget(QGraphicsLayoutItem *item, int pos); 00042 void addWidget(QGraphicsLayoutItem *item); 00043 00044 void removeAt(int index); 00045 00046 qint32 currentWidgetIndex() const; 00047 void setCurrentWidgetIndex(qint32 index); 00048 00049 private: 00050 QList<QGraphicsLayoutItem *> items; 00051 qint32 m_currentWidgetIndex; 00052 }; 00053 00054 #endif
KDE 4.6 API Reference