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. setView() for QComboBox
Forum Updated to NodeBB v4.3 + New Features

setView() for QComboBox

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 1.0k 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.
  • B Offline
    B Offline
    bdennis98
    wrote on last edited by
    #1

    Hi,

    We are trying to create a custom QTableView for the popUp widget of our subclass of QComboBox. We are currently calling setView() and setModel() using our subclasses of QTableView and QAbstractTableModel. We have had success with getting a QTableView to appear populated and drawn correctly when showPopup() is invoked, but parent QComboBox class only wants to use the row aspect of the indices we generated via pressed() events. I.e., if I select the item with index [2,1] (3rd row, 2nd column), the QComboBox class updates its text with the value at index [2,0] of my model!

    We've also tried specifying a QTableView using a proxy model interfaced to the internal QAbstractItem model object, to leave the internal list-based model with a reliance on rows in place. However, we lost the ability to render the table-view.

    Do we have to override other event processing in our subclass of QComboBox, e.g., event() or mouseReleaseEvent()? Any insight into what we are doing wrong would be appreciated.

    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