ScalePicker Class Reference

Handles user interaction with a QwtScaleWidget. More...

#include <ScalePicker.h>

List of all members.

Signals

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

Public Member Functions

QwtScaleWidget * currentAxis ()
 Returns a pointer to the active axis in the plot layer.
void deselect ()
bool labelsSelected ()
Graphplot ()
 Return my parent casted to Graph.
void refresh ()
 ScalePicker (Graph *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

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 ( Graph plot  ) 

References refresh().


Member Function Documentation

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 mouseDblClicked().

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 mouseRightClicked().

void ScalePicker::axisTitleDblClicked (  )  [signal]

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

Referenced by mouseDblClicked().

void ScalePicker::axisTitleRightClicked (  )  [signal]

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

Referenced by mouseRightClicked().

void ScalePicker::clicked (  )  [signal]

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

Referenced by eventFilter().

QwtScaleWidget* ScalePicker::currentAxis (  )  [inline]
void ScalePicker::deselect (  ) 
bool ScalePicker::eventFilter ( QObject *  object,
QEvent *  e 
) [private]
bool ScalePicker::labelsSelected (  )  [inline]

References d_labels_selected.

Referenced by Graph::setCurrentFont().

void ScalePicker::mouseClicked ( const QwtScaleWidget *  scale,
const QPoint &  pos 
) [private]
void ScalePicker::mouseDblClicked ( const QwtScaleWidget *  scale,
const QPoint &  pos 
) [private]
void ScalePicker::mouseRightClicked ( const QwtScaleWidget *  scale,
const QPoint &  pos 
) [private]
Graph* ScalePicker::plot (  )  [inline]

Return my parent casted to Graph.

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

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().

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().

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(), and Graph::setCurrentFont().

void ScalePicker::selectLabels ( QwtScaleWidget *  scale,
bool  select = true 
)
void ScalePicker::selectTitle ( QwtScaleWidget *  scale,
bool  select = true 
)
QRect ScalePicker::titleRect ( const QwtScaleWidget *  scale  )  const

Returns the bounding rectangle of a scale's title.

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

bool ScalePicker::titleSelected (  )  [inline]

Member Data Documentation

QwtScaleWidget * ScalePicker::d_current_axis [private]

Referenced by currentAxis(), and eventFilter().

QwtScaleWidget* ScalePicker::d_selected_axis [private]

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

Generated by  doxygen 1.6.2