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] Listview custom delegate editTrigger problem

[SOLVED] Listview custom delegate editTrigger problem

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

    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?

    Regards

    1 Reply Last reply
    0
    • S Offline
      S Offline
      smita30apr
      wrote on last edited by
      #2

      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_list_view->closePersistentEditor(m_current_edited_index);
      m_list_view->openPersistentEditor(index);
      m_is_any_item_in_edit_mode = true;
      m_current_edited_index = index;
      }@

      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