class Item :public QwtPolarItem
{
{
Q_UNUSED(center);
Q_UNUSED(elapsed);
painter->scale(0.1, 0.1);
painter->setPen(...);
painter
->setRenderHint
(QPainter::HighQualityAntialiasing);
painter->drawPie(...);
painter->setPen(...);
painter->drawEllipse(...);
painter->setPen(...);
painter->drawLine(...);
painter->setPen(...);
painter->drawEllipse(...);
painter->save();
mx.reset();
painter->setMatrix(mx);
painter->beginNativePainting();
glClearColor(0, 0, 0, 1);
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
//glTranslatef(center.x(), center.y(), 0);
glColor3b(255, 255, 255);
glBegin(GL_LINES);
glVertex2d(0, 0);
glVertex2d(100, 0);
glVertex2d(0, 100);
glVertex2d(100, 100);
glEnd();
glFlush();
painter->endNativePainting();
painter->restore();
}
...
}
class Item :public QwtPolarItem
{
void draw(QPainter *painter, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap,
const QPointF &pole, double radius, const QRectF &canvasRect)
{
Q_UNUSED(center);
Q_UNUSED(elapsed);
painter->scale(0.1, 0.1);
painter->setPen(...);
painter->setRenderHint(QPainter::HighQualityAntialiasing);
painter->drawPie(...);
painter->setPen(...);
painter->drawEllipse(...);
painter->setPen(...);
painter->drawLine(...);
painter->setPen(...);
painter->drawEllipse(...);
painter->save();
QMatrix mx;
mx.reset();
painter->setMatrix(mx);
painter->beginNativePainting();
glClearColor(0, 0, 0, 1);
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
//glTranslatef(center.x(), center.y(), 0);
glColor3b(255, 255, 255);
glBegin(GL_LINES);
glVertex2d(0, 0);
glVertex2d(100, 0);
glVertex2d(0, 100);
glVertex2d(100, 100);
glEnd();
glFlush();
painter->endNativePainting();
painter->restore();
}
...
}
To copy to clipboard, switch view to plain text mode
Bookmarks