PDA

View Full Version : QCursor::setPos



Levon Nikoghosyan
26th December 2006, 08:14
I have re-implemented keyPressEvent for my class inherited from QDialog

void my_dialog::keyPressEvent(QKeyEvent* e)
{
QCursor c = this->cursor();
QCursor::setPos (mapToGlobal( QPoint( width()/2, height()/2 )) );

}
I want to move cursor to the center of widget, but nothing happens

which is my mistake ?

Levon Nikoghosyan
26th December 2006, 08:16
sorry ... first line in the function not used :)