QWT读取MySQL数据并绘制图形,在重新缩放或放大光标后,qwt绘图移动曲线(qwt plot move curve after rescale or zoom on cursor)...
So I find a solution which works perfectly, I finally set a zoom like the google maps zoom.The solution is :catch the widget wheel event in the plot magnifiercreate a private method in the plot magnif
So I find a solution which works perfectly, I finally set a zoom like the google maps zoom.
The solution is :
catch the widget wheel event in the plot magnifier
create a private method in the plot magnifier rescale_on_cursor(double factor, int x_cursor, int y_cursor, QSize parent_size)
In the widget wheel event you will call your method. The factor will be 0,9 or 1,1 (unzoom or zoom), (x, y) the cursor position and QSize the size of the parent widget.
The main idea is to derivate the qwt_plotMagnifier::rescale() and to modify the step where you define the new scale, you will set a percentage of the scale which is equals to the percent of the cursor position.
If x_cursor is equals to 20% of the parent size you will setAxisScale(20%(zoom), 80%(zoom)).
更多推荐


所有评论(0)