Important: Please read the Qt Code of Conduct -

[SOLVED] Listview custom delegate editTrigger problem

  • Hi,

    I have a Listview with my own cutom delegate.
    My custom delegate has a pushbutton which should do something.

    The problem is the you cannot click the pushbutton until the row of the ListView is doubleClicked which triggers edit mode.

    What can I do in the listview so that I can click my pushbutton without doubleclicking the item it is in?


  • I found out the way.

    You have to enable mouseTracking on the listView and use its entered(const QModelIndex & index) signal.

    Connect it with a slot open the editor like:

    @void MyDelegate::cell_entered(const QModelIndex &index) {
    if (m_is_any_item_in_edit_mode)
    m_is_any_item_in_edit_mode = true;
    m_current_edited_index = index;

Log in to reply