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);
28BackgroundStateAbstractBase::~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();
BackgroundStateAbstractBase(BackgroundStateContext &context, GraphicsScene &scene)
Single constructor.
QGraphicsPixmapItem & imageItem() const
Graphics image item for the current state.
GraphicsScene & scene()
Reference to the GraphicsScene, without const.
BackgroundStateContext & context()
Reference to the BackgroundStateContext that contains all the BackgroundStateAbstractBase subclasses,...
void setImageVisible(bool visible)
Show/hide background image.
QImage image() const
Image for the current state.
void setProcessedPixmap(const QPixmap &pixmap)
Save the image for this state after it has been processed by the leaf class.
Context class that manages the background image state machine.
Add point and line handling to generic QGraphicsScene.