1 //========================================================= 2 // MusE 3 // Linux Music Editor 4 // $Id: alayout.h,v 1.3.2.1 2008/01/19 13:33:46 wschweer Exp $ 5 // (C) Copyright 2002 Werner Schweer (ws@seh.de) 6 // 7 // This program is free software; you can redistribute it and/or 8 // modify it under the terms of the GNU General Public License 9 // as published by the Free Software Foundation; version 2 of 10 // the License, or (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 Free Software 19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 // 21 //========================================================= 22 23 #ifndef __ALAYOUT_H__ 24 #define __ALAYOUT_H__ 25 26 #include <QLayout> 27 #include <QGridLayout> 28 29 class QLayoutItem; 30 class QWidget; 31 32 namespace MusEGui { 33 34 class WidgetStack; 35 class ScrollBar; 36 class Splitter; 37 38 //--------------------------------------------------------- 39 // TLLayout 40 // arranger trackList layout manager 41 //--------------------------------------------------------- 42 43 class TLLayout : public QLayout 44 { 45 Q_OBJECT 46 47 bool _inSetGeometry; 48 49 WidgetStack* _stack; 50 ScrollBar* _sb; 51 Splitter* _splitter; // This is not actually in the layout, but used and/or adjusted anyway. 52 53 QLayoutItem* _stackLi; 54 QLayoutItem* _sbLi; 55 56 public: 57 static const int numItems = 2; 58 TLLayout(QWidget *parent, WidgetStack* stack, ScrollBar* sb, Splitter* splitter); ~TLLayout()59 ~TLLayout() { clear(); } 60 addItem(QLayoutItem *)61 void addItem(QLayoutItem*) { } // Do nothing, it's a custom layout. expandingDirections()62 virtual Qt::Orientations expandingDirections() const { return 0; } hasHeightForWidth()63 virtual bool hasHeightForWidth() const { return false; } count()64 virtual int count() const { return numItems; } 65 void clear(); 66 67 virtual QSize sizeHint() const; 68 virtual QSize minimumSize() const; 69 virtual QSize maximumSize() const; 70 virtual void setGeometry(const QRect &rect); 71 72 virtual QLayoutItem* itemAt(int) const; 73 virtual QLayoutItem* takeAt(int); 74 }; 75 76 } // namespace MusEGui 77 78 #endif 79