PDA

View Full Version : QCursor::setPos() - doesn't work



Piskvorkar
21st March 2010, 14:24
Hi, i have found some other topics about this, but I haven't found any answers which could help me.

I've problem with setting cursor position on Ubuntu (9.10, didn't try others). On WinXP it works properly. Here is simple exmaple:



void Editor::foo() // Editor inherits from QGraphicsView
{
qDebug() << "before: cursor pos=" << QCursor::pos();
QCursor::setPos(mapToGlobal(mapFromScene(m_selecte dItem->pos())));
qDebug() << "after: cursor pos=" << QCursor::pos();
}


Both WinXP and Ubuntu returns right pos() (after is diferent), but on Ubuntu cursor remains on original position. However Ubuntu seems to work with moved cursor, but don't draw it on new position. (Or move it back automatically). If I try setPos to mapToGlobal(QPoint(10,10)), panel shows tooltip ("Browse and run installed applications").

Any ideas? Is it bug in Qt?