| 1 | /******************************************************************************
|
|---|
| 2 | * QwtPolar Widget Library
|
|---|
| 3 | * Copyright (C) 2008 Uwe Rathmann
|
|---|
| 4 | *
|
|---|
| 5 | * This library is free software; you can redistribute it and/or
|
|---|
| 6 | * modify it under the terms of the Qwt License, Version 1.0
|
|---|
| 7 | *****************************************************************************/
|
|---|
| 8 |
|
|---|
| 9 | #ifndef QWT_POLAR_LAYOUT_H
|
|---|
| 10 | #define QWT_POLAR_LAYOUT_H
|
|---|
| 11 |
|
|---|
| 12 | #include "qwt_global.h"
|
|---|
| 13 | #include "qwt_polar_plot.h"
|
|---|
| 14 |
|
|---|
| 15 | /*!
|
|---|
| 16 | \brief Layout class for QwtPolarPlot.
|
|---|
| 17 |
|
|---|
| 18 | Organizes the geometry for the different QwtPolarPlot components.
|
|---|
| 19 | It is used by the QwtPolar widget to organize its internal widgets
|
|---|
| 20 | or by QwtPolarRnderer to render its content to a QPaintDevice like
|
|---|
| 21 | a QPrinter, QPixmap/QImage or QSvgRenderer.
|
|---|
| 22 | */
|
|---|
| 23 | class QWT_EXPORT QwtPolarLayout
|
|---|
| 24 | {
|
|---|
| 25 | public:
|
|---|
| 26 |
|
|---|
| 27 | //! \brief Options to configure the plot layout engine
|
|---|
| 28 | enum Option
|
|---|
| 29 | {
|
|---|
| 30 | //! Ignore the dimension of the scrollbars.
|
|---|
| 31 | IgnoreScrollbars = 0x01,
|
|---|
| 32 |
|
|---|
| 33 | //! Ignore all frames.
|
|---|
| 34 | IgnoreFrames = 0x02,
|
|---|
| 35 |
|
|---|
| 36 | //! Ignore the title.
|
|---|
| 37 | IgnoreTitle = 0x04,
|
|---|
| 38 |
|
|---|
| 39 | //! Ignore the legend.
|
|---|
| 40 | IgnoreLegend = 0x08
|
|---|
| 41 | };
|
|---|
| 42 |
|
|---|
| 43 | Q_DECLARE_FLAGS( Options, Option )
|
|---|
| 44 |
|
|---|
| 45 | explicit QwtPolarLayout();
|
|---|
| 46 | virtual ~QwtPolarLayout();
|
|---|
| 47 |
|
|---|
| 48 | void setLegendPosition( QwtPolarPlot::LegendPosition pos, double ratio );
|
|---|
| 49 | void setLegendPosition( QwtPolarPlot::LegendPosition pos );
|
|---|
| 50 | QwtPolarPlot::LegendPosition legendPosition() const;
|
|---|
| 51 |
|
|---|
| 52 | void setLegendRatio( double ratio );
|
|---|
| 53 | double legendRatio() const;
|
|---|
| 54 |
|
|---|
| 55 | virtual void activate( const QwtPolarPlot*,
|
|---|
| 56 | const QRectF& rect, Options options = Options() );
|
|---|
| 57 |
|
|---|
| 58 | virtual void invalidate();
|
|---|
| 59 |
|
|---|
| 60 | const QRectF& titleRect() const;
|
|---|
| 61 | const QRectF& legendRect() const;
|
|---|
| 62 | const QRectF& canvasRect() const;
|
|---|
| 63 |
|
|---|
| 64 | class LayoutData;
|
|---|
| 65 |
|
|---|
| 66 | protected:
|
|---|
| 67 | QRectF layoutLegend( Options options, QRectF& ) const;
|
|---|
| 68 |
|
|---|
| 69 | private:
|
|---|
| 70 | class PrivateData;
|
|---|
| 71 | PrivateData* m_data;
|
|---|
| 72 | };
|
|---|
| 73 |
|
|---|
| 74 | Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarLayout::Options )
|
|---|
| 75 |
|
|---|
| 76 | #endif
|
|---|