BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
customplotproxywidget.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // qt-mvvm: Model-view-view-model framework for large GUI applications
4 //
5 //! @file mvvm/view/mvvm/plotting/customplotproxywidget.cpp
6 //! @brief Implements class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
16 #include <QEvent>
17 #include <QGraphicsScene>
18 #include <QGraphicsSceneMouseEvent>
19 #include <QGraphicsSceneWheelEvent>
20 #include <QWidget>
21 
22 using namespace ModelView;
23 
25 {
26  setWidget(colormap);
27  colormap->installEventFilter(this);
28 }
29 
30 //! Notifies all graphics items about axes viewport change in QCustomPlot.
31 //! Used in RegionOfInterestView to recalculate bounding box and scene positions depending on
32 //! current state of CustomPlotSceneAdapter.
33 
34 bool CustomPlotProxyWidget::eventFilter(QObject* /*object*/, QEvent* event)
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 }
43 
45 {
46  block_signals_to_proxy = value;
47 }
48 
49 void CustomPlotProxyWidget::mousePressEvent(QGraphicsSceneMouseEvent* event)
50 {
52  return;
53  QGraphicsProxyWidget::mousePressEvent(event);
54 }
55 
56 void CustomPlotProxyWidget::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
57 {
59  return;
60  QGraphicsProxyWidget::mouseMoveEvent(event);
61 }
62 
63 void CustomPlotProxyWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
64 {
66  return;
67  QGraphicsProxyWidget::mouseReleaseEvent(event);
68 }
69 
70 void CustomPlotProxyWidget::wheelEvent(QGraphicsSceneWheelEvent* event)
71 {
73  return;
74  QGraphicsProxyWidget::wheelEvent(event);
75 }
bool eventFilter(QObject *object, QEvent *event)
Notifies all graphics items about axes viewport change in QCustomPlot.
void wheelEvent(QGraphicsSceneWheelEvent *event)
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
void mousePressEvent(QGraphicsSceneMouseEvent *event)
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.