7 #include "BackgroundStateAbstractBase.h"
9 #include "EngaugeAssert.h"
10 #include "GraphicsItemType.h"
11 #include "GraphicsScene.h"
23 m_imageItem = m_scene.addPixmap (dummy);
24 m_imageItem->setVisible (
false);
25 m_imageItem->setZValue (Z_VALUE_BACKGROUND);
26 m_imageItem->setData (DATA_KEY_IDENTIFIER,
"view");
27 m_imageItem->setData (DATA_KEY_GRAPHICS_ITEM_TYPE, GRAPHICS_ITEM_TYPE_IMAGE);
30 BackgroundStateAbstractBase::~BackgroundStateAbstractBase()
66 m_imageItem->setVisible (visible);
71 LOG4CPP_INFO_S ((*mainCat)) <<
"BackgroundStateAbstractBase::setProcessedPixmap"
72 <<
" map=(" << pixmap.width() <<
"x" << pixmap.height() <<
")";
74 ENGAUGE_CHECK_PTR(m_imageItem);
76 m_imageItem->setPixmap (pixmap);
79 m_scene.setSceneRect (m_imageItem->boundingRect ());
81 m_image = pixmap.toImage();
QImage image() const
Image for the current state.
QGraphicsPixmapItem & imageItem() const
Graphics image item for the current state.
void setImageVisible(bool visible)
Show/hide background image.
void setProcessedPixmap(const QPixmap &pixmap)
Save the image for this state after it has been processed by the leaf class.
BackgroundStateAbstractBase(BackgroundStateContext &context, GraphicsScene &scene)
Single constructor.
BackgroundStateContext & context()
Reference to the BackgroundStateContext that contains all the BackgroundStateAbstractBase subclasses...
Context class that manages the background image state machine.
Add point and line handling to generic QGraphicsScene.
GraphicsScene & scene()
Reference to the GraphicsScene, without const.