Hi all,
I have a problem with QMouseEvent.
I try to display my mouse's coordinates but how can I see them?
I tried to display them into a QLineEdit but when I translate int in QString, the QString is empty...
This is my code (Do you see errors?) :
bool conversionTif2bsb::eventFilter( QObject *o, QEvent *e)
{
if(o == _imageFils)
{
//on regarde si un dbl click est effectué
if( e->type() == QEvent::MouseButtonDblClick)
{
QMouseEvent *m = (QMouseEvent *) e;
// x position in leWidth
QString result;
QString buff;
result = buff.arg(m->x(),0,10);
if(result.isEmpty())
{
leWidth->setText("empty"); // I always have empty
}
else
{
leWidth->setText(result);
}
return TRUE;
}
else
{
return false;
}
}
else
{
//when none events
// standard event processing
return FALSE;
}
}
Thx for your replies
Have a nice day