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] QComboBox inside QTableWidget
Qt 6.11 is out! See what's new in the release blog

[Solved] QComboBox inside QTableWidget

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

    Hi,

    I put some ComboBox inside a QTableWidget and this is ok.

    I have a function where the only argument I have is the pointer to the Table.

    How can I get the pointers to the QComboBoxes INSIDE that Table?

    I tried this... but it obviously did not work.
    @QComboBox* TableComboBoxes = TableComplexPulses->item(row,col)@

    1 Reply Last reply
    0
    • P Offline
      P Offline
      pkj__
      wrote on last edited by
      #2

      Use "QTableWidget::cellWidget":http://qt-project.org/doc/qt-4.8/qtablewidget.html#cellWidget
      Cast it to QComboBox.
      @QComboBox combo = qobject_cast<QComboBox>(tblWidget->cellWidget(row,col);@

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bareil76
        wrote on last edited by
        #3

        Found my answer...here it is.

        @QComboBox *combo = qobject_cast<QComboBox *>(TableComplexPulses->cellWidget(row,col));@

        Edit: Seems I am too slow to post! :)

        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