BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
MaskAllView.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/MaskWidgets/MaskAllView.cpp
6 //! @brief Implements MaskAllView 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 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
18 #include <QBrush>
19 #include <QPainter>
20 #include <QStyleOptionGraphicsItem>
21 
23 {
24  setFlag(QGraphicsItem::ItemIsSelectable);
25 }
26 
28 {
29  // prepareGeometryChange();
31  update();
32 }
33 
34 void MaskAllView::paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*)
35 {
36  // painter->setRenderHints(QPainter::Antialiasing);
37  QColor color(250, 250, 240, 150);
38  painter->setBrush(color);
39  painter->drawRect(m_bounding_rect);
40 
41  if (isSelected()) {
42  QPen pen;
43  pen.setStyle(Qt::DashLine);
44  painter->setPen(pen);
45  painter->setBrush(Qt::NoBrush);
46  painter->drawRect(m_bounding_rect);
47  }
48 }
Defines class ColorMapSceneAdaptor.
Defines MaskAllView class.
Defines MaskItems classes.
virtual const QRectF & viewportRectangle() const
returns viewport rectangle in scene coordinates
Definition: ISceneAdaptor.h:39
const ISceneAdaptor * m_adaptor
Definition: IShape2DView.h:66
QRectF m_bounding_rect
Definition: IShape2DView.h:67
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
Definition: MaskAllView.cpp:34
virtual void update_view()
Definition: MaskAllView.cpp:27