Applets
compactlayout.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 * compactlayout.h * 00003 * * 00004 * Copyright (C) 2008 Jason Stubbs <jasonbstubbs@gmail.com> * 00005 * * 00006 * This program is free software; you can redistribute it and/or modify * 00007 * it under the terms of the GNU General Public License as published by * 00008 * the Free Software Foundation; either version 2 of the License, or * 00009 * (at your option) any later version. * 00010 * * 00011 * This program is distributed in the hope that it will be useful, * 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00014 * GNU General Public License for more details. * 00015 * * 00016 * You should have received a copy of the GNU General Public License * 00017 * along with this program; if not, write to the * 00018 * Free Software Foundation, Inc., * 00019 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 00020 ***************************************************************************/ 00021 00022 #ifndef COMPACTLAYOUT_H 00023 #define COMPACTLAYOUT_H 00024 00025 #include <QGraphicsLayout> 00026 00027 00028 namespace SystemTray 00029 { 00030 00031 class CompactLayout : public QGraphicsLayout 00032 { 00033 public: 00034 CompactLayout(QGraphicsLayoutItem *parent = 0); 00035 ~CompactLayout(); 00036 00037 qreal spacing() const; 00038 void setSpacing(qreal spacing); 00039 00040 void insertItem(int index, QGraphicsLayoutItem *item); 00041 void addItem(QGraphicsLayoutItem *item); 00042 void removeItem(QGraphicsLayoutItem *item); 00043 bool containsItem(QGraphicsLayoutItem *item) const; 00044 00045 int count() const; 00046 void setGeometry(const QRectF &rect); 00047 QGraphicsLayoutItem* itemAt(int i) const; 00048 void removeAt(int index); 00049 00050 protected: 00051 QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; 00052 00053 private: 00054 class Private; 00055 Private* const d; 00056 }; 00057 00058 } 00059 00060 00061 #endif