|
QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
|
A Qt string or an output device dependent string. More...
#include <qwt3d_label.h>
Classes | |
| class | PrivateData |
Public Member Functions | |
| Label (const Label &other) | |
| Default constructor. | |
| Label (Label &&other) noexcept | |
| Label & | operator= (const Label &other) |
| Copy assignment operator. | |
| Label & | operator= (Label &&other) noexcept |
| Move assignment operator. | |
| Label (const QString &family, int pointSize, int weight=QFont::Normal, bool italic=false) | |
| void | setFont (QString const &family, int pointSize, int weight=QFont::Normal, bool italic=false) |
| Sets the label font. | |
| void | adjust (int gap) |
| Adds an additional shift to the anchor point. | |
| double | gap () const |
| void | setPosition (Qwt3D::Triple pos, ANCHOR a=BottomLeft) |
| Sets the label position and anchor point. | |
| void | setRelPosition (Tuple rpos, ANCHOR a) |
| Sets the label position relative to the viewport. | |
| Qwt3D::Triple | first () const |
| Qwt3D::Triple | second () const |
| ANCHOR | anchor () const |
| virtual void | setColor (double r, double g, double b, double a=1) override |
| Sets the label color from RGBA components. | |
| virtual void | setColor (Qwt3D::RGBA rgba) override |
| Sets the label color from an RGBA object. | |
| void | setString (QString const &s) |
| Sets the label text string. | |
| virtual void | draw () override |
| Draws the label. | |
Public Member Functions inherited from Qwt3D::Drawable | |
| virtual void | saveGLState () |
| virtual void | restoreGLState () |
| void | attach (Drawable *) |
| void | detach (Drawable *) |
| void | detachAll () |
| Qwt3D::Triple | relativePosition (Qwt3D::Triple rel) |
| Calculates world coordinates from relative viewport position. | |
Static Public Member Functions | |
| static void | useDeviceFonts (bool val) |
| Enables or disables device font rendering for all labels. | |
Additional Inherited Members | |
Protected Member Functions inherited from Qwt3D::Drawable | |
| void | Enable (GLenum what, GLboolean val) |
| Qwt3D::Triple | ViewPort2World (Qwt3D::Triple win, bool *err=nullptr) |
| Converts viewport coordinates to world coordinates (glUnProject) | |
| Qwt3D::Triple | World2ViewPort (Qwt3D::Triple obj, bool *err=nullptr) |
| Converts world coordinates to viewport coordinates (glProject) | |
| Drawable (Drawable &&other) noexcept | |
| Drawable & | operator= (Drawable &&other) noexcept |
Protected Attributes inherited from Qwt3D::Drawable | |
| Qwt3D::RGBA | color |
| GLdouble | modelMatrix [16] |
| GLdouble | projMatrix [16] |
| GLint | viewport [4] |
A Qt string or an output device dependent string.
Label provides text rendering on 3D plots, supporting both Qt string representation and device-dependent string output.
| Label::Label | ( | const Label & | other | ) |
Default constructor.
Constructs a Label with specified font parameters
| family | Font family name |
| pointSize | Font point size |
| weight | Font weight |
| italic | Whether font is italic |
Destructor
Copy constructor
Move constructor
| void Label::adjust | ( | int | gap | ) |
Adds an additional shift to the anchor point.
| gap | Gap value in pixels |
The shift direction depends on the anchor type: left aligned -->, right aligned <–, top aligned top-down, bottom aligned bottom-up. The unit is user space dependent (one pixel on screen - play around to get satisfying results).
|
overridevirtual |
Draws the label.
Reimplemented from Qwt3D::Drawable.
|
overridevirtual |
Sets the label color from RGBA components.
| r | Red component |
| g | Green component |
| b | Blue component |
| a | Alpha component |
Reimplemented from Qwt3D::Drawable.
|
overridevirtual |
Sets the label color from an RGBA object.
| rgba | RGBA color value |
Reimplemented from Qwt3D::Drawable.
| void Label::setFont | ( | QString const & | family, |
| int | pointSize, | ||
| int | weight = QFont::Normal, |
||
| bool | italic = false |
||
| ) |
Sets the label font.
| family | Font family name |
| pointSize | Font point size |
| weight | Font weight |
| italic | Whether font is italic |
| void Label::setPosition | ( | Qwt3D::Triple | pos, |
| ANCHOR | a = BottomLeft |
||
| ) |
Sets the label position and anchor point.
| pos | Position triple in world coordinates |
| a | Anchor type defining how the label aligns relative to pos |
Anchor example: TopCenter (*) resp. BottomRight (X): +-—*-—+ | Pixmap | +------—X
| void Label::setRelPosition | ( | Tuple | rpos, |
| ANCHOR | a | ||
| ) |
Sets the label position relative to the viewport.
| rpos | Relative position tuple (x,y) |
| a | Anchor type defining how the label aligns |
| void Label::setString | ( | QString const & | s | ) |
Sets the label text string.
| s | Text string to display |
|
static |
Enables or disables device font rendering for all labels.
| val | True to use device fonts, false to use Qt-based rendering |