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. QGraphicsScene and QGraphicsLineItem Problem

QGraphicsScene and QGraphicsLineItem Problem

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

    Hey Everyone,

    I've followed the Tutorial (link below) of QGraphicsScene and everything works fine.
    http://doc.qt.io/qt-5/qtwidgets-graphicsview-diagramscene-example.html

    Now I've drawn several lines on the scene. When I select one of them, how can I trace back the draw information. I mean the positions of two points. What I wanna do is, when I select the line, I can change its orientation or length with mouse click.

    Thanks in advance
    Best Regards

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      First, when the item is selected, you can use
      qgraphicsitem_cast<QGraphicsLineItem*>(pItem)
      to determine it's actually a line item. With that line item, you can now access and modify the line() property.

      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