source: ntrip/trunk/BNC/qwt/qwt_dyngrid_layout.h@ 9407

Last change on this file since 9407 was 9383, checked in by stoecker, 4 years ago

update to qwt verion 6.1.1 to fix build with newer Qt5

File size: 2.3 KB
RevLine 
[4271]1/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10#ifndef QWT_DYNGRID_LAYOUT_H
11#define QWT_DYNGRID_LAYOUT_H
12
13#include "qwt_global.h"
14#include <qlayout.h>
15#include <qsize.h>
16#include <qlist.h>
17
18/*!
19 \brief The QwtDynGridLayout class lays out widgets in a grid,
20 adjusting the number of columns and rows to the current size.
21
22 QwtDynGridLayout takes the space it gets, divides it up into rows and
23 columns, and puts each of the widgets it manages into the correct cell(s).
[8127]24 It lays out as many number of columns as possible (limited by maxColumns()).
[4271]25*/
26
27class QWT_EXPORT QwtDynGridLayout : public QLayout
28{
29 Q_OBJECT
30public:
[9383]31 explicit QwtDynGridLayout( QWidget *, int margin = 0, int spacing = -1 );
32 explicit QwtDynGridLayout( int spacing = -1 );
[4271]33
34 virtual ~QwtDynGridLayout();
35
36 virtual void invalidate();
37
[9383]38 void setMaxColumns( uint maxColumns );
[8127]39 uint maxColumns() const;
[4271]40
41 uint numRows () const;
[8127]42 uint numColumns () const;
[4271]43
44 virtual void addItem( QLayoutItem * );
45
46 virtual QLayoutItem *itemAt( int index ) const;
47 virtual QLayoutItem *takeAt( int index );
48 virtual int count() const;
49
50 void setExpandingDirections( Qt::Orientations );
51 virtual Qt::Orientations expandingDirections() const;
[9383]52 QList<QRect> layoutItems( const QRect &, uint numColumns ) const;
[4271]53
54 virtual int maxItemWidth() const;
55
56 virtual void setGeometry( const QRect &rect );
57
58 virtual bool hasHeightForWidth() const;
59 virtual int heightForWidth( int ) const;
60
61 virtual QSize sizeHint() const;
62
63 virtual bool isEmpty() const;
64 uint itemCount() const;
65
66 virtual uint columnsForWidth( int width ) const;
67
68protected:
69
[9383]70 void layoutGrid( uint numColumns,
[4271]71 QVector<int>& rowHeight, QVector<int>& colWidth ) const;
[9383]72 void stretchGrid( const QRect &rect, uint numColumns,
[4271]73 QVector<int>& rowHeight, QVector<int>& colWidth ) const;
74
75private:
76 void init();
[9383]77 int maxRowWidth( int numColumns ) const;
[4271]78
79 class PrivateData;
80 PrivateData *d_data;
81};
82
83#endif
Note: See TracBrowser for help on using the repository browser.