Following your advise, I:
#include <QTransform>
The new piece of code looks like this:
{
if ( event->buttons() > Qt::NoButton ) {
Key *k = static_cast<Key *>( this->scene()->itemAt( this->mapToScene( event->pos() , QTransform() ) ) );
if ( k != this->focusKey ) {
this->autoRepeatTimer->stop();
if ( this->focusKey ) this->focusKey->hoverLeaveEvent();
this->focusKey = k;
if ( k ) {
k->hoverEnterEvent();
this->autoRepeatTimer->start( 1000 );
}
}
}
}
void Florence::mouseMoveEvent( QMouseEvent *event )
{
if ( event->buttons() > Qt::NoButton ) {
Key *k = static_cast<Key *>( this->scene()->itemAt( this->mapToScene( event->pos() , QTransform() ) ) );
if ( k != this->focusKey ) {
this->autoRepeatTimer->stop();
if ( this->focusKey ) this->focusKey->hoverLeaveEvent();
this->focusKey = k;
if ( k ) {
k->hoverEnterEvent();
this->autoRepeatTimer->start( 1000 );
}
}
}
QGraphicsView::mouseMoveEvent( event );
}
To copy to clipboard, switch view to plain text mode
The new error I get is as follows:
/home/rey/Desktop/florence/qt/src/florence.cpp:148: error: no matching function for call to 'Florence::mapToScene(QPoint, QTransform)'
Key *k = static_cast<Key *>( this->scene()->itemAt( this->mapToScene( event->pos() , QTransform() ) ) );
^
/home/rey/Desktop/florence/qt/src/florence.cpp:148: error: no matching function for call to 'Florence::mapToScene(QPoint, QTransform)'
Key *k = static_cast<Key *>( this->scene()->itemAt( this->mapToScene( event->pos() , QTransform() ) ) );
^
To copy to clipboard, switch view to plain text mode
Bookmarks