SciDAVis
1.D4
|
Handles user interaction with a QwtScaleWidget. More...
#include <ScalePicker.h>
Signals | |
void | axisDblClicked (int) |
void | axisRightClicked (int) |
void | axisTitleRightClicked (int) |
void | clicked () |
Emitted when the user clicks on one of the monitored axes. | |
void | rightAxisTitleDblClicked () |
void | topAxisTitleDblClicked () |
void | xAxisTitleDblClicked () |
void | yAxisTitleDblClicked () |
Public Member Functions | |
QwtScaleWidget * | currentAxis () |
Returns a pointer to the active axis in the plot layer. | |
void | deselect () |
Graph * | graph () |
bool | labelsSelected () |
QwtPlot * | plot () |
Return my parent casted to QwtPlot. | |
void | refresh () |
ScalePicker (QwtPlot *plot) | |
QRect | scaleRect (const QwtScaleWidget *) const |
Returns the bounding rectangle of a scale without the title. | |
QRect | scaleTicksRect (const QwtScaleWidget *scale) const |
Returns the bounding rectangle of a scale excluding the title and the tick labels. | |
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. | |
bool | titleSelected () |
Private Member Functions | |
bool | eventFilter (QObject *, QEvent *) |
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 |
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.
ScalePicker::ScalePicker | ( | QwtPlot * | plot | ) |
References refresh().
|
signal |
Emitted when the user double-clicks on an axis (but not its title). The argument specifies the axis' QwtScaleDraw::Alignment.
Referenced by mouseDblClicked().
|
signal |
Emitted when the user right-clicks on an axis (but not its title). The argument specifies the axis' QwtScaleDraw::Alignment.
Referenced by mouseRightClicked().
|
signal |
Emitted when the user right-clicks on the title of an axis. The argument specifies the axis' QwtScaleDraw::Alignment.
Referenced by mouseRightClicked().
|
signal |
Emitted when the user clicks on one of the monitored axes.
Referenced by eventFilter(), and mouseRightClicked().
|
inline |
Returns a pointer to the active axis in the plot layer.
References d_current_axis.
void ScalePicker::deselect | ( | ) |
References d_labels_selected, d_selected_axis, and d_title_selected.
Referenced by Graph::deselect(), and eventFilter().
|
private |
References clicked(), d_current_axis, deselect(), mouseDblClicked(), mouseRightClicked(), scaleTicksRect(), selectLabels(), selectTitle(), and titleRect().
|
inline |
Referenced by selectLabels(), and selectTitle().
|
inline |
References d_labels_selected.
|
private |
|
private |
References axisDblClicked(), rightAxisTitleDblClicked(), scaleRect(), topAxisTitleDblClicked(), xAxisTitleDblClicked(), and yAxisTitleDblClicked().
Referenced by eventFilter().
|
private |
References axisRightClicked(), axisTitleRightClicked(), clicked(), and scaleRect().
Referenced by eventFilter().
|
inline |
Return my parent casted to QwtPlot.
Referenced by 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.
References plot().
Referenced by Graph::enableAxes(), Graph::enableAxis(), Graph::hideSelectedAxis(), Graph::plotPie(), ScalePicker(), and Graph::showAxis().
|
signal |
Emitted when the user double-clicks on an the right-axis title.
Referenced by mouseDblClicked().
QRect ScalePicker::scaleRect | ( | const QwtScaleWidget * | scale | ) | const |
Returns the bounding rectangle of a scale without the title.
Referenced by mouseDblClicked(), and mouseRightClicked().
QRect ScalePicker::scaleTicksRect | ( | const QwtScaleWidget * | scale | ) | const |
Returns the bounding rectangle of a scale excluding the title and the tick labels.
Referenced by eventFilter().
|
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.
void ScalePicker::selectLabels | ( | QwtScaleWidget * | scale, |
bool | select = true |
||
) |
References d_labels_selected, d_selected_axis, d_title_selected, Graph::deselect(), and graph().
Referenced by eventFilter().
void ScalePicker::selectTitle | ( | QwtScaleWidget * | scale, |
bool | select = true |
||
) |
References d_labels_selected, d_selected_axis, d_title_selected, Graph::deselect(), and graph().
Referenced by eventFilter().
QRect ScalePicker::titleRect | ( | const QwtScaleWidget * | scale | ) | const |
Returns the bounding rectangle of a scale's title.
Referenced by eventFilter().
|
inline |
References d_title_selected.
|
signal |
Emitted when the user double-clicks on an the top-axis title.
Referenced by mouseDblClicked().
|
signal |
Emitted when the user double-clicks on an the bottom-axis title.
Referenced by mouseDblClicked().
|
signal |
Emitted when the user double-clicks on an the left-axis title.
Referenced by mouseDblClicked().
|
private |
Referenced by currentAxis(), and eventFilter().
|
private |
Referenced by deselect(), labelsSelected(), selectLabels(), and selectTitle().
|
private |
Referenced by deselect(), selectedAxis(), selectLabels(), and selectTitle().
|
private |
Referenced by deselect(), selectLabels(), selectTitle(), and titleSelected().