Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. French
  4. Clarification sur QModelIndexList
Qt 6.11 is out! See what's new in the release blog

Clarification sur QModelIndexList

Scheduled Pinned Locked Moved Unsolved French
2 Posts 2 Posters 673 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.
  • T Offline
    T Offline
    Tenderbread
    wrote on last edited by
    #1

    Bonjour,

    J'ai dans mon code les lignes suivantes:

    def playlist_selection_changed(self, ix):
        """ Make the new selected name of video into the playlistView the current video to play.
        We receive a QItemSelection from selectionChanged.
        Ref.: https://doc.qt.io/qtforpython/PySide2/QtCore/QItemSelection.html#qitemselection
        """
        i = ix.indexes()[0].row()
    

    La docstring est de moi et la référence pointe vers une page de PySide2 où la zone d'intérêt est la suivante:

    PySide2.QtCore.QItemSelection.indexes()¶
    Return type
    QModelIndexList
    Returns a list of model indexes that correspond to the selected items.

    J'aimerais en apprendre plus sur le type retourné QModelIndexList. Sur le site de documentation, je tourne en rond et aboutit à QList. Est qu'il y a une page de documentation spécifique à QModelIndexList?

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

      Bonjour,

      C'est un typedef défini ici.

      Il s'agit donc d'une liste de QModelIndex contenu dans un container de type QList. Ceci est en C++. Si je ne m'abuse, avec PySide2 ce sera probablement une liste python classique qui sera utilisée comme conteneur.

      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

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved