Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_plot_tradingcurve.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (3 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_plot_tradingcurve.h (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_plot_tradingcurve.h
r9383 r11158 1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*-*****************************1 /****************************************************************************** 2 2 * Qwt Widget Library 3 3 * Copyright (C) 1997 Josef Wilgen … … 13 13 #include "qwt_global.h" 14 14 #include "qwt_plot_seriesitem.h" 15 #include "qwt_series_data.h"16 15 17 16 /*! 18 \brief QwtPlotTradingCurve illustrates movements in the price of a 17 \brief QwtPlotTradingCurve illustrates movements in the price of a 19 18 financial instrument over time. 20 19 21 QwtPlotTradingCurve supports candlestick or bar ( OHLC ) charts 22 that are used in the domain of technical analysis. 20 QwtPlotTradingCurve supports candlestick or bar ( OHLC ) charts 21 that are used in the domain of technical analysis. 23 22 24 While the length ( height or width depending on orientation() ) 25 of each symbol depends on the corresponding OHLC sample the size 26 of the other dimension can be controlled using: 23 While the length ( height or width depending on orientation() ) 24 of each symbol depends on the corresponding OHLC sample the size 25 of the other dimension can be controlled using: 27 26 28 - setSymbolExtent() 29 - setSymbolMinWidth() 30 - setSymbolMaxWidth() 27 - setSymbolExtent() 28 - setSymbolMinWidth() 29 - setSymbolMaxWidth() 31 30 32 The extent is a size in scale coordinates, so that the symbol width 33 is increasing when the plot is zoomed in. Minimum/Maximum width 34 is in widget coordinates independent from the zoom level. 35 When setting the minimum and maximum to the same value, the width of 36 the symbol is fixed. 37 */ 38 class QWT_EXPORT QwtPlotTradingCurve: 39 public QwtPlotSeriesItem, public QwtSeriesStore<QwtOHLCSample> 31 The extent is a size in scale coordinates, so that the symbol width 32 is increasing when the plot is zoomed in. Minimum/Maximum width 33 is in widget coordinates independent from the zoom level. 34 When setting the minimum and maximum to the same value, the width of 35 the symbol is fixed. 36 */ 37 class QWT_EXPORT QwtPlotTradingCurve 38 : public QwtPlotSeriesItem 39 , public QwtSeriesStore< QwtOHLCSample > 40 40 { 41 public: 41 public: 42 42 /*! 43 43 \brief Symbol styles. … … 45 45 The default setting is QwtPlotSeriesItem::CandleStick. 46 46 \sa setSymbolStyle(), symbolStyle() 47 */ 47 */ 48 48 enum SymbolStyle 49 49 { … … 52 52 53 53 /*! 54 A line on the chart shows the price range (the highest and lowest 55 prices) over one unit of time, e.g. one day or one hour. 56 Tick marks project from each side of the line indicating the 57 opening and closing price. 54 A line on the chart shows the price range (the highest and lowest 55 prices) over one unit of time, e.g. one day or one hour. 56 Tick marks project from each side of the line indicating the 57 opening and closing price. 58 58 */ 59 59 Bar, 60 60 61 61 /*! 62 The range between opening/closing price are displayed as 63 a filled box. The fill brush depends on the direction of the 64 price movement. The box is connected to the highest/lowest 65 values by lines. 66 */ 62 The range between opening/closing price are displayed as 63 a filled box. The fill brush depends on the direction of the 64 price movement. The box is connected to the highest/lowest 65 values by lines. 66 */ 67 67 CandleStick, 68 68 69 69 /*! 70 SymbolTypes >= UserSymbol are displayed by drawUserSymbol(), 71 that needs to be overloaded and implemented in derived 72 curve classes. 70 SymbolTypes >= UserSymbol are displayed by drawUserSymbol(), 71 that needs to be overloaded and implemented in derived 72 curve classes. 73 73 74 \sa drawUserSymbol() 75 */ 74 \sa drawUserSymbol() 75 */ 76 76 UserSymbol = 100 77 77 }; … … 92 92 Attributes to modify the drawing algorithm. 93 93 \sa setPaintAttribute(), testPaintAttribute() 94 */ 94 */ 95 95 enum PaintAttribute 96 96 { … … 99 99 }; 100 100 101 //! Paint attributes 102 typedef QFlags<PaintAttribute> PaintAttributes; 101 Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute ) 103 102 104 explicit QwtPlotTradingCurve( const QString &title = QString() );105 explicit QwtPlotTradingCurve( const QwtText &title );103 explicit QwtPlotTradingCurve( const QString& title = QString() ); 104 explicit QwtPlotTradingCurve( const QwtText& title ); 106 105 107 106 virtual ~QwtPlotTradingCurve(); 108 107 109 virtual int rtti() const; 108 virtual int rtti() const QWT_OVERRIDE; 110 109 111 110 void setPaintAttribute( PaintAttribute, bool on = true ); 112 111 bool testPaintAttribute( PaintAttribute ) const; 113 112 114 void setSamples( const QVector<QwtOHLCSample >& );115 void setSamples( QwtSeriesData<QwtOHLCSample >* );113 void setSamples( const QVector< QwtOHLCSample >& ); 114 void setSamples( QwtSeriesData< QwtOHLCSample >* ); 116 115 117 116 void setSymbolStyle( SymbolStyle style ); 118 117 SymbolStyle symbolStyle() const; 119 118 120 void setSymbolPen( const QColor &,119 void setSymbolPen( const QColor&, 121 120 qreal width = 0.0, Qt::PenStyle = Qt::SolidLine ); 122 void setSymbolPen( const QPen & );121 void setSymbolPen( const QPen& ); 123 122 QPen symbolPen() const; 124 123 125 void setSymbolBrush( Direction, const QBrush & );124 void setSymbolBrush( Direction, const QBrush& ); 126 125 QBrush symbolBrush( Direction ) const; 127 126 … … 135 134 double maxSymbolWidth() const; 136 135 137 virtual void drawSeries( QPainter *painter,138 const QwtScaleMap &xMap, const QwtScaleMap&yMap,139 const QRectF &canvasRect, int from, int to ) const;136 virtual void drawSeries( QPainter*, 137 const QwtScaleMap& xMap, const QwtScaleMap& yMap, 138 const QRectF& canvasRect, int from, int to ) const QWT_OVERRIDE; 140 139 141 virtual QRectF boundingRect() const; 140 virtual QRectF boundingRect() const QWT_OVERRIDE; 142 141 143 virtual QwtGraphic legendIcon( int index, const QSizeF & ) const;142 virtual QwtGraphic legendIcon( int index, const QSizeF& ) const QWT_OVERRIDE; 144 143 145 protected: 144 protected: 146 145 147 146 void init(); 148 147 149 virtual void drawSymbols( QPainter *,150 const QwtScaleMap &xMap, const QwtScaleMap&yMap,151 const QRectF &canvasRect, int from, int to ) const;148 virtual void drawSymbols( QPainter*, 149 const QwtScaleMap& xMap, const QwtScaleMap& yMap, 150 const QRectF& canvasRect, int from, int to ) const; 152 151 153 virtual void drawUserSymbol( QPainter *,154 SymbolStyle, const QwtOHLCSample &,152 virtual void drawUserSymbol( QPainter*, 153 SymbolStyle, const QwtOHLCSample&, 155 154 Qt::Orientation, bool inverted, double symbolWidth ) const; 156 155 157 void drawBar( QPainter *painter, const QwtOHLCSample&,156 void drawBar( QPainter*, const QwtOHLCSample&, 158 157 Qt::Orientation, bool inverted, double width ) const; 159 158 160 void drawCandleStick( QPainter *, const QwtOHLCSample&,159 void drawCandleStick( QPainter*, const QwtOHLCSample&, 161 160 Qt::Orientation, double width ) const; 162 161 163 162 virtual double scaledSymbolWidth( 164 const QwtScaleMap &xMap, const QwtScaleMap&yMap,165 const QRectF &canvasRect ) const;163 const QwtScaleMap& xMap, const QwtScaleMap& yMap, 164 const QRectF& canvasRect ) const; 166 165 167 private: 166 private: 168 167 class PrivateData; 169 PrivateData *d_data;168 PrivateData* m_data; 170 169 }; 171 170
Note:
See TracChangeset
for help on using the changeset viewer.
