Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QItemSelectionRange Class Reference
[QtGui module]

The QItemSelectionRange class manages information about a range of selected items in a model. More...

 #include <QItemSelectionRange>

Public Functions


Detailed Description

The QItemSelectionRange class manages information about a range of selected items in a model.

A QItemSelectionRange contains information about a range of selected items in a model. A range of items is a contiguous array of model items, extending to cover a number of adjacent rows and columns with a common parent item; this can be visualized as a two-dimensional block of cells in a table. A selection range has a top(), left() a bottom(), right() and a parent().

The QItemSelectionRange class is one of the Model/View Classes and is part of Qt's model/view framework.

The model items contained in the selection range can be obtained by using the items() function. Use QItemSelectionModel::selectedIndexes() to get a list of all selected items for a view.

You can determine whether a given model item lies within a particular range by using the contains() function. Ranges can also be compared using the overloaded operators for equality and inequality, and the intersects() function allows you to determine whether two ranges overlap.

See also Model/View Programming, QAbstractItemModel, QItemSelection, and QItemSelectionModel.


Member Function Documentation

QItemSelectionRange::QItemSelectionRange ()

Constructs an empty selection range.

QItemSelectionRange::QItemSelectionRange ( const QItemSelectionRange & other )

Copy constructor. Constructs a new selection range with the same contents as the other range given.

QItemSelectionRange::QItemSelectionRange ( const QModelIndex & topLeft, const QModelIndex & bottomRight )

Constructs a new selection range containing only the index specified by the topLeft and the index bottomRight.

QItemSelectionRange::QItemSelectionRange ( const QModelIndex & index )

Constructs a new selection range containing only the model item specified by the model index index.

int QItemSelectionRange::bottom () const

Returns the row index corresponding to the lowermost selected row in the selection range.

QModelIndex QItemSelectionRange::bottomRight () const

Returns the index for the item located at the bottom-right corner of the selection range.

See also bottom(), right(), and topLeft().

bool QItemSelectionRange::contains ( const QModelIndex & index ) const

Returns true if the model item specified by the index lies within the range of selected items; otherwise returns false.

bool QItemSelectionRange::contains ( int row, int column, const QModelIndex & parentIndex ) const

This is an overloaded member function, provided for convenience.

Returns true if the model item specified by (row, column) and with parentIndex as the parent item lies within the range of selected items; otherwise returns false.

int QItemSelectionRange::height () const

Returns the number of selected rows in the selection range.

QModelIndexList QItemSelectionRange::indexes () const

Returns the list of model index items stored in the selection.

QItemSelectionRange QItemSelectionRange::intersected ( const QItemSelectionRange & other ) const

Returns a new selection range containing only the items that are found in both the selection range and the other selection range.

This function was introduced in Qt 4.2.

bool QItemSelectionRange::intersects ( const QItemSelectionRange & other ) const

Returns true if this selection range intersects (overlaps with) the other range given; otherwise returns false.

bool QItemSelectionRange::isValid () const

Returns true if the selection range is valid; otherwise returns false.

int QItemSelectionRange::left () const

Returns the column index corresponding to the leftmost selected column in the selection range.

const QAbstractItemModel * QItemSelectionRange::model () const

Returns the model that the items in the selection range belong to.

QModelIndex QItemSelectionRange::parent () const

Returns the parent model item index of the items in the selection range.

int QItemSelectionRange::right () const

Returns the column index corresponding to the rightmost selected column in the selection range.

int QItemSelectionRange::top () const

Returns the row index corresponding to the uppermost selected row in the selection range.

QModelIndex QItemSelectionRange::topLeft () const

Returns the index for the item located at the top-left corner of the selection range.

See also top(), left(), and bottomRight().

int QItemSelectionRange::width () const

Returns the number of selected columns in the selection range.

bool QItemSelectionRange::operator!= ( const QItemSelectionRange & other ) const

Returns true if the selection range differs from the other range given; otherwise returns false.

bool QItemSelectionRange::operator== ( const QItemSelectionRange & other ) const

Returns true if the selection range is exactly the same as the other range given; otherwise returns false.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Developer Network au hasard

Logo

Comment fermer une application

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.2
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web