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 - selection signals/new/old/changed?

QGraphicsScene - selection signals/new/old/changed?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qgraphicssceneqgraphicsview
3 Posts 2 Posters 773 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.
  • D Offline
    D Offline
    Dariusz
    wrote on last edited by
    #1

    Hey

    I'm studying QGraphicsScene/view. I wish to understand how I can detect when new item is being selected, when item is being deselected and when item is being added/removed via shift/& control modifiers...

    QTreeView has a nice function for it that send an update of new/old/etc selections but I can't find anything like it in QGraphicsScene.

    I'm also going over source but so far no luck... Qt has it implemented shift/ctrl all works great, I just can't find the source/or a right function to listen to it...

    I know that scene can fire selectionChanged() but that is dynamic and happens while I drag, I just need before/after to do proper computation based of new/deselected items.

    TIA

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

      Hi,

      Could it be that it is the QGraphicsScene::focusItemChanged that you are looking for ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      2
      • SGaistS SGaist

        Hi,

        Could it be that it is the QGraphicsScene::focusItemChanged that you are looking for ?

        D Offline
        D Offline
        Dariusz
        wrote on last edited by
        #3

        @sgaist Hmmmmmmmmm I wrote a little routine to use mouse press/release to see what has changed to determine my selection but it does not work as well as I wish. But I missed that focusItemChanged mhmhmhmh thanks! Will go over it again :- )

        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