grCanvas derived from QGLWidget.
{
ipainter.begin(this);
ipainter.
setWindow(QRect(this
->translate.
X-iMargin,this
->translate.
Y-iMargin,zoom.
X+2*iMargin,zoom.
Y+2*iMargin
));
//ipainter.setRenderHint(QPainter::SmoothPixmapTransform, true);
ipainter.
setRenderHint(QPainter::Antialiasing);
CanvasDrawer->RefreshCanvas(this);
CanvasDrawer->RunOpenGL(&ipainter,ShowLens);
if(ShowLens==TRUE)
ipainter.
drawImage(m_pos
- QPointF(m_radius, m_radius
), m_lens_image
);
}
void grCanvas::paintEvent(QPaintEvent* event)
{
QPainter ipainter(this);
ipainter.begin(this);
ipainter.setWindow(QRect(this->translate.X-iMargin,this->translate.Y-iMargin,zoom.X+2*iMargin,zoom.Y+2*iMargin));
//ipainter.setRenderHint(QPainter::SmoothPixmapTransform, true);
ipainter.setRenderHint(QPainter::Antialiasing);
CanvasDrawer->RefreshCanvas(this);
CanvasDrawer->RunOpenGL(&ipainter,ShowLens);
if(ShowLens==TRUE)
ipainter.drawImage(m_pos - QPointF(m_radius, m_radius), m_lens_image);
}
To copy to clipboard, switch view to plain text mode
the code to draw texts, edges, nodes are inside the function RunOpenGL(&ipainter,ShowLens)
the display is like this:
Why the QPainter::Antialiasing fail to act?
Looking for your advice.
Thanks a lot.
Bookmarks