ScalePicker Class Reference

Handles user interaction with a QwtScaleWidget. More...

`#include <ScalePicker.h>`

Inheritance diagram for ScalePicker:

## Signals

void | axisDblClicked (int)
void | axisRightClicked (int)
void | axisTicksDblClicked (int)
void | axisTitleDblClicked ()
void | axisTitleRightClicked ()
| Emitted when the user right-clicks on the title of an axis. More...
void | clicked ()
| Emitted when the user clicks on one of the monitored axes. More...

## Public Member Functions

QwtScaleWidget * | currentAxis ()
| Returns a pointer to the active axis in the plot layer. More...
void | deselect ()
bool | labelsSelected ()
Graph * | plot ()
| Return my parent casted to Graph. More...
void | refresh ()
| ScalePicker (Graph *plot)
QRect | scaleRect (const QwtScaleWidget *) const
| Returns the bounding rectangle of a scale without the title. More...
QRect | scaleTicksRect (const QwtScaleWidget *scale) const
| Returns the bounding rectangle of a scale excluding the title and the tick labels. More...
QwtScaleWidget * | selectedAxis ()
void | selectLabels (QwtScaleWidget *scale, bool select=true)
void | selectTitle (QwtScaleWidget *scale, bool select=true)
QRect | titleRect (const QwtScaleWidget *scale) const
| Returns the bounding rectangle of a scale's title. More...
bool | titleSelected ()

## Private Member Functions

bool | eventFilter (QObject *, QEvent *)
bool | labelClicked (const QwtScaleWidget *scale, const QPoint &pos)
void | mouseClicked (const QwtScaleWidget *scale, const QPoint &pos)
void | mouseDblClicked (const QwtScaleWidget *, const QPoint &)
void | mouseRightClicked (const QwtScaleWidget *scale, const QPoint &pos)

## Private Attributes

QwtScaleWidget * | d_current_axis
bool | d_labels_selected
QwtScaleWidget * | d_selected_axis
bool | d_title_selected

## Detailed Description

Handles user interaction with a QwtScaleWidget.

This class is used by Graph to catch events for the scales on its Plot. ScalePicker doesn't take any actions beyond emitting signals, which are then processed by Graph.

## Constructor & Destructor Documentation

## ScalePicker()

ScalePicker::ScalePicker | ( | Graph * | plot | ) |

References refresh().

## Member Function Documentation

## axisDblClicked

void ScalePicker::axisDblClicked | ( | int |  | ) |

signal

Emitted when the user double-clicks on an axis (but not its title). The argument specifies the axis' QwtScaleDraw::Alignment.

Referenced by currentAxis(), and mouseDblClicked().

## axisRightClicked

void ScalePicker::axisRightClicked | ( | int |  | ) |

signal

Emitted when the user right-clicks on an axis (but not its title). The argument specifies the axis' QwtScaleDraw::Alignment.

Referenced by currentAxis(), and mouseRightClicked().

## axisTicksDblClicked

void ScalePicker::axisTicksDblClicked | ( | int |  | ) |

signal

Emitted when the user double-clicks on the ticks of an axis. The argument specifies the axis' QwtScaleDraw::Alignment.

Referenced by currentAxis(), and mouseDblClicked().

## axisTitleDblClicked

void ScalePicker::axisTitleDblClicked | ( |  | ) |

signal

Emitted when the user double-clicks on an the axis title.

Referenced by currentAxis(), and mouseDblClicked().

## axisTitleRightClicked

void ScalePicker::axisTitleRightClicked | ( |  | ) |

signal

Emitted when the user right-clicks on the title of an axis.

Referenced by currentAxis(), and mouseRightClicked().

## clicked

void ScalePicker::clicked | ( |  | ) |

signal

Emitted when the user clicks on one of the monitored axes.

Referenced by currentAxis(), and eventFilter().

## currentAxis()

QwtScaleWidget* ScalePicker::currentAxis | ( |  | ) |

inline

Returns a pointer to the active axis in the plot layer.

References axisDblClicked(), axisRightClicked(), axisTicksDblClicked(), axisTitleDblClicked(), axisTitleRightClicked(), clicked(), d_current_axis, eventFilter(), labelClicked(), mouseClicked(), mouseDblClicked(), and mouseRightClicked().

Referenced by Graph::clearAxisTitle(), Graph::copyAxisTitle(), Graph::currentScale(), Graph::hideSelectedAxis(), Graph::removeAxisTitle(), Graph::showAxisDialog(), Graph::showGrids(), and Graph::showScaleDialog().

## deselect()

void ScalePicker::deselect | ( |  | ) |

References d_labels_selected, d_selected_axis, d_title_selected, and ScaleDraw::setSelected().

Referenced by Graph::deselect(), eventFilter(), plot(), Graph::select(), and Graph::setSelectedArrow().

## eventFilter()

bool ScalePicker::eventFilter | ( | QObject * | object,
|  | QEvent * | e
| ) |  |

private

References clicked(), d_current_axis, deselect(), labelClicked(), mouseDblClicked(), mouseRightClicked(), scaleTicksRect(), selectLabels(), selectTitle(), and titleRect().

Referenced by currentAxis().

## labelClicked()

bool ScalePicker::labelClicked | ( | const QwtScaleWidget * | scale,
|  | const QPoint & | pos
| ) |  |

private

References plot().

Referenced by currentAxis(), and eventFilter().

## labelsSelected()

bool ScalePicker::labelsSelected | ( |  | ) |

inline

References d_labels_selected, and selectLabels().

Referenced by Graph::setCurrentColor(), and Graph::setCurrentFont().

## mouseClicked()

void ScalePicker::mouseClicked | ( | const QwtScaleWidget * | scale,
|  | const QPoint & | pos
| ) |  |

private

Referenced by currentAxis().

## mouseDblClicked()

void ScalePicker::mouseDblClicked | ( | const QwtScaleWidget * | scale,
|  | const QPoint & | pos
| ) |  |

private

References axisDblClicked(), axisTicksDblClicked(), axisTitleDblClicked(), scaleRect(), scaleTicksRect(), and titleRect().

Referenced by currentAxis(), and eventFilter().

## mouseRightClicked()

void ScalePicker::mouseRightClicked | ( | const QwtScaleWidget * | scale,
|  | const QPoint & | pos
| ) |  |

private

References Graph::activateGraph(), axisRightClicked(), axisTitleRightClicked(), plot(), and scaleRect().

Referenced by currentAxis(), and eventFilter().

## plot()

Graph* ScalePicker::plot | ( |  | ) |

inline

Return my parent casted to Graph.

References deselect().

Referenced by labelClicked(), mouseRightClicked(), refresh(), selectLabels(), and selectTitle().

## refresh()

void ScalePicker::refresh | ( |  | ) |

Install myself as event filter for all axes of my parent. For every axis of plot(), add myself to the corresponding QwtScaleWidget.

See also
  QwtPlot::axisWidget()

References plot().

Referenced by Graph::enableAxis(), Graph::hideSelectedAxis(), Graph::plotPie(), ScalePicker(), and Graph::showAxis().

## scaleRect()

QRect ScalePicker::scaleRect | ( | const QwtScaleWidget * | scale | ) | const

Returns the bounding rectangle of a scale without the title.

Referenced by mouseDblClicked(), Graph::mousePressed(), and mouseRightClicked().

## scaleTicksRect()

QRect ScalePicker::scaleTicksRect | ( | const QwtScaleWidget * | scale | ) | const

Returns the bounding rectangle of a scale excluding the title and the tick labels.

Referenced by eventFilter(), and mouseDblClicked().

## selectedAxis()

QwtScaleWidget* ScalePicker::selectedAxis | ( |  | ) |

inline

Returns a pointer to the selected axis in the plot layer. The selected axis has selected title or selected tick labels (blue frame around texts).

References d_selected_axis.

Referenced by Graph::hasSeletedItems(), Graph::selectedScale(), Graph::setCurrentColor(), and Graph::setCurrentFont().

## selectLabels()

void ScalePicker::selectLabels | ( | QwtScaleWidget * | scale,
|  | bool | select = `true`
| ) |  |

References d_labels_selected, d_selected_axis, d_title_selected, Graph::deselect(), Graph::notifyColorChange(), Graph::notifyFontChange(), plot(), and ScaleDraw::setSelected().

Referenced by eventFilter(), labelsSelected(), and Graph::mousePressed().

## selectTitle()

void ScalePicker::selectTitle | ( | QwtScaleWidget * | scale,
|  | bool | select = `true`
| ) |  |

References d_labels_selected, d_selected_axis, d_title_selected, Graph::deselect(), Graph::notifyColorChange(), Graph::notifyFontChange(), and plot().

Referenced by eventFilter(), Graph::mousePressed(), and titleSelected().

## titleRect()

QRect ScalePicker::titleRect | ( | const QwtScaleWidget * | scale | ) | const

Returns the bounding rectangle of a scale's title.

Referenced by Graph::axisTitleRect(), eventFilter(), and mouseDblClicked().

## titleSelected()

bool ScalePicker::titleSelected | ( |  | ) |

inline

References d_title_selected, and selectTitle().

Referenced by Graph::axisTitleSelected(), Graph::setCurrentColor(), and Graph::setCurrentFont().

## Member Data Documentation

## d_current_axis

QwtScaleWidget * ScalePicker::d_current_axis

private

Referenced by currentAxis(), and eventFilter().

## d_labels_selected

bool ScalePicker::d_labels_selected

private

Referenced by deselect(), labelsSelected(), selectLabels(), and selectTitle().

## d_selected_axis

QwtScaleWidget* ScalePicker::d_selected_axis

private

Referenced by deselect(), selectedAxis(), selectLabels(), and selectTitle().

## d_title_selected

bool ScalePicker::d_title_selected

private

Referenced by deselect(), selectLabels(), selectTitle(), and titleSelected().

The documentation for this class was generated from the following files:

- qtiplot/src/plot2D/ScalePicker.h
- qtiplot/src/plot2D/ScalePicker.cpp