Eneboo - Documentación para desarrolladores
Clases | Tipos públicos | Métodos públicos | Métodos protegidos
Referencia de la Clase QwtLegend

The legend widget. Más...

#include <qwt_legend.h>

Diagrama de herencias de QwtLegend
QFrame QWidget QWidget QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject

Lista de todos los miembros.


class  PrivateData

Tipos públicos

enum  LegendDisplayPolicy { NoIdentifier = 0, FixedIdentifier = 1, AutoIdentifier = 2 }
 Display policy. Más...
enum  LegendItemMode { ReadOnlyItem, ClickableItem, CheckableItem }
 Interaction mode for the legend items. Más...

Métodos públicos

 QwtLegend (QWidget *parent=NULL)
virtual ~QwtLegend ()
void setDisplayPolicy (LegendDisplayPolicy policy, int mode)
LegendDisplayPolicy displayPolicy () const
void setItemMode (LegendItemMode)
LegendItemMode itemMode () const
int identifierMode () const
QWidgetcontentsWidget ()
const QWidgetcontentsWidget () const
void insert (const QwtLegendItemManager *, QWidget *)
void remove (const QwtLegendItemManager *)
QWidgetfind (const QwtLegendItemManager *) const
QwtLegendItemManagerfind (const QWidget *) const
virtual QValueList< QWidget * > legendItems () const
void clear ()
 Remove all items.
bool isEmpty () const
 Return true, if there are no legend items.
uint itemCount () const
 Return the number of legend items.
virtual bool eventFilter (QObject *, QEvent *)
virtual QSize sizeHint () const
 Return a size hint.
virtual int heightForWidth (int w) const
QScrollBarhorizontalScrollBar () const
QScrollBarverticalScrollBar () const

Métodos protegidos

virtual void resizeEvent (QResizeEvent *)
virtual void layoutContents ()

Descripción detallada

The legend widget.

The QwtLegend widget is a tabular arrangement of legend items. Legend items might be any type of widget, but in general they will be a QwtLegendItem.

Ver también:
QwtLegendItem, QwtLegendItemManager QwtPlot

Documentación de las enumeraciones miembro de la clase

Display policy.

  • NoIdentifier
    The client code is responsible how to display of each legend item. The Qwt library will not interfere.

Default is AutoIdentifier.

Ver también:
setDisplayPolicy(), displayPolicy(), QwtLegendItem::IdentifierMode
Valores de enumeraciones:

Interaction mode for the legend items.

Valores de enumeraciones:

Documentación del constructor y destructor

QwtLegend::QwtLegend ( QWidget parent = NULL) [explicit]
parentParent widget
QwtLegend::~QwtLegend ( ) [virtual]


Documentación de las funciones miembro

void QwtLegend::clear ( void  )

Remove all items.

QWidget * QwtLegend::contentsWidget ( )

The contents widget is the only child of the viewport() and the parent widget of all legend items.

const QWidget * QwtLegend::contentsWidget ( ) const

The contents widget is the only child of the viewport() and the parent widget of all legend items.

QwtLegend::LegendDisplayPolicy QwtLegend::displayPolicy ( ) const
the legend display policy. Default is LegendDisplayPolicy::Auto.
Ver también:
setDisplayPolicy, LegendDisplayPolicy
bool QwtLegend::eventFilter ( QObject ,
) [virtual]

Filters events if this object has been installed as an event filter for the watched object.

In your reimplementation of this function, if you want to filter the event e, out, i.e. stop it being handled further, return TRUE; otherwise return FALSE.


    class MyMainWindow : public QMainWindow
        MyMainWindow( QWidget *parent = 0, const char *name = 0 );

        bool eventFilter( QObject *obj, QEvent *ev );

        QTextEdit *textEdit;

    MyMainWindow::MyMainWindow( QWidget *parent, const char *name )
        : QMainWindow( parent, name )
        textEdit = new QTextEdit( this );
        setCentralWidget( textEdit );
        textEdit->installEventFilter( this );

    bool MyMainWindow::eventFilter( QObject *obj, QEvent *ev )
        if ( obj == textEdit ) {
            if ( e->type() == QEvent::KeyPress ) {
                QKeyEvent *k = (QKeyEvent*)ev;
                qDebug( "Ate key press %d", k->key() );
                return TRUE;
            } else {
                return FALSE;
        } else {
            // pass the event on to the parent class
            return QMainWindow::eventFilter( obj, ev );

Notice in the example above that unhandled events are passed to the base class's eventFilter() function, since the base class might have reimplemented eventFilter() for its own internal purposes.

If you delete the receiver object in this function, be sure to return TRUE. Otherwise, Qt will forward the event to the deleted object and the program might crash.
Ver también:

Reimplementado de QObject.

QWidget * QwtLegend::find ( const QwtLegendItemManager plotItem) const

Find the widget that represents a plot item

plotItemPlot item
Widget on the legend, or NULL
QwtLegendItemManager * QwtLegend::find ( const QWidget legendItem) const

Find the widget that represents a plot item

plotItemPlot item
Widget on the legend, or NULL
int QwtLegend::heightForWidth ( int  width) const [virtual]
The preferred height, for the width w.

Reimplementado de QWidget.

QScrollBar * QwtLegend::horizontalScrollBar ( ) const
int QwtLegend::identifierMode ( ) const
the IdentifierMode to be used in combination with LegendDisplayPolicy::Fixed.

Default is ShowLine | ShowSymbol | ShowText.

void QwtLegend::insert ( const QwtLegendItemManager plotItem,
QWidget legendItem 

Insert a new item for a plot item

plotItemPlot item
legendItemNew legend item
The parent of item will be changed to QwtLegend::contentsWidget()
bool QwtLegend::isEmpty ( void  ) const

Return true, if there are no legend items.

uint QwtLegend::itemCount ( ) const

Return the number of legend items.

QwtLegend::LegendItemMode QwtLegend::itemMode ( ) const
void QwtLegend::layoutContents ( ) [protected, virtual]

Adjust contents widget and item layout to the size of the viewport().

QValueList< QWidget * > QwtLegend::legendItems ( ) const [virtual]
void QwtLegend::remove ( const QwtLegendItemManager plotItem)

Find the corresponding item for a plotItem and remove it from the item list.

plotItemPlot item
void QwtLegend::resizeEvent ( QResizeEvent e) [protected, virtual]

Resize event


Reimplementado de QFrame.

void QwtLegend::setDisplayPolicy ( LegendDisplayPolicy  policy,
int  mode 

Set the legend display policy to:

policyLegend display policy
modeIdentifier mode (or'd ShowLine, ShowSymbol, ShowText)
Ver también:
displayPolicy, LegendDisplayPolicy
void QwtLegend::setItemMode ( LegendItemMode  mode)
QSize QwtLegend::sizeHint ( ) const [virtual]

Return a size hint.

Reimplementado de QFrame.

QScrollBar * QwtLegend::verticalScrollBar ( ) const

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'