Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Cursor.setPos() isn't sticking, jumps back to pos(0,0) on first mouse event
Forum Updated to NodeBB v4.3 + New Features

Cursor.setPos() isn't sticking, jumps back to pos(0,0) on first mouse event

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 2 Posters 1.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    myuen
    wrote on last edited by
    #1

    Hello,

    I've taken the default QT Quick Application project, and tried to manually set the starting position of the cursor. When the application first starts up, it the cursor appears to be in the correct position (200,200). But the minute I nudge the mouse or click a mouse button, it jumps to position (0,0). Can someone please enlighten me on why this is happening?

    Edit: The code runs fine if I run from a windows desktop. But it does not work when running from my target board which is a sabresd imx6 running a yocto os. It also does not work when I run it off of my virtual machine running ubuntu 14.04. It's odd... I would really appreciate any ideas!

    @int main(int argc, char *argv[])
    {
    QGuiApplication app(argc, argv);

    QtQuick2ApplicationViewer viewer;
    QCursor movit;
    movit.setPos(200,200);
    viewer.setMainQmlFile(QStringLiteral("qml/helloWorldMovecursor/main.qml"));
    viewer.showExpanded();
    
    return app.exec();
    

    }@

    1 Reply Last reply
    0
    • jeremy_kJ Offline
      jeremy_kJ Offline
      jeremy_k
      wrote on last edited by
      #2

      This should depend on the platform used. Using XCB, subsequent mouse events start from 200, 200.

      Asking a question about code? http://eel.is/iso-c++/testcase/

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved