Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Move rectangle by mouse dragging

Move rectangle by mouse dragging

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 683 Views
  • 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.
  • S Offline
    S Offline
    samdol
    wrote on last edited by samdol
    #1

    Hi,
    I would like to draw a rectangle on my jpg image and move the rectangle by mouse dragging
    . I could load my jpg image file on QLabel object by painter.drawImage(QPoint(0, 0), myJpegImage); in paintEvent(). I also could draw Rect using painter->drawRect(myRect). But I don't know how to move my rect by mouse dragging. Any suggestions?

    1 Reply Last reply
    0
    • O Offline
      O Offline
      Oleksandr Malyushytskyy
      wrote on last edited by
      #2

      QGraphicsView/QGraphicsScene might be what you are looking for.

      1 Reply Last reply
      1

      • Login

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