QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt3d_label.h
1#ifndef __LABELPIXMAP_H__
2#define __LABELPIXMAP_H__
3
4#include <qpixmap.h>
5#include <qimage.h>
6#include <qfont.h>
7#include <qpainter.h>
8#include <qfontmetrics.h>
9
10#include "qwt3d_drawable.h"
11
12namespace Qwt3D {
13
26class QWT3D_EXPORT Label : public Drawable
27{
28
29public:
30 Label();
31 // Construct label and initialize with font
32 Label(const QString &family, int pointSize, int weight = QFont::Normal, bool italic = false);
33
34 // Sets the labels font
35 void setFont(QString const &family, int pointSize, int weight = QFont::Normal,
36 bool italic = false);
37
38 // Fine tunes label
39 void adjust(int gap);
40 // Returns the gap caused by adjust()
41 double gap() const { return gap_; }
42 // Sets the labels position
43 void setPosition(Qwt3D::Triple pos, ANCHOR a = BottomLeft);
44 // Sets the labels position relative to screen
45 void setRelPosition(Tuple rpos, ANCHOR a);
46 // Receives bottom left label position
47 Qwt3D::Triple first() const { return beg_; }
48 // Receives top right label position
49 Qwt3D::Triple second() const { return end_; }
50 // Defines an anchor point for the labels surrounding rectangle
51 ANCHOR anchor() const
52 {
53 return anchor_;
54 }
55 virtual void setColor(double r, double g, double b, double a = 1);
56 virtual void setColor(Qwt3D::RGBA rgba);
57
58 // Sets the labels string
59 void setString(QString const &s);
60 // Actual drawing
61 void draw();
62
63 // Decides about use of PDF standard fonts for PDF output
64 static void useDeviceFonts(bool val);
65
66private:
67 Qwt3D::Triple beg_, end_, pos_;
68 QPixmap pm_;
69 QImage buf_, tex_;
70 QFont font_;
71 QString text_;
72
73 ANCHOR anchor_;
74
75 void init();
76 void init(const QString &family, int pointSize, int weight = QFont::Normal,
77 bool italic = false);
78 void update();
79 void convert2screen();
80 double width() const;
81 double height() const;
82
83 int gap_;
84
85 bool flagforupdate_;
86
87 static bool devicefonts_;
88};
89
90} // ns
91
92#endif
可绘制对象的抽象基类
Definition qwt3d_drawable.h:21
Qt 字符串或输出设备依赖的字符串
Definition qwt3d_label.h:27
红-绿-蓝-透明度值
Definition qwt3d_types.h:480
三元组 [x,y,z]
Definition qwt3d_types.h:240
二元组 [x,y]
Definition qwt3d_types.h:213