xlang v4.0 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
QRect.xcsm
浏览该文件的文档.
1//xlang Source, Name:QRect.xcsm
2//Date: Mon Oct 21:43:55 2018
3package Qt{
4 @SuppressWarnings public class QRect{
5 public QRect(){
6 }
7 public QRect(@NotNilptr QRect rc){
8 left = rc.left;
9 top = rc.top;
10 right = rc.right;
11 bottom = rc.bottom;
12 }
13 public QRect(int l, int t,int r,int b){
14 left = l;
15 top = t;
16 right = r;
17 bottom = b;
18 }
19
20 public int left, top, right, bottom;
21
22 public QPoint centerPoint(){
23 return new QPoint((left + right) / 2, (top + bottom) / 2);
24 }
25
26 public int width(){
27 return right - left;
28 }
29
30 public int height(){
31 return bottom - top;
32 }
33
34 public void offset(int x, int y){
35 left += x;
36 top += y;
37 right += x;
38 bottom += y;
39 }
40
41 public bool contains(int x, int y){
42 if (x > left && x < right){
43 return y > top && y < bottom;
44 }
45 return false;
46 }
47
48 public void offset(@NotNilptr QPoint pt){
49 left += pt.x;
50 top += pt.y;
51 right += pt.x;
52 bottom += pt.y;
53 }
54 };
55};
void offset(int x, int y)
Definition QRect.xcsm:34
int bottom
Definition QRect.xcsm:20
int width()
Definition QRect.xcsm:26
void offset(@NotNilptr QPoint pt)
Definition QRect.xcsm:48
bool contains(int x, int y)
Definition QRect.xcsm:41
QPoint centerPoint()
Definition QRect.xcsm:22
int height()
Definition QRect.xcsm:30
QRect(int l, int t,int r,int b)
Definition QRect.xcsm:13