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. How to choose an item in QGraphicItem?
Forum Updated to NodeBB v4.3 + New Features

How to choose an item in QGraphicItem?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.3k Views 1 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.
  • R Offline
    R Offline
    romeo.rbw
    wrote on last edited by
    #1

    Hi...
    I have some items in a scene.
    How can I choose an item using my own QPoint like imitating 'selectedItems()' in mouse event.
    @
    QList<QGraphicsItem *> items = scene->selectedItems();
    @

    May be is there a tutorial or some examples?
    Thanks

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goblincoding
      wrote on last edited by
      #2

      I hope I'm not misunderstanding you, but have you tried "QGraphicsScene:items()":http://qt-project.org/doc/qt-4.8/qgraphicsscene.html#items-3 ?

      http://www.goblincoding.com

      1 Reply Last reply
      0
      • R Offline
        R Offline
        romeo.rbw
        wrote on last edited by
        #3

        Thank for reply...
        I already tried QGraphicsScene:items(), but it worked for mouse. In my application, the coordinate point is from user input.

        -romeo

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goblincoding
          wrote on last edited by
          #4

          Hi Romeo,

          I'm afraid I don't quite understand what the problem is. As long as you have the coordinate/point, regardless of where it came from, you can use the above-mentioned function call.

          Any chance of seeing some code?

          http://www.goblincoding.com

          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