Hello,

I have a simple test program that plots 10 curves with 288 points each:

.h
Qt Code:
  1. class MyPlot : public QwtPlot
  2. {
  3. public:
  4. void drawCanvas(QPainter* painter) override
  5. {
  6. const auto start = std::chrono::system_clock::now();
  7. QwtPlot::drawCanvas(painter);
  8. const auto end = std::chrono::system_clock::now();
  9. const auto dt = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
  10. qDebug().nospace() << "dt = " << dt.count() << "ms";
  11. }
  12. };
  13.  
  14.  
  15. class QwtPlotClient : public QDialog
  16. {
  17. Q_OBJECT
  18.  
  19. public:
  20. QwtPlotClient(QWidget* parent = nullptr);
  21.  
  22. private:
  23. Ui::QwtPlotClientClass m_ui;
  24. MyPlot* m_plot = nullptr;
  25.  
  26. };
To copy to clipboard, switch view to plain text mode 

.cpp
Qt Code:
  1. namespace
  2. {
  3. std::vector<QVector<QPointF>> createPlotData(int curveCount = 10, int pointsPerCurve = 288)
  4. {
  5. std::vector<QVector<QPointF>> result;
  6. std::default_random_engine engine(std::random_device{}());
  7. std::uniform_real_distribution<double> distribution(-100.0, 100.0);
  8. for (int curveIndex = 0; curveIndex < curveCount; curveIndex++)
  9. {
  10. QVector<QPointF> curvePoints;
  11. double x = 0.0;
  12. for (int point = 0; point < pointsPerCurve; point++)
  13. {
  14. curvePoints << QPointF(x, distribution(engine));
  15. x += 2.0;
  16. }
  17. result.push_back(curvePoints);
  18. }
  19. return result;
  20. }
  21. }
  22.  
  23. QwtPlotClient::QwtPlotClient(QWidget* parent)
  24. : QDialog(parent),
  25. m_plot(new MyPlot)
  26. {
  27. m_ui.setupUi(this);
  28. m_ui.plotFrame->layout()->addWidget(m_plot);
  29.  
  30. const auto curvePointsList = createPlotData();
  31. for (const auto& curvePoints : curvePointsList)
  32. {
  33. auto* curve = new QwtPlotCurve();
  34. curve->setSamples(curvePoints);
  35. curve->attach(m_plot);
  36. }
  37. }
To copy to clipboard, switch view to plain text mode 

In my main.cpp I define if the program uses high dpi settings or not:
Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. // Comment the following 4 lines for NOT using high dpi settings
  4. QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
  5. QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Round);
  6. QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
  7. QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
  8.  
  9. QApplication a(argc, argv);
  10. QwtPlotClient w;
  11. w.show();
  12. return a.exec();
  13. }
To copy to clipboard, switch view to plain text mode 

As you can see I measure the time that the qwt plot needs for drawing the canvas (see MyPlot::drawCanvas). The results are (on my computer, you probably will have different absolute values):

High dpi settings off: ~25ms (for Debug) / ~10ms (for Release)
High dpi settings on: ~800ms ms (for Debug) / ~570ms (for Release)

I tested this with Qt 5.14.0 and Qwt 6.2.1. (I also tested with Qwt 6.2.0 and the numbers for high dpi settings on are even a bit larger.)

Is there anything I can do? Or do you plan to "fix" this in the near future?