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. Activated signal in QTreeView
Forum Updated to NodeBB v4.3 + New Features

Activated signal in QTreeView

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 6.9k 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.
  • A Offline
    A Offline
    Anticross
    wrote on last edited by
    #1

    When i make connection of QTreeView activated(const QModelIndex &) to my slot:
    @ connect(m_ui->treeView, SIGNAL(activated(QModelIndex)), this, SLOT(onActivated(QModelIndex)));@
    and put a breakpoint in slot I don't get there. Click or double-click on item only shows delegate but don't get to slot. When i replace signal activated by signal click it works perfect. So when signal activated emits from QTreeView ?
    In assistant i find that :

    bq. This signal is emitted when the item specified by index is activated by the user. How to activate items depends on the platform; e.g., by single- or double-clicking the item, or by pressing the Return or Enter key when the item is current.

    And I need to catch pre-editing of my item(the moment when I call delegate) and replace old delegate by new one in my slot.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mirswith
      wrote on last edited by
      #2

      The activated signal is working fine for me, I think it depends on how you are interpreting "activated", this is not the same as "selected". As per the quote you supplied activation is different for each platform; on windows for example it seems to fire when I double click an item. I am not sure what functionality you are after specifically but if you are after a selection change then you could try subclassing QTreeView and override the selectionChanged slot.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Anticross
        wrote on last edited by
        #3

        It don't work on windows platform if double-clicking on item. I know that this is not the same as "selected", but with selected (click signal) it works, I mean it enters my slot, but if I use activated signal it never get there (even when I enter item, change value and press "Enter" key). So I need to know when the signal activated is emitted in my case? Maybe it don't work because I use item delegate ?

        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