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. Clarification needed: QModelIndexList QItemSelectionModel::selectedRows ( int column = 0 ) const
Forum Updated to NodeBB v4.3 + New Features

Clarification needed: QModelIndexList QItemSelectionModel::selectedRows ( int column = 0 ) const

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.4k 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.
  • K Offline
    K Offline
    ki John
    wrote on last edited by SGaist
    #1

    Can someone please clarify what this means?

    How does the description of this method change for selectedRows( 0); and selectedRows( 1); ?
    How can it be "all columns" when your column parameter is 0 or 1?

    bq. QModelIndexList QItemSelectionModel::selectedRows ( int column = 0 ) const
    Returns the indexes in the given column for the rows where all columns are selected.
    This function was introduced in Qt 4.2.
    See also selectedIndexes() and selectedColumns().

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      I think you are mixing two things. The column parameter here allows you to select where the indexes will come from e.g. selectedRows(1) will give you the indexes of (0, 1) (1, 1) and (3,1) if you have rows 0 ,1 and 3 completely selected. If you call it with the default value you would have had the indexes of (0,0), (1,0) and (3,0)

      (x, y) beeing (row, col) index address

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • K Offline
        K Offline
        ki John
        wrote on last edited by
        #3

        Ah, thank you. Now I get it.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You're welcome !

          Since it's all okay, please update the thread title prepending [solved] so other forum users may know an answer has been found :)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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