{
if(e->button() == Qt::LeftButton)
{
//picker->invTransform()
temp.
setX(this
->invTransform
(QwtPlot::xBottom,temp.
x()));
temp.
setY(this
->invTransform
(QwtPlot::yLeft,temp.
y()));
}
}
void plot :: mousePressEvent(QMouseEvent *e)
{
if(e->button() == Qt::LeftButton)
{
QPointF temp = e->posF();
QMessageBox::information(this,tr("information!"),tr("the original x posation is %1 and y posation is %2").arg(temp.x()).arg(temp.y()),QMessageBox::Ok|QMessageBox::Default,QMessageBox::NoButton,QMessageBox::NoButton);
//picker->invTransform()
temp.setX(this->invTransform(QwtPlot::xBottom,temp.x()));
temp.setY(this->invTransform(QwtPlot::yLeft,temp.y()));
QMessageBox::information(this,tr("information!"),tr("changed x posation is %1 and y posation is %2").arg(temp.x()).arg(temp.y()),QMessageBox::Ok|QMessageBox::Default,QMessageBox::NoButton,QMessageBox::NoButton);
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks