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] QItemDelegate and complex editor widgets loosing focus
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QItemDelegate and complex editor widgets loosing focus

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 2.9k Views 1 Watching
  • 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
    stretch
    wrote on last edited by
    #1

    My subclass of QItemDelegate is providing complex editor widgets to a QTableView. One example of my problem is a QTreeView editor that looses focus and completes the edit when it's contextMenuEvent is triggered.

    What would be the best design to only allow my editor widgets to complete when a button within the editor is pushed? What event would this button trigger and how would I prevent the editors to loose focus?

    Many thanks.

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

      SOLVED: The reason the editor widget was loosing focus was because the QMenu object that was being created during the contextMenuEvent was not being constructed with a parent object defined.

      @c_menu = QtGui.QMenu(self)@

      This ensures the editor widget maintains focus when the context menu is created.

      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