#include <qwt_legend.h>
Signals | |
void | pressed (int index) |
void | clicked (int index) |
Public Methods | |
QwtLegend (QWidget *w=0, const char *name=0) | |
~QwtLegend () | |
bool | insertItem (const QString &txt, const QwtSymbol &s, const QPen &p, long key, uint index) |
uint | appendItem (const QString &txt, const QwtSymbol &s, const QPen &p, long key) |
bool | setText (uint index, const QString &s) |
bool | setSymbol (uint index, const QwtSymbol &s) |
bool | setPen (uint index, const QPen &pn) |
bool | setKey (uint index, long key) |
long | key (uint index) const |
bool | removeItem (uint index) |
void | setMaxCols (int columns) |
int | maxCols () const |
void | setMaxRows (int rows) |
int | maxRows () const |
int | colWidth () const |
int | rowHeight () const |
void | clear () |
QSize | sizeHint () const |
QSize | cellSizeHint (const QFontMetrics &) const |
uint | itemCnt () const |
uint | findFirstKey (long key) |
Protected Methods | |
virtual void | paintCell (QPainter *p, int row, int col, const QRect &, bool selected) |
virtual void | contentsMousePressEvent (QMouseEvent *e) |
virtual void | contentsMouseReleaseEvent (QMouseEvent *e) |
virtual QWidget * | createEditor (int row, int col, bool initFromCell) const |
virtual void | resizeEvent (QResizeEvent *) |
void | resizeCells () |
void | resizeTable () |
void | updateTable () |
virtual void | fontChange (const QFont &oldFont) |
Protected Attributes | |
QList< QwtLegendItem > | d_item |
The QwtLegend widget is a tabular arrangement of cells, called legend items, which consist of a label, a line a symbol, and a key of type long as an identifier. The symbol is drawn on top of the line at the left side of the label. An item's property can be accessed using the item's index, which is independent of the key. The cells can be arranged in row or column order with QwtLegend::setMaxRows or QwtLegend::setMaxCols. Scrollbars are displayed automatically if the cells don't fit into the widget area.
|
Constructor.
|
|
Destructor.
|
|
Append a new item to the legend.
|
|
a size hint for each cell for given font metrics.
|
|
Remove all items from a legend.
|
|
Emitted when the user clicks on an item.
|
|
the column width.
|
|
|
|
|
|
Empty implementation to disable QTable behaviour.
|
|
Find the index of an item with a specified key.
|
|
Notify a font change.
|
|
Insert a new item at a specified position.
|
|
the number of items.
|
|
Return an item's key.
|
|
Max. number of columns.
|
|
Max. number of rows.
|
|
Paint the contents of a cell.
|
|
Emitted when the user presses a mouse button down on an item.
|
|
Remove an item.
|
|
Resize the cells.
This function is called when an item has been inserted, removed or changed. It adjusts the dimensions of the table according to the layout policy and sets the cell dimensions such that all items fit into the cells. |
|
Reorganizes columns rows.
|
|
Update the table dimensions (rows x cols).
This function is called when an item has been appended or deleted or when the max. number of rows/columns has been changed. |
|
the row height.
|
|
Change the key of an item.
|
|
Set the maximum number of columns and the layout policy.
The setMaxCols and setMaxRows members determine in which order the cells are arranged in the table. If a maximum number of columns is set, the legend items will be arranged in rows from the left to the right, starting at the first row, and beginning a new row when the actual number of columns has reached that maximum. The number of rows is thereby unlimited. The default setting is a maximum of 5 columns with an unlimited number of rows.
|
|
Specify the maximum number of rows and the layout policy.
The setMaxRows and setMaxCols members determine in which order the cells are arranged in the table. If a maximum number of rows is set, the legend items will be arranged in columns from the top to the bottom, starting at the first column, and beginning a new column when the actual number or rows has reached that maximum. The number of columns is thereby unlimited. The default setting is a maximum of 5 columns with an unlimited number of rows.
|
|
Change the line pen of an item.
|
|
Change the symbol of an item.
|
|
Change the label of an item.
|
|
a size hint.
|
|
Update the cell dimendions and the table dimensions.
This function combines QwtLegend::resizeCells() and QwtLegend::resizeTable() |