Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_legend.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (4 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_legend.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_legend.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_abstract_legend.h" 15 #include "qwt_legend_data.h" 16 15 17 #include <qvariant.h> 16 18 … … 18 20 19 21 /*! 20 \brief The legend widget 22 \brief The legend widget 21 23 22 The QwtLegend widget is a tabular arrangement of legend items. Legend 23 items might be any type of widget, but in general they will be 24 a QwtLegendLabel. 24 The QwtLegend widget is a tabular arrangement of legend items. Legend 25 items might be any type of widget, but in general they will be 26 a QwtLegendLabel. 25 27 26 \sa QwtLegendLabel, QwtPlotItem, QwtPlot 27 */ 28 \sa QwtLegendLabel, QwtPlotItem, QwtPlot 29 */ 28 30 29 31 class QWT_EXPORT QwtLegend : public QwtAbstractLegend … … 31 33 Q_OBJECT 32 34 33 public: 34 explicit QwtLegend( QWidget *parent = NULL );35 public: 36 explicit QwtLegend( QWidget* parent = NULL ); 35 37 virtual ~QwtLegend(); 36 38 … … 41 43 QwtLegendData::Mode defaultItemMode() const; 42 44 43 QWidget *contentsWidget();44 const QWidget *contentsWidget() const;45 QWidget* contentsWidget(); 46 const QWidget* contentsWidget() const; 45 47 46 QWidget *legendWidget( const QVariant& ) const;47 QList<QWidget *> legendWidgets( const QVariant& ) const;48 QWidget* legendWidget( const QVariant& ) const; 49 QList< QWidget* > legendWidgets( const QVariant& ) const; 48 50 49 QVariant itemInfo( const QWidget * ) const;51 QVariant itemInfo( const QWidget* ) const; 50 52 51 virtual bool eventFilter( QObject *, QEvent* );53 virtual bool eventFilter( QObject*, QEvent* ) QWT_OVERRIDE; 52 54 53 virtual QSize sizeHint() const; 54 virtual int heightForWidth( int w idth) const;55 virtual QSize sizeHint() const QWT_OVERRIDE; 56 virtual int heightForWidth( int w ) const QWT_OVERRIDE; 55 57 56 QScrollBar *horizontalScrollBar() const;57 QScrollBar *verticalScrollBar() const;58 QScrollBar* horizontalScrollBar() const; 59 QScrollBar* verticalScrollBar() const; 58 60 59 virtual void renderLegend( QPainter *,60 const QRectF &, bool fillBackground ) const;61 virtual void renderLegend( QPainter*, 62 const QRectF&, bool fillBackground ) const QWT_OVERRIDE; 61 63 62 virtual void renderItem( QPainter *,63 const QWidget *, const QRectF&, bool fillBackground ) const;64 virtual void renderItem( QPainter*, 65 const QWidget*, const QRectF&, bool fillBackground ) const; 64 66 65 virtual bool isEmpty() const; 66 virtual int scrollExtent( Qt::Orientation ) const; 67 virtual bool isEmpty() const QWT_OVERRIDE; 68 virtual int scrollExtent( Qt::Orientation ) const QWT_OVERRIDE; 67 69 68 Q_SIGNALS: 70 Q_SIGNALS: 69 71 /*! 70 A signal which is emitted when the user has clicked on 71 a legend label, which is in QwtLegendData::Clickable mode. 72 A signal which is emitted when the user has clicked on 73 a legend label, which is in QwtLegendData::Clickable mode. 72 74 73 \param itemInfo Info for the item item of the 75 \param itemInfo Info for the item item of the 74 76 selected legend item 75 \param index Index of the legend label in the list of widgets 77 \param index Index of the legend label in the list of widgets 76 78 that are associated with the plot item 77 79 78 \note clicks are disabled as default 79 \sa setDefaultItemMode(), defaultItemMode(), QwtPlot::itemToInfo() 80 \note clicks are disabled as default 81 \sa setDefaultItemMode(), defaultItemMode(), QwtPlot::itemToInfo() 80 82 */ 81 void clicked( const QVariant &itemInfo, int index );83 void clicked( const QVariant& itemInfo, int index ); 82 84 83 85 /*! 84 A signal which is emitted when the user has clicked on 85 a legend label, which is in QwtLegendData::Checkable mode 86 A signal which is emitted when the user has clicked on 87 a legend label, which is in QwtLegendData::Checkable mode 86 88 87 \param itemInfo Info for the item of the 89 \param itemInfo Info for the item of the 88 90 selected legend label 89 \param index Index of the legend label in the list of widgets 91 \param index Index of the legend label in the list of widgets 90 92 that are associated with the plot item 91 \param on True when the legend label is checked 93 \param on True when the legend label is checked 92 94 93 \note clicks are disabled as default 94 \sa setDefaultItemMode(), defaultItemMode(), QwtPlot::itemToInfo() 95 \note clicks are disabled as default 96 \sa setDefaultItemMode(), defaultItemMode(), QwtPlot::itemToInfo() 95 97 */ 96 void checked( const QVariant &itemInfo, bool on, int index );98 void checked( const QVariant& itemInfo, bool on, int index ); 97 99 98 public Q_SLOTS: 99 virtual void updateLegend( const QVariant &,100 const QList<QwtLegendData > & );100 public Q_SLOTS: 101 virtual void updateLegend( const QVariant&, 102 const QList< QwtLegendData >& ) QWT_OVERRIDE; 101 103 102 protected Q_SLOTS: 104 protected Q_SLOTS: 103 105 void itemClicked(); 104 106 void itemChecked( bool ); 105 107 106 protected: 107 virtual QWidget *createWidget( const QwtLegendData& ) const;108 virtual void updateWidget( QWidget *widget, const QwtLegendData& );108 protected: 109 virtual QWidget* createWidget( const QwtLegendData& ) const; 110 virtual void updateWidget( QWidget*, const QwtLegendData& ); 109 111 110 private: 112 private: 111 113 void updateTabOrder(); 112 114 113 115 class PrivateData; 114 PrivateData *d_data;116 PrivateData* m_data; 115 117 }; 116 118
Note:
See TracChangeset
for help on using the changeset viewer.
