Please nominate your Qt Champions for 2021!

Complex editor in delegate

  • Hello everyone.

    I have a problem with complex editors created by a delegate to edit field of QTreeView.

    The editor contain a QLabel (hidden in this case), a QLineEdit and a QPushButton.
    I managed to gave focus to the QLineEdit at editor creation with setFocusProxy(ui.lineEdit)

    My remaining problem is when the QLineEdit looses focus (on clic in another part of the application), the editor is not closed, and so the setModelData not called.
    The only way to close the editor is to change the current item selected in the TreeView.

    I can't figure out where it comes from.

    Thanks for your help !

  • Lifetime Qt Champion


    Can you share your editor code ?

Log in to reply