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. Select rows and columns in table view
QtWS25 Last Chance

Select rows and columns in table view

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 5.2k 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.
  • I Offline
    I Offline
    issam
    wrote on last edited by
    #1

    I created a table model by sub-classing QStandardItemModel and I used QTableView to create the view.
    I want to get the appropriate row and column selected, when I click a cell in the table view. For example, if I select the cell (2,2) I must get the second row and the second column selected.
    How ?

    http://www.iissam.com/

    1 Reply Last reply
    0
    • F Offline
      F Offline
      franku
      wrote on last edited by
      #2

      Someting like "this":http://qt-project.org/doc/qt-4.8/qtableview.html ?

      See the comment at the bottom of the page.

      This, Jen, is the internet.

      1 Reply Last reply
      0
      • I Offline
        I Offline
        issam
        wrote on last edited by
        #3

        Hi franku,

        The problem is not how to be notified when a selection occurs or how to get the selected indexes.
        The problem is how to make an index's (QModelIndex) appropriate row and column selected !

        The example is at : http://www.iissam.com/sources/codes.php (AHP method)

        CriteriaWizardPage.cpp :
        @
        115 QModelIndex selection = m_matrixView->currentIndex();
        116 int row = selection.row();
        @

        http://www.iissam.com/

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DaFranzl
          wrote on last edited by
          #4

          Sry repost;)

          1 Reply Last reply
          0
          • I Offline
            I Offline
            issam
            wrote on last edited by
            #5

            I know you super DaFranzl ...
            you welcome :)

            http://www.iissam.com/

            1 Reply Last reply
            0
            • I Offline
              I Offline
              issam
              wrote on last edited by
              #6

              Help :(

              http://www.iissam.com/

              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