QCustomPlot Discussion and Comments

Bug: Right mouse click enables Antialisaing for not antialiased elementsReturn to overview

Hi,

I use the following Antialisasing settings for my plot:

setNoAntialiasingOnDrag(true);
setNotAntialiasedElements(QCP::AntialiasedElement::aeAll);

A mouseReleaseEvent() turns aliasing on for the graph although antialiasing is disabled for all objects. If I remove the line setNoAntialiasingOnDrag(true), then everything works like expected.

I debugged the code and I think the problem is located here:

void QCPAxisRect::mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos)
{
  Q_UNUSED(event)
  Q_UNUSED(startPos)
  mDragging = false;
  if (mParentPlot->noAntialiasingOnDrag())
  {
    mParentPlot->setAntialiasedElements(mAADragBackup);
    mParentPlot->setNotAntialiasedElements(mNotAADragBackup);
  }
}

I have same problem

Hello Uwe, thanks for the report.

Do you call the "setNotAntialiasedElements(QCP::AntialiasedElement::aeAll);" in between the mousePress and the mouseRelease event? Actually the mAADragBackup/mNotAADragBackup should restore the state of the antialiasing/notantialiasing groups perfectly to the state before the mousePress. I'll have a closer look nevertheless.

Out of interest: What is the use case for having all elements not-antialiased, and at the same time enabling the setNoAntialiasingOnDrag?

Hi,

the user, or the programmer that uses our plot derived from QCustomPlot, may enable or disable AntiAliasing but no matter what the user selects, AntiAliasing shall always be disabled for Drag operations because we work with large data sets (4 Million pooints and more).