Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QTableWidgetSelectionRange Class Reference

The QTableWidgetSelectionRange class provides a way to interact with selection in a model without using model indexes and a selection model. More...

#include <qtablewidget.h>

Collaboration diagram for QTableWidgetSelectionRange:

Public Member Functions

 QTableWidgetSelectionRange ()=default
 Constructs an empty table selection range, i.e.
 QTableWidgetSelectionRange (int top, int left, int bottom, int right)
 Constructs the table selection range from the given top, left, bottom and right table rows and columns.
int topRow () const
 Returns the top row of the range.
int bottomRow () const
 Returns the bottom row of the range.
int leftColumn () const
 Returns the left column of the range.
int rightColumn () const
 Returns the right column of the range.
int rowCount () const
 Returns the number of rows in the range.
int columnCount () const
 Returns the number of columns in the range.

Friends

bool operator== (const QTableWidgetSelectionRange &lhs, const QTableWidgetSelectionRange &rhs) noexcept
bool operator!= (const QTableWidgetSelectionRange &lhs, const QTableWidgetSelectionRange &rhs) noexcept

Detailed Description

The QTableWidgetSelectionRange class provides a way to interact with selection in a model without using model indexes and a selection model.

\inmodule QtWidgets

The QTableWidgetSelectionRange class stores the top left and bottom right rows and columns of a selection range in a table. The selections in the table may consist of several selection ranges.

Note
If the item within the selection range is marked as not selectable, e.g., {itemFlags() & Qt::ItemIsSelectable == 0} then it will not appear in the selection range.
See also
QTableWidget

Definition at line 17 of file qtablewidget.h.

Constructor & Destructor Documentation

◆ QTableWidgetSelectionRange() [1/2]

QTableWidgetSelectionRange::QTableWidgetSelectionRange ( )
default

Constructs an empty table selection range, i.e.

a range whose rowCount() and columnCount() are 0.

See also
topRow(), leftColumn(), bottomRow(), rightColumn()

◆ QTableWidgetSelectionRange() [2/2]

QTableWidgetSelectionRange::QTableWidgetSelectionRange ( int top,
int left,
int bottom,
int right )
inline

Constructs the table selection range from the given top, left, bottom and right table rows and columns.

See also
topRow(), leftColumn(), bottomRow(), rightColumn()

Definition at line 21 of file qtablewidget.h.

Member Function Documentation

◆ bottomRow()

int QTableWidgetSelectionRange::bottomRow ( ) const
inline

Returns the bottom row of the range.

See also
topRow(), rightColumn(), rowCount()

Definition at line 36 of file qtablewidget.h.

◆ columnCount()

int QTableWidgetSelectionRange::columnCount ( ) const
inline

Returns the number of columns in the range.

This is equivalent to rightColumn() - leftColumn() + 1.

See also
rowCount(), leftColumn(), rightColumn()

Definition at line 40 of file qtablewidget.h.

◆ leftColumn()

int QTableWidgetSelectionRange::leftColumn ( ) const
inline

Returns the left column of the range.

See also
rightColumn(), topRow(), columnCount()

Definition at line 37 of file qtablewidget.h.

◆ rightColumn()

int QTableWidgetSelectionRange::rightColumn ( ) const
inline

Returns the right column of the range.

See also
leftColumn(), bottomRow(), columnCount()

Definition at line 38 of file qtablewidget.h.

◆ rowCount()

int QTableWidgetSelectionRange::rowCount ( ) const
inline

Returns the number of rows in the range.

This is equivalent to bottomRow() - topRow() + 1.

See also
columnCount(), topRow(), bottomRow()

Definition at line 39 of file qtablewidget.h.

◆ topRow()

int QTableWidgetSelectionRange::topRow ( ) const
inline

Returns the top row of the range.

See also
bottomRow(), leftColumn(), rowCount()

Definition at line 35 of file qtablewidget.h.

◆ operator!=

bool operator!= ( const QTableWidgetSelectionRange & lhs,
const QTableWidgetSelectionRange & rhs )
friend
Since
6.3

Returns true if lhs and rhs are not equal, otherwise returns false.

Definition at line 31 of file qtablewidget.h.

◆ operator==

bool operator== ( const QTableWidgetSelectionRange & lhs,
const QTableWidgetSelectionRange & rhs )
friend
Since
6.3

Returns true if lhs and rhs are equal, otherwise returns false.

Definition at line 25 of file qtablewidget.h.


The documentation for this class was generated from the following files: