|
Cute Chess
0.1
|
A layout element displaying a text. More...
Signals | |
| void | clicked (QMouseEvent *event) |
| void | doubleClicked (QMouseEvent *event) |
| void | selectableChanged (bool selectable) |
| void | selectionChanged (bool selected) |
Signals inherited from QCPLayerable | |
| void | layerChanged (QCPLayer *newLayer) |
Public Member Functions | |
| QFont | font () const |
| virtual void | mouseDoubleClickEvent (QMouseEvent *event, const QVariant &details) 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 |
| 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) | |
| bool | selectable () const |
| bool | selected () const |
| QFont | selectedFont () const |
| QColor | selectedTextColor () const |
| virtual double | selectTest (const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE |
| void | setFont (const QFont &font) |
| Q_SLOT void | setSelectable (bool selectable) |
| Q_SLOT void | setSelected (bool selected) |
| void | setSelectedFont (const QFont &font) |
| void | setSelectedTextColor (const QColor &color) |
| void | setText (const QString &text) |
| void | setTextColor (const QColor &color) |
| void | setTextFlags (int flags) |
| QString | text () const |
| QColor | textColor () const |
| int | textFlags () const |
Public Member Functions inherited from QCPLayoutElement | |
| QCP::MarginSides | autoMargins () const |
| virtual QList< QCPLayoutElement * > | elements (bool recursive) const |
| QCPLayout * | layout () const |
| QCPMarginGroup * | marginGroup (QCP::MarginSide side) const |
| QHash< QCP::MarginSide, QCPMarginGroup * > | marginGroups () const |
| QMargins | margins () const |
| QSize | maximumSize () const |
| QMargins | minimumMargins () const |
| QSize | minimumSize () const |
| QRect | outerRect () const |
| QCPLayoutElement (QCustomPlot *parentPlot=0) | |
| QRect | rect () const |
| void | setAutoMargins (QCP::MarginSides sides) |
| void | setMarginGroup (QCP::MarginSides sides, QCPMarginGroup *group) |
| void | setMargins (const QMargins &margins) |
| void | setMaximumSize (const QSize &size) |
| void | setMaximumSize (int width, int height) |
| void | setMinimumMargins (const QMargins &margins) |
| void | setMinimumSize (const QSize &size) |
| void | setMinimumSize (int width, int height) |
| void | setOuterRect (const QRect &rect) |
| virtual void | update (UpdatePhase phase) |
Public Member Functions inherited from QCPLayerable | |
| bool | antialiased () const |
| QCPLayer * | layer () const |
| QCPLayerable * | parentLayerable () const |
| QCustomPlot * | parentPlot () const |
| QCPLayerable (QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=0) | |
| bool | realVisibility () const |
| void | setAntialiased (bool enabled) |
| Q_SLOT bool | setLayer (QCPLayer *layer) |
| bool | setLayer (const QString &layerName) |
| void | setVisible (bool on) |
| bool | visible () const |
Protected Member Functions | |
| virtual void | applyDefaultAntialiasingHint (QCPPainter *painter) const Q_DECL_OVERRIDE |
| virtual void | deselectEvent (bool *selectionStateChanged) Q_DECL_OVERRIDE |
| virtual void | draw (QCPPainter *painter) Q_DECL_OVERRIDE |
| QFont | mainFont () const |
| QColor | mainTextColor () const |
| virtual QSize | maximumSizeHint () const Q_DECL_OVERRIDE |
| virtual QSize | minimumSizeHint () const Q_DECL_OVERRIDE |
| virtual void | selectEvent (QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) Q_DECL_OVERRIDE |
Protected Member Functions inherited from QCPLayoutElement | |
| virtual int | calculateAutoMargin (QCP::MarginSide side) |
| virtual void | layoutChanged () |
| virtual void | parentPlotInitialized (QCustomPlot *parentPlot) Q_DECL_OVERRIDE |
Protected Member Functions inherited from QCPLayerable | |
| void | applyAntialiasingHint (QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const |
| virtual QRect | clipRect () const |
| void | initializeParentPlot (QCustomPlot *parentPlot) |
| virtual void | mouseMoveEvent (QMouseEvent *event, const QPointF &startPos) |
| bool | moveToLayer (QCPLayer *layer, bool prepend) |
| virtual QCP::Interaction | selectionCategory () const |
| void | setParentLayerable (QCPLayerable *parentLayerable) |
| virtual void | wheelEvent (QWheelEvent *event) |
Protected Attributes | |
| QFont | mFont |
| bool | mSelectable |
| bool | mSelected |
| QFont | mSelectedFont |
| QColor | mSelectedTextColor |
| QString | mText |
| QRect | mTextBoundingRect |
| QColor | mTextColor |
| int | mTextFlags |
Protected Attributes inherited from QCPLayoutElement | |
| QCP::MarginSides | mAutoMargins |
| QHash< QCP::MarginSide, QCPMarginGroup * > | mMarginGroups |
| QMargins | mMargins |
| QSize | mMaximumSize |
| QMargins | mMinimumMargins |
| QSize | mMinimumSize |
| QRect | mOuterRect |
| QCPLayout * | mParentLayout |
| QRect | mRect |
Protected Attributes inherited from QCPLayerable | |
| bool | mAntialiased |
| QCPLayer * | mLayer |
| QPointer< QCPLayerable > | mParentLayerable |
| QCustomPlot * | mParentPlot |
| bool | mVisible |
Additional Inherited Members | |
Public Types inherited from QCPLayoutElement | |
| enum | UpdatePhase { 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:
|
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.
|
signal |
This signal is emitted when the text element is clicked.
|
signal |
This signal is emitted when the text element is double clicked.
|
protectedvirtual |
Returns the maximum size this layout element (the inner rect) may be expanded to.
if a maximum size (setMaximumSize) was not set manually, parent layouts consult this function 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.)
Reimplemented from QCPLayoutElement.
|
protectedvirtual |
Returns the minimum size this layout element (the inner rect) may be compressed to.
if a minimum size (setMinimumSize) was not set manually, parent layouts consult this function to determine the minimum allowed size of this layout element. (A manual minimum size is considered set if it is non-zero.)
Reimplemented from QCPLayoutElement.
|
virtual |
Emits the doubleClicked signal.
Reimplemented from QCPLayerable.
|
virtual |
Accepts the mouse event in order to emit the according click signal in the mouseReleaseEvent.
Reimplemented from QCPLayerable.
|
virtual |
Emits the clicked signal if the cursor hasn't moved by more than a few pixels since the mousePressEvent.
Reimplemented from QCPLayerable.
|
signal |
This signal is emitted when the selection state has changed to selected, either by user interaction or by a direct call to 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.
Reimplemented from QCPLayoutElement.
| void QCPTextElement::setFont | ( | const QFont & | font | ) |
Sets the font of the text.
| 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.
| 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.
| void QCPTextElement::setSelectedFont | ( | const QFont & | font | ) |
Sets the font of the text that will be used if the text element is selected (setSelected).
| void QCPTextElement::setSelectedTextColor | ( | const QColor & | color | ) |
Sets the color of the text that will be used if the text element is selected (setSelected).
| void QCPTextElement::setText | ( | const QString & | text | ) |
Sets the text that will be displayed to text. Multiple lines can be created by insertion of "\n".
| void QCPTextElement::setTextColor | ( | const QColor & | color | ) |
Sets the color of the text.
| 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:
1.8.14