Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. qcursor
    Log in to post

    • SOLVED QGraphicsItem set item pos using Cursor
      General and Desktop • qgraphicsview qgraphicsscene qcursor • • Dariusz  

      2
      0
      Votes
      2
      Posts
      46
      Views

      For any1 wondering, its more or less > item->setPos(mNodeViewPtr->mapToScene(mNodeViewPtr->mapFromGlobal(QCursor::pos()))); you can most likely do mNodeViewPtr->viewport()->mapFromGlobal() for more precision I think but I didn't test it.
    • UNSOLVED Unable to map QCursor::pos() to widget coordinates
      General and Desktop • qrect qcursor qpoint • • Dariusz  

      6
      0
      Votes
      6
      Posts
      304
      Views

      Then please provide a minimal compilable example that shows the behaviour.
    • SOLVED Check QCursor::pos() against widget->rect()
      General and Desktop • qwidget qcursor • • Dariusz  

      2
      0
      Votes
      2
      Posts
      118
      Views

      @Dariusz "You can call QWidget::mapFromGlobal() to translate it to widget coordinates." (From https://doc.qt.io/qt-5/qcursor.html#pos)
    • Embedded Qt Mouse Pointer Not Showing Up
      Mobile and Embedded • embedded cursor qcursor • • iwichmann  

      1
      0
      Votes
      1
      Posts
      882
      Views

      No one has replied