Why the result of display is not anti-aliased?
grCanvas derived from QGLWidget.
Code:
{
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
);
}
the code to draw texts, edges, nodes are inside the function RunOpenGL(&ipainter,ShowLens)
the display is like this:http://www.qtcentre.org/attachment.p...8&d=1313790664
Why the QPainter::Antialiasing fail to act?
Looking for your advice.
Thanks a lot.
Re: Why the result of display is not anti-aliased?
You need to enable supersampling for your GL context for antialiasing to work with OpenGL.
Re: Why the result of display is not anti-aliased?
Quote:
Originally Posted by
wysota
You need to enable supersampling for your GL context for antialiasing to work with OpenGL.
I am sorry, actually there is no opengl code in the function "RunOpenGL"
thank you all the same.
Re: Why the result of display is not anti-aliased?
It doesn't matter, your widget is a QGLWidget.