2 Attachment(s)
Qwt 6.2 - problems with high dpi scaling
Hello,
consider the following code:
Code:
int main(int argc, char *argv[])
{
// The next four lines enable high dpi scaling for the application
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Round);
QwtPlotClient w;
w.show();
return a.exec();
}
QwtPlotClient
::QwtPlotClient(QWidget *parent
){
m_ui.setupUi(this);
m_ui.plotFrame->layout()->addWidget(m_plot);
m_plot
->insertLegend
(legend,
QwtPlot::BottomLegend);
QVector<QPointF> points
{ QPointF(0,
25),
QPointF(10,
12),
QPointF(20,
20),
QPointF(30,
31),
QPointF(40,
20),
QPointF(50,
15) };
curve1->setSamples(points);
curve1
->setPen
(QPen(Qt
::red));
curve1
->setLegendAttribute
(QwtPlotCurve::LegendShowLine,
true);
curve1
->setLegendAttribute
(QwtPlotCurve::LegendShowSymbol,
true);
curve1->attach(m_plot);
m_plot
->setAxisAutoScale
(QwtPlot::xBottom,
true);
m_plot
->setAxisAutoScale
(QwtPlot::yLeft,
true);
}
Running this code gets the following result (the legend is broken):
Attachment 13808
When I remove the first 4 lines in main(), qwt behaves as expected (the legend is correct):
Attachment 13807
We used to use Qwt 6.1.4 before and there were no problems with high dpi scaling like this.
Is this a bug or am I missing something?
Re: Qwt 6.2 - problems with high dpi scaling
Which Qt version ?
Do you also see the problem when using https://sourceforge.net/p/qwt/git/ci/qwt-6.2/tree/ ?
Uwe
Re: Qwt 6.2 - problems with high dpi scaling
The Qt version we are using is 5.14.0.
I am not sure about your second question. The problem occurs with qwt 6.2.0, qwt 6.1.4 worked fine (we can exactly define the commit when the problem showed up and that commit was the upgrade from qwt 6.1.4 to qwt 6.2). Does your link lead to an advanced version of qwt 6.2? If yes, I will try it.
Re: Qwt 6.2 - problems with high dpi scaling
Quote:
Originally Posted by
mwh
Does your link lead to an advanced version of qwt 6.2?
This is the 6.2 branch, with all bugfixes that have been reported so far against 6.2.0. The next minor release ( = 6.2.1 ) will be made of it.
It does not include changes that break binary compatibility - those exclusively go to the development branch ( https://sourceforge.net/p/qwt/git/ci/develop/tree/ )
Uwe
1 Attachment(s)
Re: Qwt 6.2 - problems with high dpi scaling
Thank you for the information. I tried with the binary compatible version containing the bugfixes and the bug is gone.
Attachment 13809
So my next question is do you already have an ETA for the 6.2.1? Or can you recommend using the bugfix version as it is now?
Re: Qwt 6.2 - problems with high dpi scaling
A bugfix branch should always be better than the latest corresponding release. According Qwt 6.2.1: guess it is time to publish what has been fixed over the last 2 years.
Also note, that the development branch should also have no bugs. However its API is not stable yet.
Uwe
Re: Qwt 6.2 - problems with high dpi scaling
Thank you for the information.