QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 成员函数 | 静态 Public 成员函数 | 所有成员列表
Qwt3D::Label类 参考

A Qt string or an output device dependent string 更多...

#include <qwt3d_label.h>

类 Qwt3D::Label 继承关系图:
Qwt3D::Drawable

class  PrivateData
 

Public 成员函数

 Label (const Label &other)
 Default constructor
 
 Label (Label &&other) noexcept
 
Labeloperator= (const Label &other)
 Copy assignment operator
 
Labeloperator= (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 成员函数 继承自 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
 

静态 Public 成员函数

static void useDeviceFonts (bool val)
 Enables or disables device font rendering for all labels
 

额外继承的成员函数

- Protected 成员函数 继承自 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
 
Drawableoperator= (Drawable &&other) noexcept
 
- Protected 属性 继承自 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::Label ( const Label other)

Default constructor

Constructs a Label with specified font parameters

参数
familyFont family name
pointSizeFont point size
weightFont weight
italicWhether font is italic

Destructor

Copy constructor

Move constructor

成员函数说明

◆ adjust()

void Label::adjust ( int  gap)

Adds an additional shift to the anchor point

参数
gapGap 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).

◆ draw()

void Label::draw ( )
overridevirtual

Draws the label

重载 Qwt3D::Drawable .

◆ setColor() [1/2]

void Label::setColor ( double  r,
double  g,
double  b,
double  a = 1 
)
overridevirtual

Sets the label color from RGBA components

参数
rRed component
gGreen component
bBlue component
aAlpha component

重载 Qwt3D::Drawable .

◆ setColor() [2/2]

void Label::setColor ( Qwt3D::RGBA  rgba)
overridevirtual

Sets the label color from an RGBA object

参数
rgbaRGBA color value

重载 Qwt3D::Drawable .

◆ setFont()

void Label::setFont ( QString const &  family,
int  pointSize,
int  weight = QFont::Normal,
bool  italic = false 
)

Sets the label font

参数
familyFont family name
pointSizeFont point size
weightFont weight
italicWhether font is italic

◆ setPosition()

void Label::setPosition ( Qwt3D::Triple  pos,
ANCHOR  a = BottomLeft 
)

Sets the label position and anchor point

参数
posPosition triple in world coordinates
aAnchor type defining how the label aligns relative to pos

Anchor example: TopCenter (*) resp. BottomRight (X): +-—*-—+ | Pixmap | +------—X

◆ setRelPosition()

void Label::setRelPosition ( Tuple  rpos,
ANCHOR  a 
)

Sets the label position relative to the viewport

参数
rposRelative position tuple (x,y)
aAnchor type defining how the label aligns

◆ setString()

void Label::setString ( QString const &  s)

Sets the label text string

参数
sText string to display

◆ useDeviceFonts()

void Label::useDeviceFonts ( bool  val)
static

Enables or disables device font rendering for all labels

参数
valTrue to use device fonts, false to use Qt-based rendering

该类的文档由以下文件生成: