Skip to main content

VerticalAxisWidget

VerticalAxisWidget

Widget that renders a vertical axis for plots. More…

#include <VerticalAxisWidget.hpp>

Inherits from QWidget

Public Types

Name
using std::function< std::pair< double, double >()> RangeGetter
Type alias for a function that returns the current min/max range.

Public Functions

Name
VerticalAxisWidget(QWidget * parent =[nullptr])
Construct a VerticalAxisWidget.
~VerticalAxisWidget() override =default
void setRangeGetter(RangeGetter getter)
Set the function to get the current range.
void setRange(double min, double max)
Set the range directly (for simple cases).
void setAxisMapping(CorePlotting::AxisMapping mapping)
Set an AxisMapping to control label formatting and domain interpretation.
void clearAxisMapping()
Clear any previously set AxisMapping, reverting to default formatting.
CorePlotting::AxisMapping const * axisMapping() const
Get the current AxisMapping, if any.
void setInverted(bool inverted)
Set whether the Y axis is inverted (min at top, max at bottom).
bool isInverted() const
Check whether the Y axis is currently inverted.
void setDisplayMode(Neuralyzer::Plots::AxisDisplayMode mode)
Set plot or ruler display mode.
void setThickness(int px)
Set the widget thickness in pixels.
void setShowExtentLabels(bool show)
Show or hide min/max extent labels.
void setNegativeLabelColor(QColor color)
Set the color used for negative tick values and labels.
void setTickConfig(Neuralyzer::Plots::AxisTickConfig config)
Set tick generation configuration.
template <typename SenderType >
void
connectToRangeChanged(SenderType * sender, void(SenderType::*)() signal)
Connect to a QObject signal that indicates range changes.
QSize sizeHint() const override
Suggested width for the axis widget.

Protected Functions

Name
void paintEvent(QPaintEvent * event) override

Detailed Description

class VerticalAxisWidget;

Widget that renders a vertical axis for plots.

Shows:

  • Value range (e.g., 0 to 100)
  • Tick marks at regular intervals
  • Labels for major ticks
  • Updates when range changes

Public Types Documentation

using RangeGetter

using VerticalAxisWidget::RangeGetter =  std::function<std::pair<double, double>()>;

Type alias for a function that returns the current min/max range.

Public Functions Documentation

function VerticalAxisWidget

explicit VerticalAxisWidget(
    QWidget * parent =nullptr
)

Construct a VerticalAxisWidget.

Parameters:

  • parent Parent widget

function ~VerticalAxisWidget

~VerticalAxisWidget() override =default

function setRangeGetter

void setRangeGetter(
    RangeGetter getter
)

Set the function to get the current range.

Parameters:

  • getter Function that returns (min, max) pair

function setRange

void setRange(
    double min,
    double max
)

Set the range directly (for simple cases).

Parameters:

  • min Minimum value
  • max Maximum value

function setAxisMapping

void setAxisMapping(
    CorePlotting::AxisMapping mapping
)

Set an AxisMapping to control label formatting and domain interpretation.

Parameters:

  • mapping The axis mapping describing world↔︎domain↔︎label relationships

When set, the RangeGetter/setRange values are interpreted as domain values. The AxisMapping’s formatLabel is used for tick labels instead of the default decimal formatting.

function clearAxisMapping

void clearAxisMapping()

Clear any previously set AxisMapping, reverting to default formatting.

function axisMapping

CorePlotting::AxisMapping const * axisMapping() const

Get the current AxisMapping, if any.

Return: Pointer to the mapping, or nullptr if none set

function setInverted

void setInverted(
    bool inverted
)

Set whether the Y axis is inverted (min at top, max at bottom).

Parameters:

  • inverted true to invert the Y axis

When inverted, the axis displays like image coordinates where Y=0 is at the top and Y increases downward. This matches the convention used by MediaWidget and is appropriate for spatial data (points, masks, lines) derived from image frames.

function isInverted

bool isInverted() const

Check whether the Y axis is currently inverted.

Return: true if the axis is inverted (min at top, max at bottom)

function setDisplayMode

void setDisplayMode(
    Neuralyzer::Plots::AxisDisplayMode mode
)

Set plot or ruler display mode.

Parameters:

  • mode Display mode

function setThickness

void setThickness(
    int px
)

Set the widget thickness in pixels.

Parameters:

  • px Width in pixels

function setShowExtentLabels

void setShowExtentLabels(
    bool show
)

Show or hide min/max extent labels.

Parameters:

  • show Whether to show extent labels

function setNegativeLabelColor

void setNegativeLabelColor(
    QColor color
)

Set the color used for negative tick values and labels.

Parameters:

  • color Label and tick color when value < 0

function setTickConfig

void setTickConfig(
    Neuralyzer::Plots::AxisTickConfig config
)

Set tick generation configuration.

Parameters:

  • config Tick spacing configuration

function connectToRangeChanged

template <typename SenderType >
inline void connectToRangeChanged(
    SenderType * sender,
    void(SenderType::*)() signal
)

Connect to a QObject signal that indicates range changes.

Parameters:

  • sender Object that emits the signal
  • signal Pointer to the signal member function

Template Parameters:

  • SenderType Type of the sender object

When the signal is emitted, the widget will call the RangeGetter to get the updated range and repaint.

function sizeHint

QSize sizeHint() const override

Suggested width for the axis widget.

Protected Functions Documentation

function paintEvent

void paintEvent(
    QPaintEvent * event
) override

Updated on 2026-11-13 at 20:25:39 +0000