26 #ifndef QCP_ITEM_PIXMAP_H
27 #define QCP_ITEM_PIXMAP_H
29 #include "../global.h"
39 Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
40 Q_PROPERTY(
bool scaled READ scaled WRITE setScaled)
41 Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode)
42 Q_PROPERTY(Qt::TransformationMode transformationMode READ transformationMode)
43 Q_PROPERTY(QPen pen READ pen WRITE setPen)
44 Q_PROPERTY(QPen selectedPen READ selectedPen WRITE setSelectedPen)
51 QPixmap pixmap()
const {
return mPixmap; }
52 bool scaled()
const {
return mScaled; }
53 Qt::AspectRatioMode aspectRatioMode()
const {
return mAspectRatioMode; }
54 Qt::TransformationMode transformationMode()
const {
return mTransformationMode; }
55 QPen pen()
const {
return mPen; }
56 QPen selectedPen()
const {
return mSelectedPen; }
59 void setPixmap(
const QPixmap &pixmap);
60 void setScaled(
bool scaled, Qt::AspectRatioMode aspectRatioMode=Qt::KeepAspectRatio, Qt::TransformationMode transformationMode=Qt::SmoothTransformation);
61 void setPen(
const QPen &pen);
62 void setSelectedPen(
const QPen &pen);
65 virtual double selectTest(
const QPointF &pos,
bool onlySelectable, QVariant *details=0)
const;
77 enum AnchorIndex {aiTop, aiTopRight, aiRight, aiBottom, aiBottomLeft, aiLeft};
81 QPixmap mScaledPixmap;
83 Qt::AspectRatioMode mAspectRatioMode;
84 Qt::TransformationMode mTransformationMode;
85 QPen mPen, mSelectedPen;
92 void updateScaledPixmap(QRect finalRect=QRect(),
bool flipHorz=
false,
bool flipVert=
false);
93 QRect getFinalRect(
bool *flippedHorz=0,
bool *flippedVert=0)
const;
97 #endif // QCP_ITEM_PIXMAP_H
virtual QPointF anchorPixelPoint(int anchorId) const
Definition: item.cpp:1253
Manages the position of an item.
Definition: item.h:76
An arbitrary pixmap.
Definition: item-pixmap.h:35
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition: core.h:42
QPainter subclass used internally.
Definition: painter.h:111
An anchor of an item to which positions can be attached to.
Definition: item.h:39
The abstract base class for all items in a plot.
Definition: item.h:143
virtual void draw(QCPPainter *painter)=0
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const =0