Nominate our 2022 Qt Champions!

qtreeview, get mouse-selected-item into cell-editing

  • Hi there!

    I wonder if someone could help me to implement a functionality into a qtreeview (multicolumns)like it is known from spreadsheet-programs (like libreoffice calc or MS-excel)?

    Functionality needed:

    • The user is in the process of editing cell A, column a having entered the string "xyz" so far
    • the user clicks the mouse on another cell B column b
    • the string in cell A is extended to "xyzB.b" and editing mode is kept.

    Achieved so far:
    - Overriding the view.closeEditor and view.edit (where view = Qtreeview), I've so far managed to derive a status-variable that indicaes if I'm in edit mode or not.

    - I fail changing the selectionmode such that a mouse click does not end the editing-mode of cell A
    - If I manage to solve the privous point, I'm also not sure how to change the currently edited string....

    Does anyone have a clue (or possibly even has done this and can share the codelins) how this can be achived?

    Thanks a lot in advance!


    (using pyQt5.10)

Log in to reply