地面站终端 App
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
3.4 KiB

15 years ago
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_LEGEND_H
#define QWT_LEGEND_H
#include "qwt_global.h"
#include "qwt_abstract_legend.h"
#include <qvariant.h>
15 years ago
class QScrollBar;
/*!
\brief 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 QwtLegendLabel.
15 years ago
\sa QwtLegendLabel, QwtPlotItem, QwtPlot
15 years ago
*/
class QWT_EXPORT QwtLegend : public QwtAbstractLegend
15 years ago
{
Q_OBJECT
public:
explicit QwtLegend( QWidget *parent = NULL );
virtual ~QwtLegend();
15 years ago
void setMaxColumns( uint numColums );
uint maxColumns() const;
15 years ago
void setDefaultItemMode( QwtLegendData::Mode );
QwtLegendData::Mode defaultItemMode() const;
15 years ago
QWidget *contentsWidget();
const QWidget *contentsWidget() const;
15 years ago
QWidget *legendWidget( const QVariant & ) const;
QList<QWidget *> legendWidgets( const QVariant & ) const;
15 years ago
QVariant itemInfo( const QWidget * ) const;
15 years ago
virtual bool eventFilter( QObject *, QEvent * );
15 years ago
virtual QSize sizeHint() const;
virtual int heightForWidth( int w ) const;
QScrollBar *horizontalScrollBar() const;
QScrollBar *verticalScrollBar() const;
15 years ago
virtual void renderLegend( QPainter *,
const QRectF &, bool fillBackground ) const;
15 years ago
virtual void renderItem( QPainter *,
const QWidget *, const QRectF &, bool fillBackground ) const;
15 years ago
virtual bool isEmpty() const;
virtual int scrollExtent( Qt::Orientation ) const;
15 years ago
Q_SIGNALS:
/*!
A signal which is emitted when the user has clicked on
a legend label, which is in QwtLegendData::Clickable mode.
15 years ago
\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
15 years ago
\note clicks are disabled as default
\sa setDefaultItemMode(), defaultItemMode(), QwtPlot::itemToInfo()
*/
void clicked( const QVariant &itemInfo, int index );
15 years ago
/*!
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
15 years ago
\note clicks are disabled as default
\sa setDefaultItemMode(), defaultItemMode(), QwtPlot::itemToInfo()
*/
void checked( const QVariant &itemInfo, bool on, int index );
15 years ago
public Q_SLOTS:
virtual void updateLegend( const QVariant &,
const QList<QwtLegendData> & );
15 years ago
protected Q_SLOTS:
void itemClicked();
void itemChecked( bool );
15 years ago
protected:
virtual QWidget *createWidget( const QwtLegendData & ) const;
virtual void updateWidget( QWidget *widget, const QwtLegendData &data );
15 years ago
private:
void updateTabOrder();
15 years ago
class PrivateData;
PrivateData *d_data;
};
#endif