![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
A layout element displaying a text. More...
#include <qcustomplot.h>


Signals | |
| 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) |
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 |
| virtual void | mousePressEvent (QMouseEvent *event, const QVariant &details) |
| virtual void | mouseReleaseEvent (QMouseEvent *event, const QPointF &startPos) |
| virtual void | mouseDoubleClickEvent (QMouseEvent *event, const QVariant &details) |
Public Member Functions inherited from QCPLayoutElement | |
| QCPLayoutElement (QCustomPlot *parentPlot=0) | |
| virtual | ~QCPLayoutElement () |
| QCPLayout * | layout () 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 |
| QCPMarginGroup * | marginGroup (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 () |
| QCPLayout * | layout () const |
| QRect | rect () const |
| QRect | outerRect () const |
| QMargins | margins () const |
| QMargins | minimumMargins () const |
| QCP::MarginSides | autoMargins () const |
| QSize | minimumSize () const |
| QSize | maximumSize () const |
| QCPMarginGroup * | marginGroup (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 | setMarginGroup (QCP::MarginSides sides, QCPMarginGroup *group) |
| virtual void | update (UpdatePhase phase) |
| virtual QSize | minimumSizeHint () const |
| virtual QSize | maximumSizeHint () const |
| 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 |
| QCustomPlot * | parentPlot () const |
| QCPLayerable * | parentLayerable () const |
| QCPLayer * | layer () 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) | |
| ~QCPLayerable () | |
| bool | visible () const |
| QCustomPlot * | parentPlot () const |
| QCPLayerable * | parentLayerable () const |
| QCPLayer * | layer () 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 |
| virtual void | draw (QCPPainter *painter) |
| virtual QSize | minimumOuterSizeHint () const |
| virtual QSize | maximumOuterSizeHint () const |
| virtual void | selectEvent (QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) |
| virtual void | deselectEvent (bool *selectionStateChanged) |
| 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) |
| virtual int | calculateAutoMargin (QCP::MarginSide side) |
| virtual void | mousePressEvent (QMouseEvent *event) |
| virtual void | mouseMoveEvent (QMouseEvent *event) |
| virtual void | mouseReleaseEvent (QMouseEvent *event) |
| virtual void | mouseDoubleClickEvent (QMouseEvent *event) |
| virtual void | wheelEvent (QWheelEvent *event) |
| virtual void | parentPlotInitialized (QCustomPlot *parentPlot) |
Protected Member Functions inherited from QCPLayerable | |
| virtual QCP::Interaction | selectionCategory () const |
| virtual QRect | clipRect () const |
| virtual void | mouseMoveEvent (QMouseEvent *event, const QPointF &startPos) |
| 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 |
| 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 | |
| QCPLayout * | mParentLayout |
| 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 |
| QCustomPlot * | mParentPlot |
| QPointer< QCPLayerable > | mParentLayerable |
| QCPLayer * | mLayer |
| bool | mAntialiased |
Additional Inherited Members | |
Public Types inherited from QCPLayoutElement | |
| enum | UpdatePhase { upPreparation , upMargins , upLayout , upPreparation , upMargins , upLayout } |
| enum | SizeConstraintRect { scrInnerRect , scrOuterRect } |
| enum | UpdatePhase { upPreparation , upMargins , upLayout , upPreparation , upMargins , upLayout } |
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:
qcptextelement-creation
Definition at line 5750 of file qcustomplot.h.
|
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).
Definition at line 19610 of file qcustomplot.cpp.
References mFont, mSelectedFont, QCPLayerable::parentPlot(), and QCPLayoutElement::setMargins().
| 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.
Definition at line 19637 of file qcustomplot.cpp.
References mFont, mSelectedFont, QCPLayerable::parentPlot(), and QCPLayoutElement::setMargins().
| 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.
Definition at line 19664 of file qcustomplot.cpp.
References mFont, mSelectedFont, QCPLayerable::parentPlot(), and QCPLayoutElement::setMargins().
| 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.
Definition at line 19696 of file qcustomplot.cpp.
References QCPLayoutElement::setMargins().
| 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.
Definition at line 19718 of file qcustomplot.cpp.
References QCPLayoutElement::setMargins().
|
protectedvirtual |
Reimplemented from QCPLayoutElement.
Definition at line 19825 of file qcustomplot.cpp.
References QCP::aeOther, QCPLayerable::applyAntialiasingHint(), and QCPLayerable::mAntialiased.
|
signal |
This signal is emitted when the text element is clicked.
Referenced by mouseReleaseEvent().
|
protectedvirtual |
Reimplemented from QCPLayerable.
Definition at line 19872 of file qcustomplot.cpp.
References mSelectable, mSelected, and setSelected().
|
signal |
This signal is emitted when the text element is double clicked.
Referenced by mouseDoubleClickEvent().
|
protectedvirtual |
Reimplemented from QCPLayoutElement.
Definition at line 19830 of file qcustomplot.cpp.
References mainFont(), mainTextColor(), QCPLayoutElement::mRect, mText, mTextBoundingRect, and QCPPainter::setPen().
|
inline |
Definition at line 5781 of file qcustomplot.h.
Referenced by setFont(), and setSelectedFont().
|
protected |
Definition at line 19943 of file qcustomplot.cpp.
References mFont, mSelected, and mSelectedFont.
Referenced by draw().
|
protected |
Definition at line 19952 of file qcustomplot.cpp.
References mSelected, mSelectedTextColor, and mTextColor.
Referenced by draw().
|
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.
Definition at line 19847 of file qcustomplot.cpp.
References mFont, QCPLayoutElement::mMargins, mText, and result.
|
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.
Definition at line 19837 of file qcustomplot.cpp.
References mFont, QCPLayoutElement::mMargins, mText, and result.
|
virtual |
Emits the doubleClicked signal.
\seebaseclassmethod
Reimplemented from QCPLayerable.
Definition at line 19932 of file qcustomplot.cpp.
References doubleClicked(), and event.
|
virtual |
Accepts the mouse event in order to emit the according click signal in the mouseReleaseEvent.
\seebaseclassmethod
Reimplemented from QCPLayerable.
Definition at line 19909 of file qcustomplot.cpp.
|
virtual |
Emits the clicked signal if the cursor hasn't moved by more than a few pixels since the mousePressEvent.
\seebaseclassmethod
Reimplemented from QCPLayerable.
Definition at line 19921 of file qcustomplot.cpp.
|
inline |
Definition at line 5785 of file qcustomplot.h.
Referenced by setSelectable().
|
signal |
Referenced by setSelectable().
|
inline |
Definition at line 5786 of file qcustomplot.h.
Referenced by setSelected().
|
inline |
Definition at line 5783 of file qcustomplot.h.
|
inline |
Definition at line 5784 of file qcustomplot.h.
|
protectedvirtual |
Reimplemented from QCPLayerable.
Definition at line 19857 of file qcustomplot.cpp.
References event, mSelectable, mSelected, and setSelected().
|
signal |
This signal is emitted when the selection state has changed to selected, either by user interaction or by a direct call to setSelected.
Referenced by setSelected().
|
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.
\seebaseclassmethod
Reimplemented from QCPLayoutElement.
Definition at line 19891 of file qcustomplot.cpp.
References QCPLayerable::mParentPlot, mSelectable, mTextBoundingRect, and QCustomPlot::selectionTolerance().
| void QCPTextElement::setFont | ( | const QFont & | font | ) |
Sets the font of the text.
Definition at line 19768 of file qcustomplot.cpp.
Referenced by ccHistogramWindow::refresh(), and ccWaveWidget::refresh().
| 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.
Definition at line 19803 of file qcustomplot.cpp.
References mSelectable, selectable(), and selectableChanged().
| 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.
Definition at line 19817 of file qcustomplot.cpp.
References mSelected, selected(), and selectionChanged().
Referenced by deselectEvent(), and selectEvent().
| void QCPTextElement::setSelectedFont | ( | const QFont & | font | ) |
Sets the font of the text that will be used if the text element is selected (setSelected).
Definition at line 19783 of file qcustomplot.cpp.
References font(), and mSelectedFont.
| void QCPTextElement::setSelectedTextColor | ( | const QColor & | color | ) |
Sets the color of the text that will be used if the text element is selected (setSelected).
Definition at line 19793 of file qcustomplot.cpp.
References color, and mSelectedTextColor.
| void QCPTextElement::setText | ( | const QString & | text | ) |
Sets the text that will be displayed to text. Multiple lines can be created by insertion of "\n".
Definition at line 19739 of file qcustomplot.cpp.
| void QCPTextElement::setTextColor | ( | const QColor & | color | ) |
Sets the color of the text.
Definition at line 19775 of file qcustomplot.cpp.
References color, and mTextColor.
| 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:
Definition at line 19761 of file qcustomplot.cpp.
References mTextFlags.
|
inline |
Definition at line 5779 of file qcustomplot.h.
Referenced by setText().
|
inline |
Definition at line 5782 of file qcustomplot.h.
|
inline |
Definition at line 5780 of file qcustomplot.h.
|
protected |
Definition at line 5819 of file qcustomplot.h.
Referenced by mainFont(), maximumOuterSizeHint(), minimumOuterSizeHint(), QCPTextElement(), and setFont().
|
protected |
Definition at line 5824 of file qcustomplot.h.
Referenced by deselectEvent(), selectEvent(), selectTest(), and setSelectable().
|
protected |
Definition at line 5824 of file qcustomplot.h.
Referenced by deselectEvent(), mainFont(), mainTextColor(), selectEvent(), and setSelected().
|
protected |
Definition at line 5821 of file qcustomplot.h.
Referenced by mainFont(), QCPTextElement(), and setSelectedFont().
|
protected |
Definition at line 5822 of file qcustomplot.h.
Referenced by mainTextColor(), and setSelectedTextColor().
|
protected |
Definition at line 5817 of file qcustomplot.h.
Referenced by draw(), maximumOuterSizeHint(), minimumOuterSizeHint(), and setText().
|
protected |
Definition at line 5823 of file qcustomplot.h.
Referenced by draw(), and selectTest().
|
protected |
Definition at line 5820 of file qcustomplot.h.
Referenced by mainTextColor(), and setTextColor().
|
protected |
Definition at line 5818 of file qcustomplot.h.
Referenced by setTextFlags().