Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
 
int columnCount () const
 

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 16 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 20 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 35 of file qtablewidget.h.

◆ columnCount()

int QTableWidgetSelectionRange::columnCount ( ) const
inline
Since
4.1

Returns the number of columns in the range.

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

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

Definition at line 39 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 36 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 37 of file qtablewidget.h.

◆ rowCount()

int QTableWidgetSelectionRange::rowCount ( ) const
inline
Since
4.1

Returns the number of rows in the range.

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

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

Definition at line 38 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 34 of file qtablewidget.h.

Friends And Related Symbol Documentation

◆ operator!=

bool QTableWidgetSelectionRange::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 30 of file qtablewidget.h.

◆ operator==

bool QTableWidgetSelectionRange::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 24 of file qtablewidget.h.


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