Hi Uwe,
My QwtPlot is plugin so I have no qApplication to queue my events. So I have used ui.gGraph->updateGeometry(); then problem resolved. I have another problem. I have 3 Graph vertically on my screen as you can see from LegendSizeProblem.jpg attachment. I want to make vertically aligned every single part (left scale, right scale, canvas and legend) of Graph.
For canvas I able to set fixed size to be sama in all with setSize and setSizePolicy.
For scales I able to set as below;
sdLeft->setMinimumExtent( 40 );
sdRight->setMinimumExtent( 40 );
QwtScaleDraw *sdLeft = axisScaleDraw(QwtPlot::yLeft);
sdLeft->setMinimumExtent( 40 );
QwtScaleDraw *sdRight = axisScaleDraw(QwtPlot::yRight);
sdRight->setMinimumExtent( 40 );
To copy to clipboard, switch view to plain text mode
For legend I already use that;
I set my legend's font to QFont("Courier New", 10);, And I give my all curve a constant sized name so my every curve name in same font size. Then QwtPlotLayout can calculate same size for every Graph's legend so I can align every Graph's legend vertically. But how can I align every part of legend instead of setting font and curve name?
For example I have tried that; I have set legend as below;
legend->setMaximumWidth(100);
legend->setMinimumWidth(100);
legend->setMaximumWidth(100);
legend->setMinimumWidth(100);
legend->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
To copy to clipboard, switch view to plain text mode
Although my all legend size is same, QwtPlotLayout makes something wrong after this constant setting. How can I solve this problem as you can see from attached sreenshot.
At this point I have another question, QwtPlotLayout only control's max curve name size which locate on legend? or which criteria is used by QwtPlotLayout to align every single part?
Thanks so much.
Regards.
Bookmarks