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



  • 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();
    

    }@



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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.