1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
/*
* python-qwt. Python wrapper for the Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
* Copyright (C) 2015 Gudjon I. Gudjonsson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
class QwtLegend : QwtAbstractLegend
{
%TypeHeaderCode
#include <qwt_legend.h>
%End
public:
explicit QwtLegend( QWidget *parent /TransferThis/ = NULL );
virtual ~QwtLegend();
void setMaxColumns( uint numColums );
uint maxColumns() const;
void setDefaultItemMode( QwtLegendData::Mode );
QwtLegendData::Mode defaultItemMode() const;
QWidget *contentsWidget();
//const QWidget *contentsWidget() const;
QWidget *legendWidget( const QVariant & ) const;
QList<QWidget *> legendWidgets( const QVariant & ) const;
QVariant itemInfo( const QWidget * ) const;
virtual bool eventFilter( QObject *, QEvent * );
virtual QSize sizeHint() const;
virtual int heightForWidth( int w ) const;
QScrollBar *horizontalScrollBar() const;
QScrollBar *verticalScrollBar() const;
virtual void renderLegend( QPainter *,
const QRectF &, bool fillBackground ) const;
virtual void renderItem( QPainter *,
const QWidget *, const QRectF &, bool fillBackground ) const;
virtual bool isEmpty() const;
virtual int scrollExtent( Qt::Orientation ) const;
signals:
/*!
A signal which is emitted when the user has clicked on
a legend label, which is in QwtLegendData::Clickable mode.
\param itemInfo Info for the item item of the
selected legend item
\param index Index of the legend label in the list of widgets
that are associated with the plot item
\note clicks are disabled as default
\sa setDefaultItemMode(), defaultItemMode(), QwtPlot::itemToInfo()
*/
void clicked( const QVariant &itemInfo, int index );
/*!
A signal which is emitted when the user has clicked on
a legend label, which is in QwtLegendData::Checkable mode
\param itemInfo Info for the item of the
selected legend label
\param index Index of the legend label in the list of widgets
that are associated with the plot item
\param on True when the legend label is checked
\note clicks are disabled as default
\sa setDefaultItemMode(), defaultItemMode(), QwtPlot::itemToInfo()
*/
void checked( const QVariant &itemInfo, bool on, int index );
public slots:
virtual void updateLegend( const QVariant &,
const QList<QwtLegendData> & );
protected slots:
void itemClicked();
void itemChecked( bool );
protected:
virtual QWidget *createWidget( const QwtLegendData & ) const;
virtual void updateWidget( QWidget *widget, const QwtLegendData &data );
};
|