| OpenMS 2.5.0

Public Slots | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
HistogramWidget Class Reference
Visual

Widget which can visualize a histogram. More...

`#include <OpenMS/VISUAL/HistogramWidget.h>`

Inheritance diagram for HistogramWidget:

## Public Slots

void | showSplitters (bool on)
| Shows the splitters if `on` is true. Hides them otherwise. More...
void | setRightSplitter (double pos)
| Sets the value of the right splitter. More...
void | setLeftSplitter (double pos)
| Sets the value of the left splitter. More...
void | setLogMode (bool log_mode)
| Enables/disables log mode. More...

## Public Member Functions

| HistogramWidget (const Math::Histogram<> &distribution, QWidget *parent=nullptr)
| Constructor. More...
| ~HistogramWidget () override
| Destructor. More...
double | getLeftSplitter ()
| Returns the value f the lower splitter. More...
double | getRightSplitter ()
| Returns the value of the upper splitter. More...
void | setLegend (const String &legend)
| Set axis legends. More...

## Protected Slots

void | showContextMenu (const QPoint &pos)
| Context menu event. More...

## Protected Member Functions

void | invalidate_ ()
| Repaints the contents to the buffer and calls update() More...
reimplemented Qt events
void | paintEvent (QPaintEvent *) override
void | mousePressEvent (QMouseEvent *) override
void | mouseReleaseEvent (QMouseEvent *) override
void | mouseMoveEvent (QMouseEvent *) override
void | resizeEvent (QResizeEvent *) override

## Protected Attributes

Math::Histogram | dist_
| The histogram to display. More...
bool | show_splitters_
| Flag that indicates if splitters are shown. More...
double | left_splitter_
| Value of the right splitter. More...
double | right_splitter_
| Value of the right splitter. More...
UInt | moving_splitter_
| The splitter that is currently dragged (0=none, 1=left, 2=right) More...
AxisWidget * | bottom_axis_
| X axis. More...
UInt | margin_
| Margin around plot. More...
QPixmap | buffer_
| Internal buffer for the double buffering. More...
bool | log_mode_
| Flag that indicates the current mode. More...

## Detailed Description

Widget which can visualize a histogram.

It can also be used to define a left and right boundary inside the values. It supports normal and log scaling via the context menu.

## Constructor & Destructor Documentation

## ◆ HistogramWidget()

HistogramWidget | ( | const Math::Histogram<> & | distribution,
|  | QWidget * | parent = `nullptr`
| ) |  |

Constructor.

## ◆ ~HistogramWidget()

~HistogramWidget | ( |  | ) |

override

Destructor.

## Member Function Documentation

## ◆ getLeftSplitter()

double getLeftSplitter | ( |  | ) |

Returns the value f the lower splitter.

## ◆ getRightSplitter()

double getRightSplitter | ( |  | ) |

Returns the value of the upper splitter.

## ◆ invalidate_()

void invalidate_ | ( |  | ) |

protected

Repaints the contents to the buffer and calls update()

## ◆ mouseMoveEvent()

void mouseMoveEvent | ( | QMouseEvent * |  | ) |

override protected

## ◆ mousePressEvent()

void mousePressEvent | ( | QMouseEvent * |  | ) |

override protected

## ◆ mouseReleaseEvent()

void mouseReleaseEvent | ( | QMouseEvent * |  | ) |

override protected

## ◆ paintEvent()

void paintEvent | ( | QPaintEvent * |  | ) |

override protected

## ◆ resizeEvent()

void resizeEvent | ( | QResizeEvent * |  | ) |

override protected

## ◆ setLeftSplitter

void setLeftSplitter | ( | double | pos | ) |

slot

Sets the value of the left splitter.

## ◆ setLegend()

void setLegend | ( | const String & | legend | ) |

Set axis legends.

## ◆ setLogMode

void setLogMode | ( | bool | log_mode | ) |

slot

Enables/disables log mode.

## ◆ setRightSplitter

void setRightSplitter | ( | double | pos | ) |

slot

Sets the value of the right splitter.

## ◆ showContextMenu

void showContextMenu | ( | const QPoint & | pos | ) |

protected slot

Context menu event.

## ◆ showSplitters

void showSplitters | ( | bool | on | ) |

slot

Shows the splitters if `on` is true. Hides them otherwise.

## Member Data Documentation

## ◆ bottom_axis_

AxisWidget* bottom_axis_

protected

X axis.

## ◆ buffer_

QPixmap buffer_

protected

Internal buffer for the double buffering.

## ◆ dist_

Math::Histogram dist_

protected

The histogram to display.

## ◆ left_splitter_

double left_splitter_

protected

Value of the right splitter.

## ◆ log_mode_

bool log_mode_

protected

Flag that indicates the current mode.

## ◆ margin_

UInt margin_

protected

Margin around plot.

## ◆ moving_splitter_

UInt moving_splitter_

protected

The splitter that is currently dragged (0=none, 1=left, 2=right)

## ◆ right_splitter_

double right_splitter_

protected

Value of the right splitter.

## ◆ show_splitters_

bool show_splitters_

protected

Flag that indicates if splitters are shown.