superwave
19th August 2011, 22:52
grCanvas derived from QGLWidget.
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::SmoothPixmapTrans form, 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.php?attachmentid=6778&d=1313790664
Why the QPainter::Antialiasing fail to act?
Looking for your advice.
Thanks a lot.
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::SmoothPixmapTrans form, 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.php?attachmentid=6778&d=1313790664
Why the QPainter::Antialiasing fail to act?
Looking for your advice.
Thanks a lot.