36 void ViewPainter::init(QPainter *p,
float Scale_,
int DX_,
int DY_,
int dx_,
int dy_,
float FontScale_,
float PrintScale_)
42 DX = floor(
float(DX_) *
Scale) - float(dx_);
43 DY = floor(
float(DY_) * Scale) - float(dy_);
51 f.setPointSizeFloat(
FontScale *
float(f.pointSize()) );
54 p->setWorldXForm(
false);
57 p->setRenderHint(QPainter::Antialiasing,
true);
59 p->setRenderHint(QPainter::TextAntialiasing,
true);
97 Painter->drawLine(x1, y1, x2, y2);
113 z = DX_ + (*pp)*
Scale;
115 z = DY_ - (*(pp+1))*
Scale;
120 z = DX_ + (*pp)*
Scale;
122 z = DY_ - (*(pp+1))*
Scale;
126 z = DX_ + (*pp)*
Scale;
128 z = DY_ - (*(pp+1))*
Scale;
130 Painter->drawLine(x1, y1, x2, y2);
134 z = DX_ + (*pp)*
Scale;
136 z = DY_ - (*(pp+1))*
Scale;
138 Painter->drawLine(x2, y2, x1, y1);
151 int x3, x1, x2, y1, y2;
161 z = DX_ + (*(pp++))*
Scale;
166 z = DY_ - (*(pp++))*
Scale;
170 Painter->drawLine(x0, y0, x3, y0);
171 Painter->drawLine(x1, y2, x2, y1);
172 Painter->drawLine(x2, y2, x1, y1);
193 z = DX_ + (*(pp++)-4.0)*
Scale;
195 z = DY_ - (*(pp++)+4.0)*
Scale;
197 Painter->drawEllipse(x0, y0, d, d);
217 z = DX_ + (*(pp++))*
Scale;
221 z = DY_ - (*(pp++))*
Scale;
224 Painter->drawLine(x0, y0, x0, y2);
225 Painter->drawLine(x1, y1, x0, y0);
226 Painter->drawLine(x2, y1, x0, y0);
245 Painter->drawRect(x1, y1, dx, dy);
257 Painter->drawRect(x1, y1, dx, dy);
273 Painter->drawRoundRect(x1, y1, dx, dy);
289 Painter->drawEllipse(x1, y1, dx, dy);
303 Painter->drawText(x1, y1, 0, 0, Qt::TextDontClip, Text, -1, &r);
305 if(Height) *Height = r.height();
321 while (Text.length()>i) {
322 if ((Text[i].latin1() ==
'_' || Text[i].latin1() ==
'^') &&
323 !Text[i+1].isNull()) {
324 bool is_sub = Text[i++].latin1() ==
'_';
327 if (Text[i] ==
'{') {
329 while (!Text[i+len].isNull() && Text[i+len].latin1() !=
'}') len++;
339 f.setPointSizeFloat(f.pointSizeFloat()*0.8);
342 y1+y + (is_sub ? +0.6 : -0.3) *
343 fbak.pointSizeFloat() * scale,
344 0, 0, Qt::TextDontClip,
345 Text.mid(i, len ? len : 1), -1, &r);
349 i += len ? len + 1 : 1;
354 while (Text.length()>(i+len) && Text[i+len].latin1() !=
'_' &&
356 Text[i+len].latin1() !=
'^' && Text[i+len].latin1() !=
'\n')
359 0, 0, Qt::TextDontClip, Text.mid(i, len), -1, &r);
360 if (h < r.height()) {
365 if (Text.length()>(i+len)&&Text[i+len].latin1() ==
'\n') {
374 if(Height) *Height = y+h;
390 w = int(
float(w)*
Scale);
391 h = int(
float(h)*Scale);
392 Painter->drawArc(x1, y1, w+1, h+1, Angle, ArcLen);
409 Painter->fillRect(x1, y1, dx, dy, QBrush(Color));
421 Painter->eraseRect(x1, y1, dx, dy);
435 Painter->drawRect(x1-5, y1-5, 10, 10);
void drawStarSymbols(int, int, float *)
void drawResizeRect(int, int)
void map(int, int, int &, int &)
void drawLine(int, int, int, int)
void drawArrowSymbols(int, int, float *)
void drawCircleSymbols(int, int, float *)
void fillRect(int, int, int, int, const QColor &)
ViewPainter(QPainter *p=0)
int drawText(const QString &, int, int, int *Height=0)
void drawRoundRect(int, int, int, int)
void drawArc(int, int, int, int, int, int)
int drawTextMapped(const QString &, int, int, int *Height=0)
void drawRect(int, int, int, int)
void drawLines(int, int, float *)
void drawRectD(int, int, int, int)
void init(QPainter *, float, int, int, int, int, float FontScale_=0.0, float PrintScale_=1.0)
void eraseRect(int, int, int, int)
void drawEllipse(int, int, int, int)