xlang v4.0 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
QVariant.xcsm
浏览该文件的文档.
1package Qt{
2 @SuppressWarnings public class QVariant{
3 public static const int
4 Invalid = 0,
5 Bool = 1,
6 Int = 2,
7 UInt = 3,
8 LongLong = 4,
9 ULongLong = 5,
10 Double = 6,
11 Char = 7,
12 Map = 8,
13 List = 9,
14 String = 10,
15 StringList = 11,
16 ByteArray = 12,
17 BitArray = 13,
18 Date = 14,
19 Time = 15,
20 DateTime = 16,
21 Url = 17,
22 Locale = 18,
23 Rect = 19,
24 RectF = 20,
25 Size = 21,
26 SizeF = 22,
27 Line = 23,
28 LineF = 24,
29 Point = 25,
30 PointF = 26,
31 RegExp = 27,
32 RegularExpression = 44,
33 Hash = 28,
34 EasingCurve = 29,
35 Uuid = 30,
36 ModelIndex = 42,
37 PersistentModelIndex = 50,
38 LastCoreType = 51,
39 Font = 64,
40 Pixmap = 65,
41 Brush = 66,
42 Color = 67,
43 Palette = 68,
44 Image = 70,
45 Polygon = 71,
46 Region = 72,
47 Bitmap = 73,
48 Cursor = 74,
49 KeySequence = 75,
50 Pen = 76,
51 TextLength = 77,
52 TextFormat = 78,
53 Matrix = 79,
54 Transform = 80,
55 Matrix4x4 = 81,
56 Vector2D = 82,
57 Vector3D = 83,
58 Vector4D = 84,
59 Quaternion = 85,
60 PolygonF = 86,
61 Icon = 69,
62 LastGuiType = 86,
63 SizePolicy = 121,
64 UserType = 1024,
65 LastType = 0xffffffff; // need this so that gcc >= 3.4 allocates 32 bits for Type
66
67 public static void setBytes(byte [] b, int p, int v){
68 b[0 + p] = v & 0xff;
69 b[1 + p] = (v >> 8) & 0xff;
70 b[2 + p] = (v >> 16) & 0xff;
71 b[3 + p] = (v >> 24) & 0xff;
72 }
73
74 public static byte [] toArray(QPoint pt){
75 byte [] p = new byte[10];
76 p[0] = 1;
77 p[1] = Point;
78 setBytes(p, 2, pt.x);
79 setBytes(p, 6, pt.y);
80 return p;
81 }
82
83 public static byte [] toArray(QSize pt){
84 byte [] p = new byte[10];
85 p[0] = 1;
86 p[1] = Size;
87 setBytes(p, 2, pt.cx);
88 setBytes(p, 6, pt.cy);
89 return p;
90 }
91 /*static byte [] toArray(QSizeF pt){
92 byte [] p = new byte[10];
93 p[0] = 1;
94 p[1] = SizeF.value();
95 int v = Math.floatBitsToInt(pt.width());
96 setBytes(p, 2, v);
97 v = Math.floatBitsToInt(pt.height());
98 setBytes(p, 6, v);
99 return p;
100 }
101 static byte [] toArray(QPointF pt){
102 byte [] p = new byte[10];
103 p[0] = 1;
104 p[1] = PointF.value();
105 int v = Math.floatBitsToInt(pt.x());
106 setBytes(p, 2, v);
107 v = Math.floatBitsToInt(pt.y());
108 setBytes(p, 6, v);
109 return p;
110 }*/
111
112 public static byte [] toArray(QRect pt){
113 byte [] p = new byte[18];
114 p[0] = 1;
115 p[1] = Rect;
116 setBytes(p, 2, pt.left);
117 setBytes(p, 6, pt.top);
118 setBytes(p, 10, pt.right);
119 setBytes(p, 14, pt.bottom);
120 return p;
121 }
122 /*static byte [] toArray(QRectF pt){
123 byte [] p = new byte[18];
124 p[0] = 1;
125 p[1] = RectF.value();
126 int v = Math.floatBitsToInt(pt.left());
127 setBytes(p, 2, v);
128 v = Math.floatBitsToInt(pt.top());
129 setBytes(p, 6, v);
130 v = Math.floatBitsToInt(pt.right());
131 setBytes(p, 6, v);
132 v = Math.floatBitsToInt(pt.bottom());
133 setBytes(p, 6, v);
134 return p;
135 }*/
136 };
137};
static byte [] toArray(QRect pt)
static byte [] toArray(QPoint pt)
Definition QVariant.xcsm:74
static byte [] toArray(QSize pt)
Definition QVariant.xcsm:83
static void setBytes(byte [] b, int p, int v)
Definition QVariant.xcsm:67