BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ModelView::CustomPlotProxyWidget Class Reference

Custom proxy widget to embed color map in graphics scene. More...

Inheritance diagram for ModelView::CustomPlotProxyWidget:
[legend]
Collaboration diagram for ModelView::CustomPlotProxyWidget:
[legend]

Public Member Functions

 CustomPlotProxyWidget (QWidget *colormap)
 
bool eventFilter (QObject *object, QEvent *event)
 Notifies all graphics items about axes viewport change in QCustomPlot. More...
 
void setBlockSignalsToProxy (bool value)
 

Protected Member Functions

void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
 
void mousePressEvent (QGraphicsSceneMouseEvent *event)
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
 
void wheelEvent (QGraphicsSceneWheelEvent *event)
 

Private Attributes

bool block_signals_to_proxy {false}
 

Detailed Description

Custom proxy widget to embed color map in graphics scene.

Definition at line 27 of file customplotproxywidget.h.

Constructor & Destructor Documentation

◆ CustomPlotProxyWidget()

CustomPlotProxyWidget::CustomPlotProxyWidget ( QWidget *  colormap)

Definition at line 24 of file customplotproxywidget.cpp.

25 {
26  setWidget(colormap);
27  colormap->installEventFilter(this);
28 }

Member Function Documentation

◆ eventFilter()

bool CustomPlotProxyWidget::eventFilter ( QObject *  object,
QEvent *  event 
)

Notifies all graphics items about axes viewport change in QCustomPlot.

Used in RegionOfInterestView to recalculate bounding box and scene positions depending on current state of CustomPlotSceneAdapter.

Definition at line 34 of file customplotproxywidget.cpp.

35 {
36  // catching zoom/resize events in QCustomPlot
37  if (event->type() == QEvent::Resize || event->type() == QEvent::UpdateRequest) {
38  scene()->advance(); // notifying all graphics items
39  return false;
40  }
41  return true;
42 }

◆ mouseMoveEvent()

void CustomPlotProxyWidget::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
protected

Definition at line 56 of file customplotproxywidget.cpp.

57 {
59  return;
60  QGraphicsProxyWidget::mouseMoveEvent(event);
61 }

References block_signals_to_proxy.

◆ mousePressEvent()

void CustomPlotProxyWidget::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protected

Definition at line 49 of file customplotproxywidget.cpp.

50 {
52  return;
53  QGraphicsProxyWidget::mousePressEvent(event);
54 }

References block_signals_to_proxy.

◆ mouseReleaseEvent()

void CustomPlotProxyWidget::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
protected

Definition at line 63 of file customplotproxywidget.cpp.

64 {
66  return;
67  QGraphicsProxyWidget::mouseReleaseEvent(event);
68 }

References block_signals_to_proxy.

◆ setBlockSignalsToProxy()

void CustomPlotProxyWidget::setBlockSignalsToProxy ( bool  value)

Definition at line 44 of file customplotproxywidget.cpp.

45 {
46  block_signals_to_proxy = value;
47 }

References block_signals_to_proxy.

◆ wheelEvent()

void CustomPlotProxyWidget::wheelEvent ( QGraphicsSceneWheelEvent *  event)
protected

Definition at line 70 of file customplotproxywidget.cpp.

71 {
73  return;
74  QGraphicsProxyWidget::wheelEvent(event);
75 }

References block_signals_to_proxy.

Member Data Documentation

◆ block_signals_to_proxy

bool ModelView::CustomPlotProxyWidget::block_signals_to_proxy {false}
private

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