Gra zręcznościowa „Straszna Epidemia"  V1.2
Projekt Wizualizacja Danych Sensorycznych Kewin Gałuszka rok akademicki 2019/2020
Dokumentacja klasy QCPTextElement

A layout element displaying a text. Więcej...

#include <qcustomplot.h>

Diagram dziedziczenia dla QCPTextElement
Diagram współpracy dla QCPTextElement:

Sygnały

void selectionChanged (bool selected)
 
void selectableChanged (bool selectable)
 
void clicked (QMouseEvent *event)
 
void doubleClicked (QMouseEvent *event)
 
- Sygnały dziedziczone z QCPLayerable
void layerChanged (QCPLayer *newLayer)
 

Metody publiczne

 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
 
- Metody publiczne dziedziczone z 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
 
- Metody publiczne dziedziczone z 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
 

Metody chronione

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
 
- Metody chronione dziedziczone z QCPLayoutElement
virtual int calculateAutoMargin (QCP::MarginSide side)
 
virtual void layoutChanged ()
 
virtual void parentPlotInitialized (QCustomPlot *parentPlot) Q_DECL_OVERRIDE
 
- Metody chronione dziedziczone z 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
 

Atrybuty chronione

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

Dodatkowe Dziedziczone Składowe

- Typy publiczne dziedziczone z QCPLayoutElement
enum  UpdatePhase { upPreparation, upMargins, upLayout }
 
enum  SizeConstraintRect { scrInnerRect, scrOuterRect }
 

Opis szczegółowy

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:

Definicja w linii 4937 pliku qcustomplot.h.

Dokumentacja konstruktora i destruktora

◆ QCPTextElement() [1/5]

QCPTextElement::QCPTextElement ( QCustomPlot parentPlot)
explicit

To jest metoda przeciążona, udostępniona dla wygody. Różni się od powyższej metody tylko zestawem akceptowanych argumentów.

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

Definicja w linii 18925 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ QCPTextElement() [2/5]

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

To jest metoda przeciążona, udostępniona dla wygody. Różni się od powyższej metody tylko zestawem akceptowanych argumentów.

Creates a new QCPTextElement instance and sets default values.

The initial text is set to text.

Definicja w linii 18950 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ QCPTextElement() [3/5]

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

To jest metoda przeciążona, udostępniona dla wygody. Różni się od powyższej metody tylko zestawem akceptowanych argumentów.

Creates a new QCPTextElement instance and sets default values.

The initial text is set to text with pointSize.

Definicja w linii 18975 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ QCPTextElement() [4/5]

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

To jest metoda przeciążona, udostępniona dla wygody. Różni się od powyższej metody tylko zestawem akceptowanych argumentów.

Creates a new QCPTextElement instance and sets default values.

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

Definicja w linii 19002 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ QCPTextElement() [5/5]

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

To jest metoda przeciążona, udostępniona dla wygody. Różni się od powyższej metody tylko zestawem akceptowanych argumentów.

Creates a new QCPTextElement instance and sets default values.

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

Definicja w linii 19022 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

Dokumentacja funkcji składowych

◆ applyDefaultAntialiasingHint()

void QCPTextElement::applyDefaultAntialiasingHint ( QCPPainter painter) const
protectedvirtual

Reimplementowana z QCPLayoutElement.

Definicja w linii 19143 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ clicked

void QCPTextElement::clicked ( QMouseEvent *  event)
signal

This signal is emitted when the text element is clicked.

Zobacz również
doubleClicked, selectTest
Oto graf wywoływań tej funkcji:

◆ deselectEvent()

void QCPTextElement::deselectEvent ( bool *  selectionStateChanged)
protectedvirtual

Reimplementowana z QCPLayerable.

Definicja w linii 19191 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ doubleClicked

void QCPTextElement::doubleClicked ( QMouseEvent *  event)
signal

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

Zobacz również
clicked, selectTest
Oto graf wywoływań tej funkcji:

◆ draw()

void QCPTextElement::draw ( QCPPainter painter)
protectedvirtual

Reimplementowana z QCPLayoutElement.

Definicja w linii 19149 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ font()

QFont QCPTextElement::font ( ) const
inline

Definicja w linii 4959 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ mainFont()

QFont QCPTextElement::mainFont ( ) const
protected

Definicja w linii 19264 pliku qcustomplot.cpp.

Oto graf wywoływań tej funkcji:

◆ mainTextColor()

QColor QCPTextElement::mainTextColor ( ) const
protected

Definicja w linii 19274 pliku qcustomplot.cpp.

Oto graf wywoływań tej funkcji:

◆ maximumOuterSizeHint()

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.

Reimplementowana z QCPLayoutElement.

Definicja w linii 19167 pliku qcustomplot.cpp.

◆ minimumOuterSizeHint()

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.

Reimplementowana z QCPLayoutElement.

Definicja w linii 19157 pliku qcustomplot.cpp.

◆ mouseDoubleClickEvent()

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

Emits the doubleClicked signal.

\seebaseclassmethod

Reimplementowana z QCPLayerable.

Definicja w linii 19253 pliku qcustomplot.cpp.

◆ mousePressEvent()

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

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

\seebaseclassmethod

Reimplementowana z QCPLayerable.

Definicja w linii 19230 pliku qcustomplot.cpp.

◆ mouseReleaseEvent()

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.

\seebaseclassmethod

Reimplementowana z QCPLayerable.

Definicja w linii 19242 pliku qcustomplot.cpp.

◆ selectable()

bool QCPTextElement::selectable ( ) const
inline

Definicja w linii 4963 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ selectableChanged

void QCPTextElement::selectableChanged ( bool  selectable)
signal
Oto graf wywoływań tej funkcji:

◆ selected()

bool QCPTextElement::selected ( ) const
inline

Definicja w linii 4964 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ selectedFont()

QFont QCPTextElement::selectedFont ( ) const
inline

Definicja w linii 4961 pliku qcustomplot.h.

◆ selectedTextColor()

QColor QCPTextElement::selectedTextColor ( ) const
inline

Definicja w linii 4962 pliku qcustomplot.h.

◆ selectEvent()

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

Reimplementowana z QCPLayerable.

Definicja w linii 19177 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ selectionChanged

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.

Zobacz również
setSelected, setSelectable
Oto graf wywoływań tej funkcji:

◆ selectTest()

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.

\seebaseclassmethod

Reimplementowana z QCPLayoutElement.

Definicja w linii 19212 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ setFont()

void QCPTextElement::setFont ( const QFont &  font)

Sets the font of the text.

Zobacz również
setTextColor, setSelectedFont

Definicja w linii 19076 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ setSelectable()

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.

Definicja w linii 19117 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ 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.

Definicja w linii 19133 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:
Oto graf wywoływań tej funkcji:

◆ setSelectedFont()

void QCPTextElement::setSelectedFont ( const QFont &  font)

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

Zobacz również
setFont

Definicja w linii 19096 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ setSelectedTextColor()

void QCPTextElement::setSelectedTextColor ( const QColor &  color)

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

Zobacz również
setTextColor

Definicja w linii 19106 pliku qcustomplot.cpp.

◆ setText()

void QCPTextElement::setText ( const QString &  text)

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

Zobacz również
setFont, setTextColor, setTextFlags

Definicja w linii 19041 pliku qcustomplot.cpp.

Oto graf wywołań dla tej funkcji:

◆ setTextColor()

void QCPTextElement::setTextColor ( const QColor &  color)

Sets the color of the text.

Zobacz również
setFont, setSelectedTextColor

Definicja w linii 19086 pliku qcustomplot.cpp.

◆ setTextFlags()

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

Definicja w linii 19066 pliku qcustomplot.cpp.

◆ text()

QString QCPTextElement::text ( ) const
inline

Definicja w linii 4957 pliku qcustomplot.h.

Oto graf wywoływań tej funkcji:

◆ textColor()

QColor QCPTextElement::textColor ( ) const
inline

Definicja w linii 4960 pliku qcustomplot.h.

◆ textFlags()

int QCPTextElement::textFlags ( ) const
inline

Definicja w linii 4958 pliku qcustomplot.h.

Dokumentacja atrybutów składowych

◆ mFont

QFont QCPTextElement::mFont
protected

Definicja w linii 4992 pliku qcustomplot.h.

◆ mSelectable

bool QCPTextElement::mSelectable
protected

Definicja w linii 4997 pliku qcustomplot.h.

◆ mSelected

bool QCPTextElement::mSelected
protected

Definicja w linii 4997 pliku qcustomplot.h.

◆ mSelectedFont

QFont QCPTextElement::mSelectedFont
protected

Definicja w linii 4994 pliku qcustomplot.h.

◆ mSelectedTextColor

QColor QCPTextElement::mSelectedTextColor
protected

Definicja w linii 4995 pliku qcustomplot.h.

◆ mText

QString QCPTextElement::mText
protected

Definicja w linii 4990 pliku qcustomplot.h.

◆ mTextBoundingRect

QRect QCPTextElement::mTextBoundingRect
protected

Definicja w linii 4996 pliku qcustomplot.h.

◆ mTextColor

QColor QCPTextElement::mTextColor
protected

Definicja w linii 4993 pliku qcustomplot.h.

◆ mTextFlags

int QCPTextElement::mTextFlags
protected

Definicja w linii 4991 pliku qcustomplot.h.


Dokumentacja dla tej klasy została wygenerowana z plików: