Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Setting Focus On Table Delegate's Item With Single Click

    General and Desktop
    1
    2
    2328
    Loading More Posts
    • 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.
    • T
      texas last edited by

      I have a QTreeView. One of the columns in the QTreeView uses a QTableView as it's delegate for editing. For the most part it works. The only issue is that I have to click the treeview so that the table view editor is created. Once the table is created the focus falls on item(0,0). So then I have to click again to the table item (which, from a user point of view, was already clicked).

      I don't know if I need to install an event filter, manually send an event or what. Any help would be appreciated.

      1 Reply Last reply Reply Quote 0
      • T
        texas last edited by

        For the record, I did get this to work. What I did might be heretical or horrible. In a nutshell, I reimplemented editorEvent() and eventFilter() to deal with the mouse click position and set the proper model index for the table view delegate.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post