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. Setting Focus On Table Delegate's Item With Single Click
QtWS25 Last Chance

Setting Focus On Table Delegate's Item With Single Click

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

    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
    0
    • T Offline
      T Offline
      texas
      wrote on last edited by
      #2

      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
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved