Changeset 8127 in ntrip for trunk/BNC/qwt/qwt_legend.h
- Timestamp:
- May 10, 2017, 3:20:54 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_legend.h
r4271 r8127 12 12 13 13 #include "qwt_global.h" 14 #include <qframe.h>15 #include <q list.h>14 #include "qwt_abstract_legend.h" 15 #include <qvariant.h> 16 16 17 17 class QScrollBar; 18 class QwtLegendItemManager;19 18 20 19 /*! … … 23 22 The QwtLegend widget is a tabular arrangement of legend items. Legend 24 23 items might be any type of widget, but in general they will be 25 a QwtLegend Item.24 a QwtLegendLabel. 26 25 27 \sa QwtLegend Item, QwtLegendItemManagerQwtPlot26 \sa QwtLegendLabel, QwtPlotItem, QwtPlot 28 27 */ 29 28 30 class QWT_EXPORT QwtLegend : public Q Frame29 class QWT_EXPORT QwtLegend : public QwtAbstractLegend 31 30 { 32 31 Q_OBJECT 33 32 34 33 public: 35 /*!36 \brief Interaction mode for the legend items37 38 The default is QwtLegend::ReadOnlyItem.39 40 \sa setItemMode(), itemMode(), QwtLegendItem::IdentifierMode41 QwtLegendItem::clicked(), QwtLegendItem::checked(),42 QwtPlot::legendClicked(), QwtPlot::legendChecked()43 */44 45 enum LegendItemMode46 {47 //! The legend item is not interactive, like a label48 ReadOnlyItem,49 50 //! The legend item is clickable, like a push button51 ClickableItem,52 53 //! The legend item is checkable, like a checkable button54 CheckableItem55 };56 57 34 explicit QwtLegend( QWidget *parent = NULL ); 58 35 virtual ~QwtLegend(); 59 36 60 void setItemMode( LegendItemMode ); 61 LegendItemMode itemMode() const; 37 void setMaxColumns( uint numColums ); 38 uint maxColumns() const; 39 40 void setDefaultItemMode( QwtLegendData::Mode ); 41 QwtLegendData::Mode defaultItemMode() const; 62 42 63 43 QWidget *contentsWidget(); 64 44 const QWidget *contentsWidget() const; 65 45 66 void insert( const QwtLegendItemManager *, QWidget * );67 void remove( const QwtLegendItemManager * );46 QWidget *legendWidget( const QVariant & ) const; 47 QList<QWidget *> legendWidgets( const QVariant & ) const; 68 48 69 QWidget *find( const QwtLegendItemManager * ) const; 70 QwtLegendItemManager *find( const QWidget * ) const; 71 72 virtual QList<QWidget *> legendItems() const; 73 74 void clear(); 75 76 bool isEmpty() const; 77 uint itemCount() const; 49 QVariant itemInfo( const QWidget * ) const; 78 50 79 51 virtual bool eventFilter( QObject *, QEvent * ); … … 85 57 QScrollBar *verticalScrollBar() const; 86 58 59 virtual void renderLegend( QPainter *, 60 const QRectF &, bool fillBackground ) const; 61 62 virtual void renderItem( QPainter *, 63 const QWidget *, const QRectF &, bool fillBackground ) const; 64 65 virtual bool isEmpty() const; 66 virtual int scrollExtent( Qt::Orientation ) const; 67 68 Q_SIGNALS: 69 /*! 70 A signal which is emitted when the user has clicked on 71 a legend label, which is in QwtLegendData::Clickable mode. 72 73 \param itemInfo Info for the item item of the 74 selected legend item 75 \param index Index of the legend label in the list of widgets 76 that are associated with the plot item 77 78 \note clicks are disabled as default 79 \sa setDefaultItemMode(), defaultItemMode(), QwtPlot::itemToInfo() 80 */ 81 void clicked( const QVariant &itemInfo, int index ); 82 83 /*! 84 A signal which is emitted when the user has clicked on 85 a legend label, which is in QwtLegendData::Checkable mode 86 87 \param itemInfo Info for the item of the 88 selected legend label 89 \param index Index of the legend label in the list of widgets 90 that are associated with the plot item 91 \param on True when the legend label is checked 92 93 \note clicks are disabled as default 94 \sa setDefaultItemMode(), defaultItemMode(), QwtPlot::itemToInfo() 95 */ 96 void checked( const QVariant &itemInfo, bool on, int index ); 97 98 public Q_SLOTS: 99 virtual void updateLegend( const QVariant &, 100 const QList<QwtLegendData> & ); 101 102 protected Q_SLOTS: 103 void itemClicked(); 104 void itemChecked( bool ); 105 87 106 protected: 88 virtual void layoutContents(); 107 virtual QWidget *createWidget( const QwtLegendData & ) const; 108 virtual void updateWidget( QWidget *widget, const QwtLegendData &data ); 89 109 90 110 private: 111 void updateTabOrder(); 112 91 113 class PrivateData; 92 114 PrivateData *d_data;
Note:
See TracChangeset
for help on using the changeset viewer.