MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / boundingRect

Method boundingRect

tools/monitor/Edge.cpp:28–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28QRectF
29Monitor::Edge::boundingRect() const
30{
31 if (!parent_ || !child_) {
32 return QRectF();
33 }
34
35 int x1 = parent_->scenePos().x() + parent_->boundingRect().width() - 2;
36 int y1 = parent_->scenePos().y() + parent_->boundingRect().height() - 2;
37 int x2 = child_->scenePos().x() + 2;
38 int y2 = child_->scenePos().y() + 2;
39
40 // calculate the proper bounding rect.
41 if (x1 < x2) {
42 if (y1 < y2) {
43 return QRectF(x1, y1, x2, y2);
44 }
45 else {
46 return QRectF(x1, y2, x2, y1);
47 }
48 }
49 else {
50 if (y1 < y2) {
51 return QRectF(x2, y1, x1, y2);
52 }
53 else {
54 return QRectF(x2, y2, x1, y1);
55 }
56 }
57
58}
59
60void
61Monitor::Edge::paint(QPainter *painter,const QStyleOptionGraphicsItem *,QWidget *)

Callers 2

calcLayoutMethod · 0.80
paintMethod · 0.80

Calls 1

widthMethod · 0.80

Tested by

no test coverage detected