Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-3151

QCursor::setPos() doesn't work well on Qt for Embedded Linux

XMLWordPrintable

      Running the code below works properly on Linux, moving the mouse cursor to the 0,0 and then 50,50 position.
      When running on Qt for Embedded Linux, the position doesn't change, the printed lines all have the same coordinates.

      // ---------------------------------------
      #include <QtGui>

      class TestSetCursor : public QPushButton
      {
      Q_OBJECT
      public:
      TestSetCursor();
      public slots:
      void doClick();
      };

      TestSetCursor::TestSetCursor()
      : QPushButton( 0 )
      {
      setText( "Test" );
      connect( this, SIGNAL( clicked() ), this, SLOT( doClick() ) );
      }

      void TestSetCursor::doClick()
      {
      qDebug() << "Cursor Position at start:" << QCursor::pos();
      QCursor::setPos( 0, 0 );
      qDebug() << "Cursor Position after setting to top-left:" << QCursor::pos();
      QCursor::setPos( 50, 50 );
      qDebug() << "Cursor Position after setting to 50/50:" << QCursor::pos();
      qDebug();
      }

      int main( int argc, char * argv[] )
      {
      QApplication app( argc, argv );
      TestSetCursor tsc;
      tsc.show();
      return app.exec();
      }

      #include "main.moc"
      // ---------------------------------------

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            tvete Paul Olav Tvete
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes