ifw  0.0.1-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QCPTextElement Class Reference

A layout element displaying a text. More...

#include <qcustomplot.h>

Inheritance diagram for QCPTextElement:
QCPLayoutElement QCPLayoutElement QCPLayoutElement QCPLayoutElement QCPLayoutElement QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable QCPLayerable

Signals

void selectionChanged (bool selected)
 
void selectableChanged (bool selectable)
 
void clicked (QMouseEvent *event)
 
void doubleClicked (QMouseEvent *event)
 
void selectionChanged (bool selected)
 
void selectableChanged (bool selectable)
 
void clicked (QMouseEvent *event)
 
void doubleClicked (QMouseEvent *event)
 
void selectionChanged (bool selected)
 
void selectableChanged (bool selectable)
 
void clicked (QMouseEvent *event)
 
void doubleClicked (QMouseEvent *event)
 
void selectionChanged (bool selected)
 
void selectableChanged (bool selectable)
 
void clicked (QMouseEvent *event)
 
void doubleClicked (QMouseEvent *event)
 
void selectionChanged (bool selected)
 
void selectableChanged (bool selectable)
 
void clicked (QMouseEvent *event)
 
void doubleClicked (QMouseEvent *event)
 
- Signals inherited from QCPLayerable
void layerChanged (QCPLayer *newLayer)
 
void layerChanged (QCPLayer *newLayer)
 
void layerChanged (QCPLayer *newLayer)
 
void layerChanged (QCPLayer *newLayer)
 
void layerChanged (QCPLayer *newLayer)
 

Public Member Functions

 QCPTextElement (QCustomPlot *parentPlot)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text, double pointSize)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text, const QString &fontFamily, double pointSize)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text, const QFont &font)
 
QString text () const
 
int textFlags () const
 
QFont font () const
 
QColor textColor () const
 
QFont selectedFont () const
 
QColor selectedTextColor () const
 
bool selectable () const
 
bool selected () const
 
void setText (const QString &text)
 
void setTextFlags (int flags)
 
void setFont (const QFont &font)
 
void setTextColor (const QColor &color)
 
void setSelectedFont (const QFont &font)
 
void setSelectedTextColor (const QColor &color)
 
Q_SLOT void setSelectable (bool selectable)
 
Q_SLOT void setSelected (bool selected)
 
virtual double selectTest (const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
 
virtual void mousePressEvent (QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
 
virtual void mouseReleaseEvent (QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
 
virtual void mouseDoubleClickEvent (QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
 
 QCPTextElement (QCustomPlot *parentPlot)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text, double pointSize)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text, const QString &fontFamily, double pointSize)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text, const QFont &font)
 
QString text () const
 
int textFlags () const
 
QFont font () const
 
QColor textColor () const
 
QFont selectedFont () const
 
QColor selectedTextColor () const
 
bool selectable () const
 
bool selected () const
 
void setText (const QString &text)
 
void setTextFlags (int flags)
 
void setFont (const QFont &font)
 
void setTextColor (const QColor &color)
 
void setSelectedFont (const QFont &font)
 
void setSelectedTextColor (const QColor &color)
 
Q_SLOT void setSelectable (bool selectable)
 
Q_SLOT void setSelected (bool selected)
 
virtual double selectTest (const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
 
virtual void mousePressEvent (QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
 
virtual void mouseReleaseEvent (QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
 
virtual void mouseDoubleClickEvent (QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
 
 QCPTextElement (QCustomPlot *parentPlot)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text, double pointSize)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text, const QString &fontFamily, double pointSize)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text, const QFont &font)
 
QString text () const
 
int textFlags () const
 
QFont font () const
 
QColor textColor () const
 
QFont selectedFont () const
 
QColor selectedTextColor () const
 
bool selectable () const
 
bool selected () const
 
void setText (const QString &text)
 
void setTextFlags (int flags)
 
void setFont (const QFont &font)
 
void setTextColor (const QColor &color)
 
void setSelectedFont (const QFont &font)
 
void setSelectedTextColor (const QColor &color)
 
Q_SLOT void setSelectable (bool selectable)
 
Q_SLOT void setSelected (bool selected)
 
virtual double selectTest (const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
 
virtual void mousePressEvent (QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
 
virtual void mouseReleaseEvent (QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
 
virtual void mouseDoubleClickEvent (QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
 
 QCPTextElement (QCustomPlot *parentPlot)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text, double pointSize)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text, const QString &fontFamily, double pointSize)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text, const QFont &font)
 
QString text () const
 
int textFlags () const
 
QFont font () const
 
QColor textColor () const
 
QFont selectedFont () const
 
QColor selectedTextColor () const
 
bool selectable () const
 
bool selected () const
 
void setText (const QString &text)
 
void setTextFlags (int flags)
 
void setFont (const QFont &font)
 
void setTextColor (const QColor &color)
 
void setSelectedFont (const QFont &font)
 
void setSelectedTextColor (const QColor &color)
 
Q_SLOT void setSelectable (bool selectable)
 
Q_SLOT void setSelected (bool selected)
 
virtual double selectTest (const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
 
virtual void mousePressEvent (QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
 
virtual void mouseReleaseEvent (QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
 
virtual void mouseDoubleClickEvent (QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
 
 QCPTextElement (QCustomPlot *parentPlot)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text, double pointSize)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text, const QString &fontFamily, double pointSize)
 
 QCPTextElement (QCustomPlot *parentPlot, const QString &text, const QFont &font)
 
QString text () const
 
int textFlags () const
 
QFont font () const
 
QColor textColor () const
 
QFont selectedFont () const
 
QColor selectedTextColor () const
 
bool selectable () const
 
bool selected () const
 
void setText (const QString &text)
 
void setTextFlags (int flags)
 
void setFont (const QFont &font)
 
void setTextColor (const QColor &color)
 
void setSelectedFont (const QFont &font)
 
void setSelectedTextColor (const QColor &color)
 
Q_SLOT void setSelectable (bool selectable)
 
Q_SLOT void setSelected (bool selected)
 
virtual double selectTest (const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
 
virtual void mousePressEvent (QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
 
virtual void mouseReleaseEvent (QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
 
virtual void mouseDoubleClickEvent (QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
 
- Public Member Functions inherited from QCPLayoutElement
 QCPLayoutElement (QCustomPlot *parentPlot=0)
 
virtual ~QCPLayoutElement ()
 
QCPLayoutlayout () const
 
QRect rect () const
 
QRect outerRect () const
 
QMargins margins () const
 
QMargins minimumMargins () const
 
QCP::MarginSides autoMargins () const
 
QSize minimumSize () const
 
QSize maximumSize () const
 
SizeConstraintRect sizeConstraintRect () const
 
QCPMarginGroupmarginGroup (QCP::MarginSide side) const
 
QHash< QCP::MarginSide,
QCPMarginGroup * > 
marginGroups () const
 
void setOuterRect (const QRect &rect)
 
void setMargins (const QMargins &margins)
 
void setMinimumMargins (const QMargins &margins)
 
void setAutoMargins (QCP::MarginSides sides)
 
void setMinimumSize (const QSize &size)
 
void setMinimumSize (int width, int height)
 
void setMaximumSize (const QSize &size)
 
void setMaximumSize (int width, int height)
 
void setSizeConstraintRect (SizeConstraintRect constraintRect)
 
void setMarginGroup (QCP::MarginSides sides, QCPMarginGroup *group)
 
virtual void update (UpdatePhase phase)
 
virtual QList< QCPLayoutElement * > elements (bool recursive) const
 
 QCPLayoutElement (QCustomPlot *parentPlot=0)
 
virtual ~QCPLayoutElement ()
 
QCPLayoutlayout () const
 
QRect rect () const
 
QRect outerRect () const
 
QMargins margins () const
 
QMargins minimumMargins () const
 
QCP::MarginSides autoMargins () const
 
QSize minimumSize () const
 
QSize maximumSize () const
 
SizeConstraintRect sizeConstraintRect () const
 
QCPMarginGroupmarginGroup (QCP::MarginSide side) const
 
QHash< QCP::MarginSide,
QCPMarginGroup * > 
marginGroups () const
 
void setOuterRect (const QRect &rect)
 
void setMargins (const QMargins &margins)
 
void setMinimumMargins (const QMargins &margins)
 
void setAutoMargins (QCP::MarginSides sides)
 
void setMinimumSize (const QSize &size)
 
void setMinimumSize (int width, int height)
 
void setMaximumSize (const QSize &size)
 
void setMaximumSize (int width, int height)
 
void setSizeConstraintRect (SizeConstraintRect constraintRect)
 
void setMarginGroup (QCP::MarginSides sides, QCPMarginGroup *group)
 
virtual void update (UpdatePhase phase)
 
virtual QList< QCPLayoutElement * > elements (bool recursive) const
 
 QCPLayoutElement (QCustomPlot *parentPlot=0)
 
virtual ~QCPLayoutElement ()
 
QCPLayoutlayout () const
 
QRect rect () const
 
QRect outerRect () const
 
QMargins margins () const
 
QMargins minimumMargins () const
 
QCP::MarginSides autoMargins () const
 
QSize minimumSize () const
 
QSize maximumSize () const
 
SizeConstraintRect sizeConstraintRect () const
 
QCPMarginGroupmarginGroup (QCP::MarginSide side) const
 
QHash< QCP::MarginSide,
QCPMarginGroup * > 
marginGroups () const
 
void setOuterRect (const QRect &rect)
 
void setMargins (const QMargins &margins)
 
void setMinimumMargins (const QMargins &margins)
 
void setAutoMargins (QCP::MarginSides sides)
 
void setMinimumSize (const QSize &size)
 
void setMinimumSize (int width, int height)
 
void setMaximumSize (const QSize &size)
 
void setMaximumSize (int width, int height)
 
void setSizeConstraintRect (SizeConstraintRect constraintRect)
 
void setMarginGroup (QCP::MarginSides sides, QCPMarginGroup *group)
 
virtual void update (UpdatePhase phase)
 
virtual QList< QCPLayoutElement * > elements (bool recursive) const
 
 QCPLayoutElement (QCustomPlot *parentPlot=0)
 
virtual ~QCPLayoutElement ()
 
QCPLayoutlayout () const
 
QRect rect () const
 
QRect outerRect () const
 
QMargins margins () const
 
QMargins minimumMargins () const
 
QCP::MarginSides autoMargins () const
 
QSize minimumSize () const
 
QSize maximumSize () const
 
SizeConstraintRect sizeConstraintRect () const
 
QCPMarginGroupmarginGroup (QCP::MarginSide side) const
 
QHash< QCP::MarginSide,
QCPMarginGroup * > 
marginGroups () const
 
void setOuterRect (const QRect &rect)
 
void setMargins (const QMargins &margins)
 
void setMinimumMargins (const QMargins &margins)
 
void setAutoMargins (QCP::MarginSides sides)
 
void setMinimumSize (const QSize &size)
 
void setMinimumSize (int width, int height)
 
void setMaximumSize (const QSize &size)
 
void setMaximumSize (int width, int height)
 
void setSizeConstraintRect (SizeConstraintRect constraintRect)
 
void setMarginGroup (QCP::MarginSides sides, QCPMarginGroup *group)
 
virtual void update (UpdatePhase phase)
 
virtual QList< QCPLayoutElement * > elements (bool recursive) const
 
 QCPLayoutElement (QCustomPlot *parentPlot=0)
 
virtual ~QCPLayoutElement ()
 
QCPLayoutlayout () const
 
QRect rect () const
 
QRect outerRect () const
 
QMargins margins () const
 
QMargins minimumMargins () const
 
QCP::MarginSides autoMargins () const
 
QSize minimumSize () const
 
QSize maximumSize () const
 
SizeConstraintRect sizeConstraintRect () const
 
QCPMarginGroupmarginGroup (QCP::MarginSide side) const
 
QHash< QCP::MarginSide,
QCPMarginGroup * > 
marginGroups () const
 
void setOuterRect (const QRect &rect)
 
void setMargins (const QMargins &margins)
 
void setMinimumMargins (const QMargins &margins)
 
void setAutoMargins (QCP::MarginSides sides)
 
void setMinimumSize (const QSize &size)
 
void setMinimumSize (int width, int height)
 
void setMaximumSize (const QSize &size)
 
void setMaximumSize (int width, int height)
 
void setSizeConstraintRect (SizeConstraintRect constraintRect)
 
void setMarginGroup (QCP::MarginSides sides, QCPMarginGroup *group)
 
virtual void update (UpdatePhase phase)
 
virtual QList< QCPLayoutElement * > elements (bool recursive) const
 
- Public Member Functions inherited from QCPLayerable
 QCPLayerable (QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=0)
 
virtual ~QCPLayerable ()
 
bool visible () const
 
QCustomPlotparentPlot () const
 
QCPLayerableparentLayerable () const
 
QCPLayerlayer () const
 
bool antialiased () const
 
void setVisible (bool on)
 
Q_SLOT bool setLayer (QCPLayer *layer)
 
bool setLayer (const QString &layerName)
 
void setAntialiased (bool enabled)
 
bool realVisibility () const
 
 QCPLayerable (QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=0)
 
virtual ~QCPLayerable ()
 
bool visible () const
 
QCustomPlotparentPlot () const
 
QCPLayerableparentLayerable () const
 
QCPLayerlayer () const
 
bool antialiased () const
 
void setVisible (bool on)
 
Q_SLOT bool setLayer (QCPLayer *layer)
 
bool setLayer (const QString &layerName)
 
void setAntialiased (bool enabled)
 
bool realVisibility () const
 
 QCPLayerable (QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=0)
 
virtual ~QCPLayerable ()
 
bool visible () const
 
QCustomPlotparentPlot () const
 
QCPLayerableparentLayerable () const
 
QCPLayerlayer () const
 
bool antialiased () const
 
void setVisible (bool on)
 
Q_SLOT bool setLayer (QCPLayer *layer)
 
bool setLayer (const QString &layerName)
 
void setAntialiased (bool enabled)
 
bool realVisibility () const
 
 QCPLayerable (QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=0)
 
virtual ~QCPLayerable ()
 
bool visible () const
 
QCustomPlotparentPlot () const
 
QCPLayerableparentLayerable () const
 
QCPLayerlayer () const
 
bool antialiased () const
 
void setVisible (bool on)
 
Q_SLOT bool setLayer (QCPLayer *layer)
 
bool setLayer (const QString &layerName)
 
void setAntialiased (bool enabled)
 
bool realVisibility () const
 
 QCPLayerable (QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=0)
 
virtual ~QCPLayerable ()
 
bool visible () const
 
QCustomPlotparentPlot () const
 
QCPLayerableparentLayerable () const
 
QCPLayerlayer () const
 
bool antialiased () const
 
void setVisible (bool on)
 
Q_SLOT bool setLayer (QCPLayer *layer)
 
bool setLayer (const QString &layerName)
 
void setAntialiased (bool enabled)
 
bool realVisibility () const
 

Protected Member Functions

virtual void applyDefaultAntialiasingHint (QCPPainter *painter) const Q_DECL_OVERRIDE
 
virtual void draw (QCPPainter *painter) Q_DECL_OVERRIDE
 
virtual QSize minimumOuterSizeHint () const Q_DECL_OVERRIDE
 
virtual QSize maximumOuterSizeHint () const Q_DECL_OVERRIDE
 
virtual void selectEvent (QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) Q_DECL_OVERRIDE
 
virtual void deselectEvent (bool *selectionStateChanged) Q_DECL_OVERRIDE
 
QFont mainFont () const
 
QColor mainTextColor () const
 
virtual void applyDefaultAntialiasingHint (QCPPainter *painter) const Q_DECL_OVERRIDE
 
virtual void draw (QCPPainter *painter) Q_DECL_OVERRIDE
 
virtual QSize minimumOuterSizeHint () const Q_DECL_OVERRIDE
 
virtual QSize maximumOuterSizeHint () const Q_DECL_OVERRIDE
 
virtual void selectEvent (QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) Q_DECL_OVERRIDE
 
virtual void deselectEvent (bool *selectionStateChanged) Q_DECL_OVERRIDE
 
QFont mainFont () const
 
QColor mainTextColor () const
 
virtual void applyDefaultAntialiasingHint (QCPPainter *painter) const Q_DECL_OVERRIDE
 
virtual void draw (QCPPainter *painter) Q_DECL_OVERRIDE
 
virtual QSize minimumOuterSizeHint () const Q_DECL_OVERRIDE
 
virtual QSize maximumOuterSizeHint () const Q_DECL_OVERRIDE
 
virtual void selectEvent (QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) Q_DECL_OVERRIDE
 
virtual void deselectEvent (bool *selectionStateChanged) Q_DECL_OVERRIDE
 
QFont mainFont () const
 
QColor mainTextColor () const
 
virtual void applyDefaultAntialiasingHint (QCPPainter *painter) const Q_DECL_OVERRIDE
 
virtual void draw (QCPPainter *painter) Q_DECL_OVERRIDE
 
virtual QSize minimumOuterSizeHint () const Q_DECL_OVERRIDE
 
virtual QSize maximumOuterSizeHint () const Q_DECL_OVERRIDE
 
virtual void selectEvent (QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) Q_DECL_OVERRIDE
 
virtual void deselectEvent (bool *selectionStateChanged) Q_DECL_OVERRIDE
 
QFont mainFont () const
 
QColor mainTextColor () const
 
virtual void applyDefaultAntialiasingHint (QCPPainter *painter) const Q_DECL_OVERRIDE
 
virtual void draw (QCPPainter *painter) Q_DECL_OVERRIDE
 
virtual QSize minimumOuterSizeHint () const Q_DECL_OVERRIDE
 
virtual QSize maximumOuterSizeHint () const Q_DECL_OVERRIDE
 
virtual void selectEvent (QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) Q_DECL_OVERRIDE
 
virtual void deselectEvent (bool *selectionStateChanged) Q_DECL_OVERRIDE
 
QFont mainFont () const
 
QColor mainTextColor () const
 
- Protected Member Functions inherited from QCPLayoutElement
virtual int calculateAutoMargin (QCP::MarginSide side)
 
virtual void layoutChanged ()
 
virtual void parentPlotInitialized (QCustomPlot *parentPlot) Q_DECL_OVERRIDE
 
virtual int calculateAutoMargin (QCP::MarginSide side)
 
virtual void layoutChanged ()
 
virtual void parentPlotInitialized (QCustomPlot *parentPlot) Q_DECL_OVERRIDE
 
virtual int calculateAutoMargin (QCP::MarginSide side)
 
virtual void layoutChanged ()
 
virtual void parentPlotInitialized (QCustomPlot *parentPlot) Q_DECL_OVERRIDE
 
virtual int calculateAutoMargin (QCP::MarginSide side)
 
virtual void layoutChanged ()
 
virtual void parentPlotInitialized (QCustomPlot *parentPlot) Q_DECL_OVERRIDE
 
virtual int calculateAutoMargin (QCP::MarginSide side)
 
virtual void layoutChanged ()
 
virtual void parentPlotInitialized (QCustomPlot *parentPlot) Q_DECL_OVERRIDE
 
- Protected Member Functions inherited from QCPLayerable
virtual QCP::Interaction selectionCategory () const
 
virtual QRect clipRect () const
 
virtual void mouseMoveEvent (QMouseEvent *event, const QPointF &startPos)
 
virtual void wheelEvent (QWheelEvent *event)
 
void initializeParentPlot (QCustomPlot *parentPlot)
 
void setParentLayerable (QCPLayerable *parentLayerable)
 
bool moveToLayer (QCPLayer *layer, bool prepend)
 
void applyAntialiasingHint (QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const
 
virtual QCP::Interaction selectionCategory () const
 
virtual QRect clipRect () const
 
virtual void mouseMoveEvent (QMouseEvent *event, const QPointF &startPos)
 
virtual void wheelEvent (QWheelEvent *event)
 
void initializeParentPlot (QCustomPlot *parentPlot)
 
void setParentLayerable (QCPLayerable *parentLayerable)
 
bool moveToLayer (QCPLayer *layer, bool prepend)
 
void applyAntialiasingHint (QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const
 
virtual QCP::Interaction selectionCategory () const
 
virtual QRect clipRect () const
 
virtual void mouseMoveEvent (QMouseEvent *event, const QPointF &startPos)
 
virtual void wheelEvent (QWheelEvent *event)
 
void initializeParentPlot (QCustomPlot *parentPlot)
 
void setParentLayerable (QCPLayerable *parentLayerable)
 
bool moveToLayer (QCPLayer *layer, bool prepend)
 
void applyAntialiasingHint (QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const
 
virtual QCP::Interaction selectionCategory () const
 
virtual QRect clipRect () const
 
virtual void mouseMoveEvent (QMouseEvent *event, const QPointF &startPos)
 
virtual void wheelEvent (QWheelEvent *event)
 
void initializeParentPlot (QCustomPlot *parentPlot)
 
void setParentLayerable (QCPLayerable *parentLayerable)
 
bool moveToLayer (QCPLayer *layer, bool prepend)
 
void applyAntialiasingHint (QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const
 
virtual QCP::Interaction selectionCategory () const
 
virtual QRect clipRect () const
 
virtual void mouseMoveEvent (QMouseEvent *event, const QPointF &startPos)
 
virtual void wheelEvent (QWheelEvent *event)
 
void initializeParentPlot (QCustomPlot *parentPlot)
 
void setParentLayerable (QCPLayerable *parentLayerable)
 
bool moveToLayer (QCPLayer *layer, bool prepend)
 
void applyAntialiasingHint (QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const
 

Protected Attributes

QString mText
 
int mTextFlags
 
QFont mFont
 
QColor mTextColor
 
QFont mSelectedFont
 
QColor mSelectedTextColor
 
QRect mTextBoundingRect
 
bool mSelectable
 
bool mSelected
 
- Protected Attributes inherited from QCPLayoutElement
QCPLayoutmParentLayout
 
QSize mMinimumSize
 
QSize mMaximumSize
 
SizeConstraintRect mSizeConstraintRect
 
QRect mRect
 
QRect mOuterRect
 
QMargins mMargins
 
QMargins mMinimumMargins
 
QCP::MarginSides mAutoMargins
 
QHash< QCP::MarginSide,
QCPMarginGroup * > 
mMarginGroups
 
- Protected Attributes inherited from QCPLayerable
bool mVisible
 
QCustomPlotmParentPlot
 
QPointer< QCPLayerablemParentLayerable
 
QCPLayermLayer
 
bool mAntialiased
 

Additional Inherited Members

- Public Types inherited from QCPLayoutElement
enum  UpdatePhase {
  upPreparation, upMargins, upLayout, upPreparation,
  upMargins, upLayout, upPreparation, upMargins,
  upLayout, upPreparation, upMargins, upLayout,
  upPreparation, upMargins, upLayout
}
 
enum  SizeConstraintRect {
  scrInnerRect, scrOuterRect, scrInnerRect, scrOuterRect,
  scrInnerRect, scrOuterRect, scrInnerRect, scrOuterRect,
  scrInnerRect, scrOuterRect
}
 
enum  UpdatePhase {
  upPreparation, upMargins, upLayout, upPreparation,
  upMargins, upLayout, upPreparation, upMargins,
  upLayout, upPreparation, upMargins, upLayout,
  upPreparation, upMargins, upLayout
}
 
enum  SizeConstraintRect {
  scrInnerRect, scrOuterRect, scrInnerRect, scrOuterRect,
  scrInnerRect, scrOuterRect, scrInnerRect, scrOuterRect,
  scrInnerRect, scrOuterRect
}
 
enum  UpdatePhase {
  upPreparation, upMargins, upLayout, upPreparation,
  upMargins, upLayout, upPreparation, upMargins,
  upLayout, upPreparation, upMargins, upLayout,
  upPreparation, upMargins, upLayout
}
 
enum  SizeConstraintRect {
  scrInnerRect, scrOuterRect, scrInnerRect, scrOuterRect,
  scrInnerRect, scrOuterRect, scrInnerRect, scrOuterRect,
  scrInnerRect, scrOuterRect
}
 
enum  UpdatePhase {
  upPreparation, upMargins, upLayout, upPreparation,
  upMargins, upLayout, upPreparation, upMargins,
  upLayout, upPreparation, upMargins, upLayout,
  upPreparation, upMargins, upLayout
}
 
enum  SizeConstraintRect {
  scrInnerRect, scrOuterRect, scrInnerRect, scrOuterRect,
  scrInnerRect, scrOuterRect, scrInnerRect, scrOuterRect,
  scrInnerRect, scrOuterRect
}
 
enum  UpdatePhase {
  upPreparation, upMargins, upLayout, upPreparation,
  upMargins, upLayout, upPreparation, upMargins,
  upLayout, upPreparation, upMargins, upLayout,
  upPreparation, upMargins, upLayout
}
 
enum  SizeConstraintRect {
  scrInnerRect, scrOuterRect, scrInnerRect, scrOuterRect,
  scrInnerRect, scrOuterRect, scrInnerRect, scrOuterRect,
  scrInnerRect, scrOuterRect
}
 

Detailed Description

A layout element displaying a text.

The text may be specified with setText, the formatting can be controlled with setFont, setTextColor, and setTextFlags.

A text element can be added as follows:

Constructor & Destructor Documentation

QCPTextElement::QCPTextElement ( QCustomPlot parentPlot)
explicit

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Creates a new QCPTextElement instance and sets default values. The initial text is empty (setText).

QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Creates a new QCPTextElement instance and sets default values.

The initial text is set to text.

QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text,
double  pointSize 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Creates a new QCPTextElement instance and sets default values.

The initial text is set to text with pointSize.

QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text,
const QString &  fontFamily,
double  pointSize 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Creates a new QCPTextElement instance and sets default values.

The initial text is set to text with pointSize and the specified fontFamily.

QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text,
const QFont &  font 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Creates a new QCPTextElement instance and sets default values.

The initial text is set to text with the specified font.

QCPTextElement::QCPTextElement ( QCustomPlot parentPlot)
explicit
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text 
)
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text,
double  pointSize 
)
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text,
const QString &  fontFamily,
double  pointSize 
)
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text,
const QFont &  font 
)
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot)
explicit
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text 
)
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text,
double  pointSize 
)
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text,
const QString &  fontFamily,
double  pointSize 
)
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text,
const QFont &  font 
)
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot)
explicit
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text 
)
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text,
double  pointSize 
)
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text,
const QString &  fontFamily,
double  pointSize 
)
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text,
const QFont &  font 
)
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot)
explicit
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text 
)
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text,
double  pointSize 
)
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text,
const QString &  fontFamily,
double  pointSize 
)
QCPTextElement::QCPTextElement ( QCustomPlot parentPlot,
const QString &  text,
const QFont &  font 
)

Member Function Documentation

void QCPTextElement::applyDefaultAntialiasingHint ( QCPPainter painter) const
protectedvirtual

Reimplemented from QCPLayoutElement.

virtual void QCPTextElement::applyDefaultAntialiasingHint ( QCPPainter painter) const
protectedvirtual

Reimplemented from QCPLayoutElement.

virtual void QCPTextElement::applyDefaultAntialiasingHint ( QCPPainter painter) const
protectedvirtual

Reimplemented from QCPLayoutElement.

virtual void QCPTextElement::applyDefaultAntialiasingHint ( QCPPainter painter) const
protectedvirtual

Reimplemented from QCPLayoutElement.

virtual void QCPTextElement::applyDefaultAntialiasingHint ( QCPPainter painter) const
protectedvirtual

Reimplemented from QCPLayoutElement.

void QCPTextElement::clicked ( QMouseEvent *  event)
signal
void QCPTextElement::clicked ( QMouseEvent *  event)
signal
void QCPTextElement::clicked ( QMouseEvent *  event)
signal
void QCPTextElement::clicked ( QMouseEvent *  event)
signal
void QCPTextElement::clicked ( QMouseEvent *  event)
signal

This signal is emitted when the text element is clicked.

See Also
doubleClicked, selectTest
virtual void QCPTextElement::deselectEvent ( bool *  selectionStateChanged)
protectedvirtual

Reimplemented from QCPLayerable.

virtual void QCPTextElement::deselectEvent ( bool *  selectionStateChanged)
protectedvirtual

Reimplemented from QCPLayerable.

void QCPTextElement::deselectEvent ( bool *  selectionStateChanged)
protectedvirtual

Reimplemented from QCPLayerable.

virtual void QCPTextElement::deselectEvent ( bool *  selectionStateChanged)
protectedvirtual

Reimplemented from QCPLayerable.

virtual void QCPTextElement::deselectEvent ( bool *  selectionStateChanged)
protectedvirtual

Reimplemented from QCPLayerable.

void QCPTextElement::doubleClicked ( QMouseEvent *  event)
signal
void QCPTextElement::doubleClicked ( QMouseEvent *  event)
signal
void QCPTextElement::doubleClicked ( QMouseEvent *  event)
signal

This signal is emitted when the text element is double clicked.

See Also
clicked, selectTest
void QCPTextElement::doubleClicked ( QMouseEvent *  event)
signal
void QCPTextElement::doubleClicked ( QMouseEvent *  event)
signal
virtual void QCPTextElement::draw ( QCPPainter painter)
protectedvirtual

Reimplemented from QCPLayoutElement.

virtual void QCPTextElement::draw ( QCPPainter painter)
protectedvirtual

Reimplemented from QCPLayoutElement.

void QCPTextElement::draw ( QCPPainter painter)
protectedvirtual

Reimplemented from QCPLayoutElement.

virtual void QCPTextElement::draw ( QCPPainter painter)
protectedvirtual

Reimplemented from QCPLayoutElement.

virtual void QCPTextElement::draw ( QCPPainter painter)
protectedvirtual

Reimplemented from QCPLayoutElement.

QFont QCPTextElement::font ( ) const
inline
QFont QCPTextElement::font ( ) const
inline
QFont QCPTextElement::font ( ) const
inline
QFont QCPTextElement::font ( ) const
inline
QFont QCPTextElement::font ( ) const
inline
QFont QCPTextElement::mainFont ( ) const
protected
QFont QCPTextElement::mainFont ( ) const
protected
QFont QCPTextElement::mainFont ( ) const
protected
QFont QCPTextElement::mainFont ( ) const
protected
QFont QCPTextElement::mainFont ( ) const
protected
QColor QCPTextElement::mainTextColor ( ) const
protected
QColor QCPTextElement::mainTextColor ( ) const
protected
QColor QCPTextElement::mainTextColor ( ) const
protected
QColor QCPTextElement::mainTextColor ( ) const
protected
QColor QCPTextElement::mainTextColor ( ) const
protected
virtual QSize QCPTextElement::maximumOuterSizeHint ( ) const
protectedvirtual

Returns the suggested maximum size this layout element (the outerRect) may be expanded to, if no manual maximum size is set.

if a maximum size (setMaximumSize) was not set manually, parent layouts use the returned size (usually indirectly through QCPLayout::getFinalMaximumOuterSize) to determine the maximum allowed size of this layout element.

A manual maximum size is considered set if it is smaller than Qt's QWIDGETSIZE_MAX.

The default implementation simply returns QWIDGETSIZE_MAX for both width and height, implying no suggested maximum size. Reimplementations may use their detailed knowledge about the layout element's content to provide size hints.

Reimplemented from QCPLayoutElement.

virtual QSize QCPTextElement::maximumOuterSizeHint ( ) const
protectedvirtual

Returns the suggested maximum size this layout element (the outerRect) may be expanded to, if no manual maximum size is set.

if a maximum size (setMaximumSize) was not set manually, parent layouts use the returned size (usually indirectly through QCPLayout::getFinalMaximumOuterSize) to determine the maximum allowed size of this layout element.

A manual maximum size is considered set if it is smaller than Qt's QWIDGETSIZE_MAX.

The default implementation simply returns QWIDGETSIZE_MAX for both width and height, implying no suggested maximum size. Reimplementations may use their detailed knowledge about the layout element's content to provide size hints.

Reimplemented from QCPLayoutElement.

virtual QSize QCPTextElement::maximumOuterSizeHint ( ) const
protectedvirtual

Returns the suggested maximum size this layout element (the outerRect) may be expanded to, if no manual maximum size is set.

if a maximum size (setMaximumSize) was not set manually, parent layouts use the returned size (usually indirectly through QCPLayout::getFinalMaximumOuterSize) to determine the maximum allowed size of this layout element.

A manual maximum size is considered set if it is smaller than Qt's QWIDGETSIZE_MAX.

The default implementation simply returns QWIDGETSIZE_MAX for both width and height, implying no suggested maximum size. Reimplementations may use their detailed knowledge about the layout element's content to provide size hints.

Reimplemented from QCPLayoutElement.

QSize QCPTextElement::maximumOuterSizeHint ( ) const
protectedvirtual

Returns the suggested maximum size this layout element (the outerRect) may be expanded to, if no manual maximum size is set.

if a maximum size (setMaximumSize) was not set manually, parent layouts use the returned size (usually indirectly through QCPLayout::getFinalMaximumOuterSize) to determine the maximum allowed size of this layout element.

A manual maximum size is considered set if it is smaller than Qt's QWIDGETSIZE_MAX.

The default implementation simply returns QWIDGETSIZE_MAX for both width and height, implying no suggested maximum size. Reimplementations may use their detailed knowledge about the layout element's content to provide size hints.

Reimplemented from QCPLayoutElement.

virtual QSize QCPTextElement::maximumOuterSizeHint ( ) const
protectedvirtual

Returns the suggested maximum size this layout element (the outerRect) may be expanded to, if no manual maximum size is set.

if a maximum size (setMaximumSize) was not set manually, parent layouts use the returned size (usually indirectly through QCPLayout::getFinalMaximumOuterSize) to determine the maximum allowed size of this layout element.

A manual maximum size is considered set if it is smaller than Qt's QWIDGETSIZE_MAX.

The default implementation simply returns QWIDGETSIZE_MAX for both width and height, implying no suggested maximum size. Reimplementations may use their detailed knowledge about the layout element's content to provide size hints.

Reimplemented from QCPLayoutElement.

virtual QSize QCPTextElement::minimumOuterSizeHint ( ) const
protectedvirtual

Returns the suggested minimum size this layout element (the outerRect) may be compressed to, if no manual minimum size is set.

if a minimum size (setMinimumSize) was not set manually, parent layouts use the returned size (usually indirectly through QCPLayout::getFinalMinimumOuterSize) to determine the minimum allowed size of this layout element.

A manual minimum size is considered set if it is non-zero.

The default implementation simply returns the sum of the horizontal margins for the width and the sum of the vertical margins for the height. Reimplementations may use their detailed knowledge about the layout element's content to provide size hints.

Reimplemented from QCPLayoutElement.

virtual QSize QCPTextElement::minimumOuterSizeHint ( ) const
protectedvirtual

Returns the suggested minimum size this layout element (the outerRect) may be compressed to, if no manual minimum size is set.

if a minimum size (setMinimumSize) was not set manually, parent layouts use the returned size (usually indirectly through QCPLayout::getFinalMinimumOuterSize) to determine the minimum allowed size of this layout element.

A manual minimum size is considered set if it is non-zero.

The default implementation simply returns the sum of the horizontal margins for the width and the sum of the vertical margins for the height. Reimplementations may use their detailed knowledge about the layout element's content to provide size hints.

Reimplemented from QCPLayoutElement.

QSize QCPTextElement::minimumOuterSizeHint ( ) const
protectedvirtual

Returns the suggested minimum size this layout element (the outerRect) may be compressed to, if no manual minimum size is set.

if a minimum size (setMinimumSize) was not set manually, parent layouts use the returned size (usually indirectly through QCPLayout::getFinalMinimumOuterSize) to determine the minimum allowed size of this layout element.

A manual minimum size is considered set if it is non-zero.

The default implementation simply returns the sum of the horizontal margins for the width and the sum of the vertical margins for the height. Reimplementations may use their detailed knowledge about the layout element's content to provide size hints.

Reimplemented from QCPLayoutElement.

virtual QSize QCPTextElement::minimumOuterSizeHint ( ) const
protectedvirtual

Returns the suggested minimum size this layout element (the outerRect) may be compressed to, if no manual minimum size is set.

if a minimum size (setMinimumSize) was not set manually, parent layouts use the returned size (usually indirectly through QCPLayout::getFinalMinimumOuterSize) to determine the minimum allowed size of this layout element.

A manual minimum size is considered set if it is non-zero.

The default implementation simply returns the sum of the horizontal margins for the width and the sum of the vertical margins for the height. Reimplementations may use their detailed knowledge about the layout element's content to provide size hints.

Reimplemented from QCPLayoutElement.

virtual QSize QCPTextElement::minimumOuterSizeHint ( ) const
protectedvirtual

Returns the suggested minimum size this layout element (the outerRect) may be compressed to, if no manual minimum size is set.

if a minimum size (setMinimumSize) was not set manually, parent layouts use the returned size (usually indirectly through QCPLayout::getFinalMinimumOuterSize) to determine the minimum allowed size of this layout element.

A manual minimum size is considered set if it is non-zero.

The default implementation simply returns the sum of the horizontal margins for the width and the sum of the vertical margins for the height. Reimplementations may use their detailed knowledge about the layout element's content to provide size hints.

Reimplemented from QCPLayoutElement.

virtual void QCPTextElement::mouseDoubleClickEvent ( QMouseEvent *  event,
const QVariant &  details 
)
virtual

This event gets called when the user presses the mouse button a second time in a double-click, while the cursor is over the layerable. Whether a cursor is over the layerable is decided by a preceding call to selectTest.

The mouseDoubleClickEvent is called instead of the second mousePressEvent. So in the case of a double-click, the event succession is pressEvent – releaseEvent – doubleClickEvent – releaseEvent.

The current pixel position of the cursor on the QCustomPlot widget is accessible via event->pos(). The parameter details contains layerable-specific details about the hit, which were generated in the previous call to selectTest. For example, One-dimensional plottables like QCPGraph or QCPBars convey the clicked data point in the details parameter, as QCPDataSelection packed as QVariant. Multi-part objects convey the specific SelectablePart that was hit (e.g. QCPAxis::SelectablePart in the case of axes).

Similarly to mousePressEvent, once a layerable has accepted the mouseDoubleClickEvent, it is considered the mouse grabber and will receive all following calls to mouseMoveEvent and mouseReleaseEvent for this mouse interaction (a "mouse interaction" in this context ends with the release).

The default implementation does nothing except explicitly ignoring the event with event->ignore().

See Also
mousePressEvent, mouseMoveEvent, mouseReleaseEvent, wheelEvent

Reimplemented from QCPLayerable.

void QCPTextElement::mouseDoubleClickEvent ( QMouseEvent *  event,
const QVariant &  details 
)
virtual

Emits the doubleClicked signal.

Reimplemented from QCPLayerable.

virtual void QCPTextElement::mouseDoubleClickEvent ( QMouseEvent *  event,
const QVariant &  details 
)
virtual

This event gets called when the user presses the mouse button a second time in a double-click, while the cursor is over the layerable. Whether a cursor is over the layerable is decided by a preceding call to selectTest.

The mouseDoubleClickEvent is called instead of the second mousePressEvent. So in the case of a double-click, the event succession is pressEvent – releaseEvent – doubleClickEvent – releaseEvent.

The current pixel position of the cursor on the QCustomPlot widget is accessible via event->pos(). The parameter details contains layerable-specific details about the hit, which were generated in the previous call to selectTest. For example, One-dimensional plottables like QCPGraph or QCPBars convey the clicked data point in the details parameter, as QCPDataSelection packed as QVariant. Multi-part objects convey the specific SelectablePart that was hit (e.g. QCPAxis::SelectablePart in the case of axes).

Similarly to mousePressEvent, once a layerable has accepted the mouseDoubleClickEvent, it is considered the mouse grabber and will receive all following calls to mouseMoveEvent and mouseReleaseEvent for this mouse interaction (a "mouse interaction" in this context ends with the release).

The default implementation does nothing except explicitly ignoring the event with event->ignore().

See Also
mousePressEvent, mouseMoveEvent, mouseReleaseEvent, wheelEvent

Reimplemented from QCPLayerable.

virtual void QCPTextElement::mouseDoubleClickEvent ( QMouseEvent *  event,
const QVariant &  details 
)
virtual

This event gets called when the user presses the mouse button a second time in a double-click, while the cursor is over the layerable. Whether a cursor is over the layerable is decided by a preceding call to selectTest.

The mouseDoubleClickEvent is called instead of the second mousePressEvent. So in the case of a double-click, the event succession is pressEvent – releaseEvent – doubleClickEvent – releaseEvent.

The current pixel position of the cursor on the QCustomPlot widget is accessible via event->pos(). The parameter details contains layerable-specific details about the hit, which were generated in the previous call to selectTest. For example, One-dimensional plottables like QCPGraph or QCPBars convey the clicked data point in the details parameter, as QCPDataSelection packed as QVariant. Multi-part objects convey the specific SelectablePart that was hit (e.g. QCPAxis::SelectablePart in the case of axes).

Similarly to mousePressEvent, once a layerable has accepted the mouseDoubleClickEvent, it is considered the mouse grabber and will receive all following calls to mouseMoveEvent and mouseReleaseEvent for this mouse interaction (a "mouse interaction" in this context ends with the release).

The default implementation does nothing except explicitly ignoring the event with event->ignore().

See Also
mousePressEvent, mouseMoveEvent, mouseReleaseEvent, wheelEvent

Reimplemented from QCPLayerable.

virtual void QCPTextElement::mouseDoubleClickEvent ( QMouseEvent *  event,
const QVariant &  details 
)
virtual

This event gets called when the user presses the mouse button a second time in a double-click, while the cursor is over the layerable. Whether a cursor is over the layerable is decided by a preceding call to selectTest.

The mouseDoubleClickEvent is called instead of the second mousePressEvent. So in the case of a double-click, the event succession is pressEvent – releaseEvent – doubleClickEvent – releaseEvent.

The current pixel position of the cursor on the QCustomPlot widget is accessible via event->pos(). The parameter details contains layerable-specific details about the hit, which were generated in the previous call to selectTest. For example, One-dimensional plottables like QCPGraph or QCPBars convey the clicked data point in the details parameter, as QCPDataSelection packed as QVariant. Multi-part objects convey the specific SelectablePart that was hit (e.g. QCPAxis::SelectablePart in the case of axes).

Similarly to mousePressEvent, once a layerable has accepted the mouseDoubleClickEvent, it is considered the mouse grabber and will receive all following calls to mouseMoveEvent and mouseReleaseEvent for this mouse interaction (a "mouse interaction" in this context ends with the release).

The default implementation does nothing except explicitly ignoring the event with event->ignore().

See Also
mousePressEvent, mouseMoveEvent, mouseReleaseEvent, wheelEvent

Reimplemented from QCPLayerable.

virtual void QCPTextElement::mousePressEvent ( QMouseEvent *  event,
const QVariant &  details 
)
virtual

This event gets called when the user presses a mouse button while the cursor is over the layerable. Whether a cursor is over the layerable is decided by a preceding call to selectTest.

The current pixel position of the cursor on the QCustomPlot widget is accessible via event->pos(). The parameter details contains layerable-specific details about the hit, which were generated in the previous call to selectTest. For example, One-dimensional plottables like QCPGraph or QCPBars convey the clicked data point in the details parameter, as QCPDataSelection packed as QVariant. Multi-part objects convey the specific SelectablePart that was hit (e.g. QCPAxis::SelectablePart in the case of axes).

QCustomPlot uses an event propagation system that works the same as Qt's system. If your layerable doesn't reimplement the mousePressEvent or explicitly calls event->ignore() in its reimplementation, the event will be propagated to the next layerable in the stacking order.

Once a layerable has accepted the mousePressEvent, it is considered the mouse grabber and will receive all following calls to mouseMoveEvent or mouseReleaseEvent for this mouse interaction (a "mouse interaction" in this context ends with the release).

The default implementation does nothing except explicitly ignoring the event with event->ignore().

See Also
mouseMoveEvent, mouseReleaseEvent, mouseDoubleClickEvent, wheelEvent

Reimplemented from QCPLayerable.

virtual void QCPTextElement::mousePressEvent ( QMouseEvent *  event,
const QVariant &  details 
)
virtual

This event gets called when the user presses a mouse button while the cursor is over the layerable. Whether a cursor is over the layerable is decided by a preceding call to selectTest.

The current pixel position of the cursor on the QCustomPlot widget is accessible via event->pos(). The parameter details contains layerable-specific details about the hit, which were generated in the previous call to selectTest. For example, One-dimensional plottables like QCPGraph or QCPBars convey the clicked data point in the details parameter, as QCPDataSelection packed as QVariant. Multi-part objects convey the specific SelectablePart that was hit (e.g. QCPAxis::SelectablePart in the case of axes).

QCustomPlot uses an event propagation system that works the same as Qt's system. If your layerable doesn't reimplement the mousePressEvent or explicitly calls event->ignore() in its reimplementation, the event will be propagated to the next layerable in the stacking order.

Once a layerable has accepted the mousePressEvent, it is considered the mouse grabber and will receive all following calls to mouseMoveEvent or mouseReleaseEvent for this mouse interaction (a "mouse interaction" in this context ends with the release).

The default implementation does nothing except explicitly ignoring the event with event->ignore().

See Also
mouseMoveEvent, mouseReleaseEvent, mouseDoubleClickEvent, wheelEvent

Reimplemented from QCPLayerable.

void QCPTextElement::mousePressEvent ( QMouseEvent *  event,
const QVariant &  details 
)
virtual

Accepts the mouse event in order to emit the according click signal in the mouseReleaseEvent.

Reimplemented from QCPLayerable.

virtual void QCPTextElement::mousePressEvent ( QMouseEvent *  event,
const QVariant &  details 
)
virtual

This event gets called when the user presses a mouse button while the cursor is over the layerable. Whether a cursor is over the layerable is decided by a preceding call to selectTest.

The current pixel position of the cursor on the QCustomPlot widget is accessible via event->pos(). The parameter details contains layerable-specific details about the hit, which were generated in the previous call to selectTest. For example, One-dimensional plottables like QCPGraph or QCPBars convey the clicked data point in the details parameter, as QCPDataSelection packed as QVariant. Multi-part objects convey the specific SelectablePart that was hit (e.g. QCPAxis::SelectablePart in the case of axes).

QCustomPlot uses an event propagation system that works the same as Qt's system. If your layerable doesn't reimplement the mousePressEvent or explicitly calls event->ignore() in its reimplementation, the event will be propagated to the next layerable in the stacking order.

Once a layerable has accepted the mousePressEvent, it is considered the mouse grabber and will receive all following calls to mouseMoveEvent or mouseReleaseEvent for this mouse interaction (a "mouse interaction" in this context ends with the release).

The default implementation does nothing except explicitly ignoring the event with event->ignore().

See Also
mouseMoveEvent, mouseReleaseEvent, mouseDoubleClickEvent, wheelEvent

Reimplemented from QCPLayerable.

virtual void QCPTextElement::mousePressEvent ( QMouseEvent *  event,
const QVariant &  details 
)
virtual

This event gets called when the user presses a mouse button while the cursor is over the layerable. Whether a cursor is over the layerable is decided by a preceding call to selectTest.

The current pixel position of the cursor on the QCustomPlot widget is accessible via event->pos(). The parameter details contains layerable-specific details about the hit, which were generated in the previous call to selectTest. For example, One-dimensional plottables like QCPGraph or QCPBars convey the clicked data point in the details parameter, as QCPDataSelection packed as QVariant. Multi-part objects convey the specific SelectablePart that was hit (e.g. QCPAxis::SelectablePart in the case of axes).

QCustomPlot uses an event propagation system that works the same as Qt's system. If your layerable doesn't reimplement the mousePressEvent or explicitly calls event->ignore() in its reimplementation, the event will be propagated to the next layerable in the stacking order.

Once a layerable has accepted the mousePressEvent, it is considered the mouse grabber and will receive all following calls to mouseMoveEvent or mouseReleaseEvent for this mouse interaction (a "mouse interaction" in this context ends with the release).

The default implementation does nothing except explicitly ignoring the event with event->ignore().

See Also
mouseMoveEvent, mouseReleaseEvent, mouseDoubleClickEvent, wheelEvent

Reimplemented from QCPLayerable.

void QCPTextElement::mouseReleaseEvent ( QMouseEvent *  event,
const QPointF &  startPos 
)
virtual

Emits the clicked signal if the cursor hasn't moved by more than a few pixels since the mousePressEvent.

Reimplemented from QCPLayerable.

virtual void QCPTextElement::mouseReleaseEvent ( QMouseEvent *  event,
const QPointF &  startPos 
)
virtual

This event gets called when the user releases the mouse button, after this layerable has become the mouse grabber by accepting the preceding mousePressEvent.

The current pixel position of the cursor on the QCustomPlot widget is accessible via event->pos(). The parameter startPos indicates the position where the initial mousePressEvent occured, that started the mouse interaction.

The default implementation does nothing.

See Also
mousePressEvent, mouseMoveEvent, mouseDoubleClickEvent, wheelEvent

Reimplemented from QCPLayerable.

virtual void QCPTextElement::mouseReleaseEvent ( QMouseEvent *  event,
const QPointF &  startPos 
)
virtual

This event gets called when the user releases the mouse button, after this layerable has become the mouse grabber by accepting the preceding mousePressEvent.

The current pixel position of the cursor on the QCustomPlot widget is accessible via event->pos(). The parameter startPos indicates the position where the initial mousePressEvent occured, that started the mouse interaction.

The default implementation does nothing.

See Also
mousePressEvent, mouseMoveEvent, mouseDoubleClickEvent, wheelEvent

Reimplemented from QCPLayerable.

virtual void QCPTextElement::mouseReleaseEvent ( QMouseEvent *  event,
const QPointF &  startPos 
)
virtual

This event gets called when the user releases the mouse button, after this layerable has become the mouse grabber by accepting the preceding mousePressEvent.

The current pixel position of the cursor on the QCustomPlot widget is accessible via event->pos(). The parameter startPos indicates the position where the initial mousePressEvent occured, that started the mouse interaction.

The default implementation does nothing.

See Also
mousePressEvent, mouseMoveEvent, mouseDoubleClickEvent, wheelEvent

Reimplemented from QCPLayerable.

virtual void QCPTextElement::mouseReleaseEvent ( QMouseEvent *  event,
const QPointF &  startPos 
)
virtual

This event gets called when the user releases the mouse button, after this layerable has become the mouse grabber by accepting the preceding mousePressEvent.

The current pixel position of the cursor on the QCustomPlot widget is accessible via event->pos(). The parameter startPos indicates the position where the initial mousePressEvent occured, that started the mouse interaction.

The default implementation does nothing.

See Also
mousePressEvent, mouseMoveEvent, mouseDoubleClickEvent, wheelEvent

Reimplemented from QCPLayerable.

bool QCPTextElement::selectable ( ) const
inline
bool QCPTextElement::selectable ( ) const
inline
bool QCPTextElement::selectable ( ) const
inline
bool QCPTextElement::selectable ( ) const
inline
bool QCPTextElement::selectable ( ) const
inline
void QCPTextElement::selectableChanged ( bool  selectable)
signal
void QCPTextElement::selectableChanged ( bool  selectable)
signal
void QCPTextElement::selectableChanged ( bool  selectable)
signal
void QCPTextElement::selectableChanged ( bool  selectable)
signal
void QCPTextElement::selectableChanged ( bool  selectable)
signal
bool QCPTextElement::selected ( ) const
inline
bool QCPTextElement::selected ( ) const
inline
bool QCPTextElement::selected ( ) const
inline
bool QCPTextElement::selected ( ) const
inline
bool QCPTextElement::selected ( ) const
inline
QFont QCPTextElement::selectedFont ( ) const
inline
QFont QCPTextElement::selectedFont ( ) const
inline
QFont QCPTextElement::selectedFont ( ) const
inline
QFont QCPTextElement::selectedFont ( ) const
inline
QFont QCPTextElement::selectedFont ( ) const
inline
QColor QCPTextElement::selectedTextColor ( ) const
inline
QColor QCPTextElement::selectedTextColor ( ) const
inline
QColor QCPTextElement::selectedTextColor ( ) const
inline
QColor QCPTextElement::selectedTextColor ( ) const
inline
QColor QCPTextElement::selectedTextColor ( ) const
inline
virtual void QCPTextElement::selectEvent ( QMouseEvent *  event,
bool  additive,
const QVariant &  details,
bool *  selectionStateChanged 
)
protectedvirtual

Reimplemented from QCPLayerable.

virtual void QCPTextElement::selectEvent ( QMouseEvent *  event,
bool  additive,
const QVariant &  details,
bool *  selectionStateChanged 
)
protectedvirtual

Reimplemented from QCPLayerable.

void QCPTextElement::selectEvent ( QMouseEvent *  event,
bool  additive,
const QVariant &  details,
bool *  selectionStateChanged 
)
protectedvirtual

Reimplemented from QCPLayerable.

virtual void QCPTextElement::selectEvent ( QMouseEvent *  event,
bool  additive,
const QVariant &  details,
bool *  selectionStateChanged 
)
protectedvirtual

Reimplemented from QCPLayerable.

virtual void QCPTextElement::selectEvent ( QMouseEvent *  event,
bool  additive,
const QVariant &  details,
bool *  selectionStateChanged 
)
protectedvirtual

Reimplemented from QCPLayerable.

void QCPTextElement::selectionChanged ( bool  selected)
signal
void QCPTextElement::selectionChanged ( bool  selected)
signal

This signal is emitted when the selection state has changed to selected, either by user interaction or by a direct call to setSelected.

See Also
setSelected, setSelectable
void QCPTextElement::selectionChanged ( bool  selected)
signal
void QCPTextElement::selectionChanged ( bool  selected)
signal
void QCPTextElement::selectionChanged ( bool  selected)
signal
double QCPTextElement::selectTest ( const QPointF &  pos,
bool  onlySelectable,
QVariant *  details = 0 
) const
virtual

Returns 0.99*selectionTolerance (see QCustomPlot::setSelectionTolerance) when pos is within the bounding box of the text element's text. Note that this bounding box is updated in the draw call.

If pos is outside the text's bounding box or if onlySelectable is true and this text element is not selectable (setSelectable), returns -1.

Reimplemented from QCPLayoutElement.

virtual double QCPTextElement::selectTest ( const QPointF &  pos,
bool  onlySelectable,
QVariant *  details = 0 
) const
virtual

Layout elements are sensitive to events inside their outer rect. If pos is within the outer rect, this method returns a value corresponding to 0.99 times the parent plot's selection tolerance. However, layout elements are not selectable by default. So if onlySelectable is true, -1.0 is returned.

See QCPLayerable::selectTest for a general explanation of this virtual method.

QCPLayoutElement subclasses may reimplement this method to provide more specific selection test behaviour.

Reimplemented from QCPLayoutElement.

virtual double QCPTextElement::selectTest ( const QPointF &  pos,
bool  onlySelectable,
QVariant *  details = 0 
) const
virtual

Layout elements are sensitive to events inside their outer rect. If pos is within the outer rect, this method returns a value corresponding to 0.99 times the parent plot's selection tolerance. However, layout elements are not selectable by default. So if onlySelectable is true, -1.0 is returned.

See QCPLayerable::selectTest for a general explanation of this virtual method.

QCPLayoutElement subclasses may reimplement this method to provide more specific selection test behaviour.

Reimplemented from QCPLayoutElement.

virtual double QCPTextElement::selectTest ( const QPointF &  pos,
bool  onlySelectable,
QVariant *  details = 0 
) const
virtual

Layout elements are sensitive to events inside their outer rect. If pos is within the outer rect, this method returns a value corresponding to 0.99 times the parent plot's selection tolerance. However, layout elements are not selectable by default. So if onlySelectable is true, -1.0 is returned.

See QCPLayerable::selectTest for a general explanation of this virtual method.

QCPLayoutElement subclasses may reimplement this method to provide more specific selection test behaviour.

Reimplemented from QCPLayoutElement.

virtual double QCPTextElement::selectTest ( const QPointF &  pos,
bool  onlySelectable,
QVariant *  details = 0 
) const
virtual

Layout elements are sensitive to events inside their outer rect. If pos is within the outer rect, this method returns a value corresponding to 0.99 times the parent plot's selection tolerance. However, layout elements are not selectable by default. So if onlySelectable is true, -1.0 is returned.

See QCPLayerable::selectTest for a general explanation of this virtual method.

QCPLayoutElement subclasses may reimplement this method to provide more specific selection test behaviour.

Reimplemented from QCPLayoutElement.

void QCPTextElement::setFont ( const QFont &  font)
void QCPTextElement::setFont ( const QFont &  font)
void QCPTextElement::setFont ( const QFont &  font)

Sets the font of the text.

See Also
setTextColor, setSelectedFont
void QCPTextElement::setFont ( const QFont &  font)
void QCPTextElement::setFont ( const QFont &  font)
Q_SLOT void QCPTextElement::setSelectable ( bool  selectable)
Q_SLOT void QCPTextElement::setSelectable ( bool  selectable)
Q_SLOT void QCPTextElement::setSelectable ( bool  selectable)
void QCPTextElement::setSelectable ( bool  selectable)

Sets whether the user may select this text element.

Note that even when selectable is set to false, the selection state may be changed programmatically via setSelected.

Q_SLOT void QCPTextElement::setSelectable ( bool  selectable)
Q_SLOT void QCPTextElement::setSelected ( bool  selected)
void QCPTextElement::setSelected ( bool  selected)

Sets the selection state of this text element to selected. If the selection has changed, selectionChanged is emitted.

Note that this function can change the selection state independently of the current setSelectable state.

Q_SLOT void QCPTextElement::setSelected ( bool  selected)
Q_SLOT void QCPTextElement::setSelected ( bool  selected)
Q_SLOT void QCPTextElement::setSelected ( bool  selected)
void QCPTextElement::setSelectedFont ( const QFont &  font)
void QCPTextElement::setSelectedFont ( const QFont &  font)

Sets the font of the text that will be used if the text element is selected (setSelected).

See Also
setFont
void QCPTextElement::setSelectedFont ( const QFont &  font)
void QCPTextElement::setSelectedFont ( const QFont &  font)
void QCPTextElement::setSelectedFont ( const QFont &  font)
void QCPTextElement::setSelectedTextColor ( const QColor &  color)
void QCPTextElement::setSelectedTextColor ( const QColor &  color)
void QCPTextElement::setSelectedTextColor ( const QColor &  color)
void QCPTextElement::setSelectedTextColor ( const QColor &  color)
void QCPTextElement::setSelectedTextColor ( const QColor &  color)

Sets the color of the text that will be used if the text element is selected (setSelected).

See Also
setTextColor
void QCPTextElement::setText ( const QString &  text)

Sets the text that will be displayed to text. Multiple lines can be created by insertion of "\n".

See Also
setFont, setTextColor, setTextFlags
void QCPTextElement::setText ( const QString &  text)
void QCPTextElement::setText ( const QString &  text)
void QCPTextElement::setText ( const QString &  text)
void QCPTextElement::setText ( const QString &  text)
void QCPTextElement::setTextColor ( const QColor &  color)
void QCPTextElement::setTextColor ( const QColor &  color)

Sets the color of the text.

See Also
setFont, setSelectedTextColor
void QCPTextElement::setTextColor ( const QColor &  color)
void QCPTextElement::setTextColor ( const QColor &  color)
void QCPTextElement::setTextColor ( const QColor &  color)
void QCPTextElement::setTextFlags ( int  flags)
void QCPTextElement::setTextFlags ( int  flags)
void QCPTextElement::setTextFlags ( int  flags)
void QCPTextElement::setTextFlags ( int  flags)

Sets options for text alignment and wrapping behaviour. flags is a bitwise OR-combination of Qt::AlignmentFlag and Qt::TextFlag enums.

Possible enums are:

  • Qt::AlignLeft
  • Qt::AlignRight
  • Qt::AlignHCenter
  • Qt::AlignJustify
  • Qt::AlignTop
  • Qt::AlignBottom
  • Qt::AlignVCenter
  • Qt::AlignCenter
  • Qt::TextDontClip
  • Qt::TextSingleLine
  • Qt::TextExpandTabs
  • Qt::TextShowMnemonic
  • Qt::TextWordWrap
  • Qt::TextIncludeTrailingSpaces
void QCPTextElement::setTextFlags ( int  flags)
QString QCPTextElement::text ( ) const
inline
QString QCPTextElement::text ( ) const
inline
QString QCPTextElement::text ( ) const
inline
QString QCPTextElement::text ( ) const
inline
QString QCPTextElement::text ( ) const
inline
QColor QCPTextElement::textColor ( ) const
inline
QColor QCPTextElement::textColor ( ) const
inline
QColor QCPTextElement::textColor ( ) const
inline
QColor QCPTextElement::textColor ( ) const
inline
QColor QCPTextElement::textColor ( ) const
inline
int QCPTextElement::textFlags ( ) const
inline
int QCPTextElement::textFlags ( ) const
inline
int QCPTextElement::textFlags ( ) const
inline
int QCPTextElement::textFlags ( ) const
inline
int QCPTextElement::textFlags ( ) const
inline

Member Data Documentation

QFont QCPTextElement::mFont
protected
bool QCPTextElement::mSelectable
protected
bool QCPTextElement::mSelected
protected
QFont QCPTextElement::mSelectedFont
protected
QColor QCPTextElement::mSelectedTextColor
protected
QString QCPTextElement::mText
protected
QRect QCPTextElement::mTextBoundingRect
protected
QColor QCPTextElement::mTextColor
protected
int QCPTextElement::mTextFlags
protected

The documentation for this class was generated from the following files: