7 #include "BackgroundStateAbstractBase.h" 9 #include "EngaugeAssert.h" 10 #include "GraphicsItemType.h" 11 #include "GraphicsScene.h" 22 m_imageItem = m_scene.addPixmap (dummy);
23 m_imageItem->setVisible (
false);
24 m_imageItem->setData (DATA_KEY_IDENTIFIER,
"view");
25 m_imageItem->setData (DATA_KEY_GRAPHICS_ITEM_TYPE, GRAPHICS_ITEM_TYPE_IMAGE);
28 BackgroundStateAbstractBase::~BackgroundStateAbstractBase()
64 m_imageItem->setVisible (visible);
69 LOG4CPP_INFO_S ((*mainCat)) <<
"BackgroundStateAbstractBase::setProcessedPixmap" 70 <<
" map=(" << pixmap.width() <<
"x" << pixmap.height() <<
")";
72 ENGAUGE_CHECK_PTR(m_imageItem);
74 m_imageItem->setPixmap (pixmap);
77 m_scene.setSceneRect (m_imageItem->boundingRect ());
79 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.