Qwt User's Guide: qwt_legend.h Source File

- Main Page
- Classes
- Files
- Related Pages

- File List
- File Members

# qwt_legend.h

    00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
    00002  * Qwt Widget Library
    00003  * Copyright (C) 1997   Josef Wilgen
    00004  * Copyright (C) 2002   Uwe Rathmann
    00005  *
    00006  * This library is free software; you can redistribute it and/or
    00007  * modify it under the terms of the Qwt License, Version 1.0
    00008  *****************************************************************************/
    00009
    00010 // vim: expandtab
    00011
    00012 #ifndef QWT_LEGEND_H
    00013 #define QWT_LEGEND_H
    00014
    00015 #include <qframe.h>
    00016 #include "qwt_global.h"
    00017 #if QT_VERSION < 0x040000
    00018 #include <qvaluelist.h>
    00019 #else
    00020 #include <qlist.h>
    00021 #endif
    00022
    00023 class QScrollBar;
    00024 class QwtLegendItemManager;
    00025
    00036 class QWT_EXPORT QwtLegend : public QFrame
    00037 {
    00038     Q_OBJECT
    00039
    00040 public:
    00062     enum LegendDisplayPolicy
    00063     {
    00064         NoIdentifier = 0,
    00065         FixedIdentifier = 1,
    00066         AutoIdentifier = 2
    00067     };
    00068
    00070     enum LegendItemMode
    00071     {
    00072         ReadOnlyItem,
    00073         ClickableItem,
    00074         CheckableItem
    00075     };
    00076
    00077     explicit QwtLegend(QWidget *parent = NULL);
    00078     virtual ~QwtLegend();
    00079
    00080     void setDisplayPolicy(LegendDisplayPolicy policy, int mode);
    00081     LegendDisplayPolicy displayPolicy() const;
    00082
    00083     void setItemMode(LegendItemMode);
    00084     LegendItemMode itemMode() const;
    00085
    00086     int identifierMode() const;
    00087
    00088     QWidget *contentsWidget();
    00089     const QWidget *contentsWidget() const;
    00090
    00091     void insert(const QwtLegendItemManager *, QWidget *);
    00092     void remove(const QwtLegendItemManager *);
    00093
    00094     QWidget *find(const QwtLegendItemManager *) const;
    00095     QwtLegendItemManager *find(const QWidget *) const;
    00096
    00097 #if QT_VERSION < 0x040000
    00098     virtual QValueList<QWidget *> legendItems() const;
    00099 #else
    00100     virtual QList<QWidget *> legendItems() const;
    00101 #endif
    00102
    00103     void clear();
    00104
    00105     bool isEmpty() const;
    00106     uint itemCount() const;
    00107
    00108     virtual bool eventFilter(QObject *, QEvent *);
    00109
    00110     virtual QSize sizeHint() const;
    00111     virtual int heightForWidth(int w) const;
    00112
    00113     QScrollBar *horizontalScrollBar() const;
    00114     QScrollBar *verticalScrollBar() const;
    00115
    00116 protected:
    00117     virtual void resizeEvent(QResizeEvent *);
    00118     virtual void layoutContents();
    00119
    00120 private:
    00121     class PrivateData;
    00122     PrivateData *d_data;
    00123 };
    00124
    00125 #endif // QWT_LEGEND_H