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. [SOLVED]i want to do sth when i expand or collapse a QTreeWidgetItem
QtWS25 Last Chance

[SOLVED]i want to do sth when i expand or collapse a QTreeWidgetItem

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

    i want to do sth when i expand or collapse a QTreeWidgetItem.
    i saw there are publis SLOTS in the QTreeWidget, and i override them in my inherit class, but it donot work.
    i will try signal itemExpanded/Collapsed, and i guess it will work.but, i will send the signal to the slot in the same class, from this to this.

    i want to know what is the normal way to do this?

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

      Hi,

      If you are talking about e.g. collapseItem then it's normal yours is not called, it's not a virtual slot. Also, it's not a slot that reacts on the collapse of an item but that does it. You should connect itemExpanded to a custom slot named e.g. onItemExpanded.

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

      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