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. Want to show training lines when we move the rectangles

Want to show training lines when we move the rectangles

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 1.3k 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.
  • Q Offline
    Q Offline
    Qt Enthusiast
    wrote on last edited by
    #1

    I have a rectangle in QGraphicsView , now when we move the rectangle from position X to Y .
    it should trailing eges when moving from X to Y and when mouse is released then the trailing edges should go away
    .

    https://postimg.org/image/ggqxwdcsp/89238d05/

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      if you take a look for
      http://doc.qt.io/qt-5/qtwidgets-graphicsview-diagramscene-example.html

      It draw lines between object. You can use same code to do what you want.
      You just need a line for each corner.
      If I understand right what "trailing eges" means.

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        Qt Enthusiast
        wrote on last edited by
        #3

        I think my requirement is different

        not the requirement
        the trailing lines should show dottled lines from start point to end
        when mouseMovement

        like the rectangle is moving

        mrjjM 1 Reply Last reply
        0
        • Q Qt Enthusiast

          I think my requirement is different

          not the requirement
          the trailing lines should show dottled lines from start point to end
          when mouseMovement

          like the rectangle is moving

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Qt-Enthusiast

          You can easy change the look of the line.
          QPen QGraphicsLineItem::pen() const

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            Qt Enthusiast
            wrote on last edited by
            #5

            but it is not showing the rectangle moving from point X to point Y

            1 Reply Last reply
            0
            • Q Offline
              Q Offline
              Qt Enthusiast
              wrote on last edited by
              #6

              Let me try byt myself

              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