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. The QtreeView selection row freeze
Qt 6.11 is out! See what's new in the release blog

The QtreeView selection row freeze

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.8k 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.
  • jerome_isAviableJ Offline
    jerome_isAviableJ Offline
    jerome_isAviable
    wrote on last edited by
    #1
    • here is the conditions: i have a qtreeview promoted and a custom model (QAbstractItemModel) with a specific class for items. And from the promoted QtreeView class, i have a mouseReleaseEvent() slot create for catch right and left click release events from the viewport of the view. I use it by opene a popup window and emit signals that a DialogBox use to connect to some slots (4 signals, one on right click and 3 on menu actions from popup menu chooses)... each of them do actions for populate the view by the model.
      The view is well populate, dataChanged signal from model is only call (1 time) when i edit an item. i can add childs item too by this way... and the model at the end will well populate a database from datas collected/created.

    • problem: i populate the view with for exemple 5 items (childs or not) and select a line, and an other, ect... and quickly, the view freeze on selection by mouse click... the signals works again, but give back all the time the last selection from freeze time... slots are well mounted and i can follow to populate (but only from the blocked index). If i delete a row (one of my 3 options menu popup), the view unfreeze... and go back freeze the same way after some selections.

    • what's works / what i try : debugger never show me nothing, but by debugger, the view need much more selections before freeze (3 times more). The Valgrind tools analyze not show me nothing anormal (i think), but again... need more actions selections to freeze than debug mode.... And then, if i use the slot called by the signal emit from the left release mouse click event for tell the view to setCurrentIndex to current index from the event click, this works fine... but i can not more open the hierarchy tree by click on the arrows.... I never find where this come from.

    • any idea ? what can be make freeze a view ? and/or what i can do (which is the code) for tell the view to open tree when i click on the arrow (because this will do the job better than the automatic strange job do the view... when it want...) ? OR what i can do for find where come from the problem ?

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

      Hi,

      Are sure you are doing the connections only once ?
      Did you look at QWidget::customContextMenuRequested for your purpose ?

      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
      • jerome_isAviableJ Offline
        jerome_isAviableJ Offline
        jerome_isAviable
        wrote on last edited by
        #3

        Yes SGaist, i'm sure.
        here is my promote class of my treeview:
        http://pastebin.com/YWqyAmwc

        and here is my model of the same view:
        http://pastebin.com/8jyGSZQi

        and here is my item class (Classeur):
        http://pastebin.com/JzYgsxs1

        and here my mainwindow where the view is and where i connect signal to slots:
        http://pastebin.com/M74EUTt8

        i go looking what you tell me for read what this talk about...

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          qtexplorer
          wrote on last edited by qtexplorer
          #4

          Hi,
          Has there been a solution for this issue? I am facing a similar problem; the current index freezes while doing multiple left clicks on the tree index.

          I am doing multiple selections using mouse release event for left clicks. All default signals are executed. I wonder how could I debug this issue?

          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