Changeset 8127 in ntrip for trunk/BNC/qwt/qwt_plot_item.h
- Timestamp:
- May 10, 2017, 3:20:54 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_plot_item.h
r4271 r8127 12 12 13 13 #include "qwt_global.h" 14 #include "qwt_legend_itemmanager.h"15 14 #include "qwt_text.h" 15 #include "qwt_legend_data.h" 16 #include "qwt_graphic.h" 16 17 #include <qrect.h> 17 18 class QString; 18 #include <qlist.h> 19 #include <qmetatype.h> 20 19 21 class QPainter; 20 class QWidget;21 class QwtPlot;22 class QwtLegend;23 22 class QwtScaleMap; 24 23 class QwtScaleDiv; 24 class QwtPlot; 25 25 26 26 /*! … … 51 51 52 52 Depending on the QwtPlotItem::ItemAttribute flags, an item is included 53 into autoscaling or has an entry on the leg nd.53 into autoscaling or has an entry on the legend. 54 54 55 55 Before misusing the existing item classes it might be better to … … 62 62 */ 63 63 64 class QWT_EXPORT QwtPlotItem : public QwtLegendItemManager64 class QWT_EXPORT QwtPlotItem 65 65 { 66 66 public: … … 73 73 enum RttiValues 74 74 { 75 //! Unspecific value, that can be used, when it doesn't matter 75 76 Rtti_PlotItem = 0, 76 77 78 //! For QwtPlotGrid 77 79 Rtti_PlotGrid, 80 81 //! For QwtPlotScaleItem 78 82 Rtti_PlotScale, 83 84 //! For QwtPlotLegendItem 85 Rtti_PlotLegend, 86 87 //! For QwtPlotMarker 79 88 Rtti_PlotMarker, 89 90 //! For QwtPlotCurve 80 91 Rtti_PlotCurve, 92 93 //! For QwtPlotSpectroCurve 81 94 Rtti_PlotSpectroCurve, 95 96 //! For QwtPlotIntervalCurve 82 97 Rtti_PlotIntervalCurve, 98 99 //! For QwtPlotHistogram 83 100 Rtti_PlotHistogram, 101 102 //! For QwtPlotSpectrogram 84 103 Rtti_PlotSpectrogram, 104 105 //! For QwtPlotSvgItem 85 106 Rtti_PlotSVG, 86 107 108 //! For QwtPlotTradingCurve 109 Rtti_PlotTradingCurve, 110 111 //! For QwtPlotBarChart 112 Rtti_PlotBarChart, 113 114 //! For QwtPlotMultiBarChart 115 Rtti_PlotMultiBarChart, 116 117 //! For QwtPlotShapeItem 118 Rtti_PlotShape, 119 120 //! For QwtPlotTextLabel 121 Rtti_PlotTextLabel, 122 123 //! For QwtPlotZoneItem 124 Rtti_PlotZone, 125 126 /*! 127 Values >= Rtti_PlotUserItem are reserved for plot items 128 not implemented in the Qwt library. 129 */ 87 130 Rtti_PlotUserItem = 1000 88 131 }; 89 132 90 133 /*! 91 Plot Item Attributes 92 \sa setItemAttribute(), testItemAttribute() 134 \brief Plot Item Attributes 135 136 Various aspects of a plot widget depend on the attributes of 137 the attached plot items. If and how a single plot item 138 participates in these updates depends on its attributes. 139 140 \sa setItemAttribute(), testItemAttribute(), ItemInterest 93 141 */ 94 142 enum ItemAttribute … … 98 146 99 147 /*! 100 The boundingRect() of the item is included in the 101 autoscaling calculation. 102 */ 103 AutoScale = 0x02 148 The boundingRect() of the item is included in the 149 autoscaling calculation as long as its width or height 150 is >= 0.0. 151 */ 152 AutoScale = 0x02, 153 154 /*! 155 The item needs extra space to display something outside 156 its bounding rectangle. 157 \sa getCanvasMarginHint() 158 */ 159 Margins = 0x04 104 160 }; 105 161 106 162 //! Plot Item Attributes 107 163 typedef QFlags<ItemAttribute> ItemAttributes; 164 165 /*! 166 \brief Plot Item Interests 167 168 Plot items might depend on the situation of the corresponding 169 plot widget. By enabling an interest the plot item will be 170 notified, when the corresponding attribute of the plot widgets 171 has changed. 172 173 \sa setItemAttribute(), testItemAttribute(), ItemInterest 174 */ 175 enum ItemInterest 176 { 177 /*! 178 The item is interested in updates of the scales 179 \sa updateScaleDiv() 180 */ 181 ScaleInterest = 0x01, 182 183 /*! 184 The item is interested in updates of the legend ( of other items ) 185 This flag is intended for items, that want to implement a legend 186 for displaying entries of other plot item. 187 188 \note If the plot item wants to be represented on a legend 189 enable QwtPlotItem::Legend instead. 190 191 \sa updateLegend() 192 */ 193 LegendInterest = 0x02 194 }; 195 196 //! Plot Item Interests 197 typedef QFlags<ItemInterest> ItemInterests; 108 198 109 199 //! Render hints … … 111 201 { 112 202 //! Enable antialiasing 113 RenderAntialiased = 1203 RenderAntialiased = 0x1 114 204 }; 115 205 … … 134 224 bool testItemAttribute( ItemAttribute ) const; 135 225 226 void setItemInterest( ItemInterest, bool on = true ); 227 bool testItemInterest( ItemInterest ) const; 228 136 229 void setRenderHint( RenderHint, bool on = true ); 137 230 bool testRenderHint( RenderHint ) const; 231 232 void setRenderThreadCount( uint numThreads ); 233 uint renderThreadCount() const; 234 235 void setLegendIconSize( const QSize & ); 236 QSize legendIconSize() const; 138 237 139 238 double z() const; … … 154 253 155 254 virtual void itemChanged(); 255 virtual void legendChanged(); 156 256 157 257 /*! … … 169 269 virtual QRectF boundingRect() const; 170 270 171 virtual void updateLegend( QwtLegend * ) const; 271 virtual void getCanvasMarginHint( 272 const QwtScaleMap &xMap, const QwtScaleMap &yMap, 273 const QRectF &canvasSize, 274 double &left, double &top, double &right, double &bottom) const; 275 172 276 virtual void updateScaleDiv( 173 277 const QwtScaleDiv&, const QwtScaleDiv& ); 174 278 175 virtual QWidget *legendItem() const; 279 virtual void updateLegend( const QwtPlotItem *, 280 const QList<QwtLegendData> & ); 176 281 177 282 QRectF scaleRect( const QwtScaleMap &, const QwtScaleMap & ) const; 178 283 QRectF paintRect( const QwtScaleMap &, const QwtScaleMap & ) const; 284 285 virtual QList<QwtLegendData> legendData() const; 286 287 virtual QwtGraphic legendIcon( int index, const QSizeF & ) const; 288 289 protected: 290 QwtGraphic defaultIcon( const QBrush &, const QSizeF & ) const; 179 291 180 292 private: … … 188 300 189 301 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotItem::ItemAttributes ) 302 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotItem::ItemInterests ) 190 303 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotItem::RenderHints ) 191 304 305 Q_DECLARE_METATYPE( QwtPlotItem * ) 306 192 307 #endif
Note:
See TracChangeset
for help on using the changeset viewer.