Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

qwt_dyngrid_layout.h

Go to the documentation of this file.
00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
00002  * Qwt Widget Library
00003  * Copyright (C) 1997   Josef Wilgen
00004  * Copyright (C) 2002   Uwe Rathmann
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the Qwt License, Version 1.0
00008  *****************************************************************************/
00009 
00010 #ifndef QWT_DYNGRID_LAYOUT_H
00011 #define QWT_DYNGRID_LAYOUT_H
00012 
00013 #include <qlayout.h>
00014 #include <qsize.h>
00015 #include <qlist.h>
00016 #include "qwt_array.h"
00017 #include <qvaluelist.h>
00018 #include "qwt_global.h"
00019 
00020 #if defined(QWT_TEMPLATEDLL)
00021 // MOC_SKIP_BEGIN
00022 template class QWT_EXPORT QList<QLayoutItem>;
00023 // MOC_SKIP_END
00024 #endif
00025 
00035 class QWT_EXPORT QwtDynGridLayout : public QLayout
00036 {
00037     Q_OBJECT
00038 public:
00039     QwtDynGridLayout(QWidget *, int margin=0, 
00040         int space=-1, const char *name = 0);
00041     QwtDynGridLayout(QLayout *, int space=-1, const char * name = 0 );
00042     QwtDynGridLayout(int space=-1, const char * name=0 );
00043 
00044     virtual ~QwtDynGridLayout();
00045 
00046     void setMaxCols(uint maxCols);
00047     uint maxCols() const;
00048 
00049     uint numRows () const; 
00050     uint numCols () const;
00051 
00052     virtual void addItem(QLayoutItem *);
00053     virtual QLayoutIterator iterator();
00054 
00055     virtual int maxItemWidth() const;
00056 
00057     virtual void setGeometry(const QRect &rect);
00058 
00059     virtual bool hasHeightForWidth() const;
00060     virtual int heightForWidth(int) const;
00061 
00062     virtual QSize sizeHint() const;
00063 
00064     void setExpanding(QSizePolicy::ExpandData);
00065     virtual QSizePolicy::ExpandData expanding() const;
00066 
00067     virtual bool isEmpty() const;
00068 
00069     virtual uint columnsForWidth(int width) const;
00070 
00071     QValueList<QRect> layoutItems(const QRect &, uint numCols) const;
00072 
00073 protected:
00074 
00075     void layoutGrid(uint numCols,
00076       QwtArray<int>& rowHeight, QwtArray<int>& colWidth) const;
00077     void stretchGrid(const QRect &rect, uint numCols, 
00078     QwtArray<int>& rowHeight, QwtArray<int>& colWidth) const;
00079 
00080 private:
00081     void init();
00082 
00083     uint d_maxCols;
00084     uint d_numRows;
00085     uint d_numCols;
00086     
00087     QSizePolicy::ExpandData d_expanding;
00088     QList<QLayoutItem> d_itemList;
00089 };
00090 
00091 #endif

Generated on Fri Nov 7 14:11:45 2003 for Qwt Developer's Guide by doxygen 1.3.2