Qt qpair что это такое
Оглавление
The QPair class is a template class that stores a pair of items. Далее.
Открытые типы
Открытые функции
Public Variables
Связанные нечлены класса
QPair | qMakePair ( const T1 & value1, const T2 & value2 ) |
bool | operator!= ( const QPair & p1, const QPair & p2 ) |
bool | operator & p1, const QPair & p2 ) |
QDataStream & | operator & pair ) |
bool | operator & p1, const QPair & p2 ) |
bool | operator== ( const QPair & p1, const QPair & p2 ) |
bool | operator> ( const QPair & p1, const QPair & p2 ) |
bool | operator>= ( const QPair & p1, const QPair & p2 ) |
QDataStream & | operator>> ( QDataStream & in, QPair & pair ) |
Подробное описание
The QPair class is a template class that stores a pair of items.
QPair can be used in your application if the STL pair type is not available. It stores one value of type T1 and one value of type T2. It can be used as a return value for a function that needs to return two values, or as the value type of a generic container.
Here’s an example of a QPair that stores one QString and one double value:
The components are accessible as public data members called first and second. Например:
QPair’s template data types (T1 and T2) must be assignable data types. You cannot, for example, store a QWidget as a value; instead, store a QWidget *. A few functions have additional requirements; these requirements are documented on a per-function basis.
Описание типов-членов
typedef QPair:: first_type
The type of the first element in the pair (T1).
typedef QPair:: second_type
The type of the second element in the pair (T2).
Описание функций-членов
QPair:: QPair ()
Constructs an empty pair. The first and second elements are initialized with default-constructed values.
QPair:: QPair ( const T1 & value1, const T2 & value2 )
Constructs a pair and initializes the first element with value1 and the second element with value2.
Assigns other to this pair.
Описание типов
T1 QPair:: first
The first element in the pair.
T2 QPair:: second
The second element in the pair.
Связанные нечлены класса
Returns a QPair that contains value1 and value2. Пример:
This is equivalent to QPair (value1, value2), but usually requires less typing.
Возвращает истину если p1 не равно p2; в противном случае возвращает ложь. Two pairs compare as not equal if their first data members are not equal or if their second data members are not equal.
This function requires the T1 and T2 types to have an implementation of operator==().
Returns true if p1 is less than p2; otherwise returns false. The comparison is done on the first members of p1 and p2; if they compare equal, the second members are compared to break the tie.
Writes the pair pair to stream out.
Returns true if p1 is less than or equal to p2; otherwise returns false. The comparison is done on the first members of p1 and p2; if they compare equal, the second members are compared to break the tie.
Возвращает истину если p1 равно p2 ; в противном случае возвращает ложь. Two pairs compare equal if their first data members compare equal and if their second data members compare equal.
This function requires the T1 and T2 types to have an implementation of operator==().
Returns true if p1 is greater than p2; otherwise returns false. The comparison is done on the first members of p1 and p2; if they compare equal, the second members are compared to break the tie.
Returns true if p1 is greater than or equal to p2; otherwise returns false. The comparison is done on the first members of p1 and p2; if they compare equal, the second members are compared to break the tie.
Reads a pair from stream in into pair.
This function requires the T1 and T2 types to implement operator>>().
Все остальные торговые марки являются собственностью их владельцев. Политика конфиденциальности
Лицензиаты, имеющие действительные коммерческие лицензии Qt, могут использовать этот документ в соответствии с соглашениями коммерческой лицензии Qt, поставляемой с программным обеспечением, либо, альтернативно, в соответствии с условиями, содержащимися в письменном соглашении между вами и Nokia.
Кроме того, этот документ может быть использован в соответствии с условиями GNU Free Documentation License version 1.3, опубликованной фондом Free Software Foundation.
Qt Documentation
Contents
The QPair class is a template class that stores a pair of items. More.
Note: All functions in this struct are reentrant.
Public Types
Public Functions
QPair(QPair &&p) | |
QPair(const QPair &p) | |
QPair(const T1 &value1, const T2 &value2) | |
QPair() | |
void | swap(QPair &other) |
QPair & | operator=(const QPair &p) |
QPair & | operator=(QPair &&p) |
Public Variables
Related Non-Members
QPair | qMakePair(const T1 &value1, const T2 &value2) |
void | swap(QPair &lhs, QPair &rhs) |
bool | operator!=(const QPair &p1, const QPair &p2) |
bool | operator &p1, const QPair &p2) |
QDataStream & | operator &pair) |
bool | operator &p1, const QPair &p2) |
bool | operator==(const QPair &p1, const QPair &p2) |
bool | operator>(const QPair &p1, const QPair &p2) |
bool | operator>=(const QPair &p1, const QPair &p2) |
QDataStream & | operator>>(QDataStream &in, QPair &pair) |
Detailed Description
QPair can be used in your application if the STL pair type is not available. It stores one value of type T1 and one value of type T2. It can be used as a return value for a function that needs to return two values, or as the value type of a generic container.
Here’s an example of a QPair that stores one QString and one double value:
The components are accessible as public data members called first and second. For example:
Note, however, that it is almost always preferable to define a small struct to hold the result of a function with multiple return values. A struct trivially generalizes to more than two values, and allows more descriptive member names than first and second :
QPair’s template data types (T1 and T2) must be assignable data types. You cannot, for example, store a QWidget as a value; instead, store a QWidget *. A few functions have additional requirements; these requirements are documented on a per-function basis.
Member Type Documentation
typedef QPair:: first_type
The type of the first element in the pair (T1).
typedef QPair:: second_type
The type of the second element in the pair (T2).
Member Function Documentation
Move-constructs a QPair instance, making it point to the same object that p was pointing to.
This function was introduced in Qt 5.2.
This function was introduced in Qt 5.2.
QPair:: QPair (const T1 &value1, const T2 &value2)
Constructs a pair and initializes the first element with value1 and the second element with value2.
QPair:: QPair ()
Constructs an empty pair. The first and second elements are initialized with default-constructed values.
Swaps this pair with other.
This function was introduced in Qt 5.5.
Copies pair p into this pair.
This function was introduced in Qt 5.2.
Move-assigns pair p into this pair instance.
This function was introduced in Qt 5.2.
Member Variable Documentation
T1 QPair:: first
The first element in the pair.
T2 QPair:: second
The second element in the pair.
Related Non-Members
Returns a QPair that contains value1 and value2. Example:
This is equivalent to QPair (value1, value2), but usually requires less typing.
This is an overloaded function.
This function was introduced in Qt 5.5.
Returns true if p1 is not equal to p2; otherwise returns false. Two pairs compare as not equal if their first data members are not equal or if their second data members are not equal.
Returns true if p1 is less than p2; otherwise returns false. The comparison is done on the first members of p1 and p2; if they compare equal, the second members are compared to break the tie.
Writes the pair pair to stream out.
Returns true if p1 is greater than p2; otherwise returns false. The comparison is done on the first members of p1 and p2; if they compare equal, the second members are compared to break the tie.
Reads a pair from stream in into pair.
В© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.
The QPair class is a template class that stores a pair of items. Далее.
Открытые типы
Открытые функции
Public Variables
Связанные нечлены класса
Подробное описание
The QPair class is a template class that stores a pair of items.
QPair can be used in your application if the STL pair type is not available. It stores one value of type T1 and one value of type T2. It can be used as a return value for a function that needs to return two values, or as the value type of a generic container.
Here’s an example of a QPair that stores one QString and one double value:
The components are accessible as public data members called first and second. Например:
QPair’s template data types (T1 and T2) must be assignable data types. You cannot, for example, store a QWidget as a value; instead, store a QWidget *. A few functions have additional requirements; these requirements are documented on a per-function basis.
Описание типов-членов
typedef QPair::first_type
The type of the first element in the pair (T1).
typedef QPair::second_type
The type of the second element in the pair (T2).
Описание функций-членов
QPair::QPair ()
Constructs an empty pair. The first and second elements are initialized with default-constructed values.
QPair::QPair ( const T1 & value1, const T2 & value2 )
Constructs a pair and initializes the first element with value1 and the second element with value2.
QPair & QPair::operator= ( const QPair & other )
Assigns other to this pair.
Описание типов
T1 QPair::first
The first element in the pair.
T2 QPair::second
The second element in the pair.
Связанные нечлены класса
QPair qMakePair ( const T1 & value1, const T2 & value2 )
Returns a QPair that contains value1 and value2. Пример:
This is equivalent to QPair (value1, value2), but usually requires less typing.
bool operator!= ( const QPair & p1, const QPair & p2 )
Это перегруженная функция, предоставленная для удобства.
Возвращает истину если p1 не равно p2 ; в противном случае возвращает ложь. Two pairs compare as not equal if their first data members are not equal or if their second data members are not equal.
This function requires the T1 and T2 types to have an implementation of operator==().
bool operator & p1, const QPair & p2 )
Это перегруженная функция, предоставленная для удобства.
Returns true if p1 is less than p2; otherwise returns false. The comparison is done on the first members of p1 and p2; if they compare equal, the second members are compared to break the tie.
This function requires the T1 and T2 types to have an implementation of operator & pair )
Это перегруженная функция, предоставленная для удобства.
Writes the pair pair to stream out.
This function requires the T1 and T2 types to implement operator & p1, const QPair & p2 )
Это перегруженная функция, предоставленная для удобства.
Returns true if p1 is less than or equal to p2; otherwise returns false. The comparison is done on the first members of p1 and p2; if they compare equal, the second members are compared to break the tie.
This function requires the T1 and T2 types to have an implementation of operator & p1, const QPair & p2 )
Это перегруженная функция, предоставленная для удобства.
Возвращает истину если p1 равно p2 ; в противном случае возвращает ложь. Two pairs compare equal if their first data members compare equal and if their second data members compare equal.
This function requires the T1 and T2 types to have an implementation of operator==().
bool operator> ( const QPair & p1, const QPair & p2 )
Это перегруженная функция, предоставленная для удобства.
Returns true if p1 is greater than p2; otherwise returns false. The comparison is done on the first members of p1 and p2; if they compare equal, the second members are compared to break the tie.
This function requires the T1 and T2 types to have an implementation of operator = ( const QPair & p1, const QPair & p2 )
Это перегруженная функция, предоставленная для удобства.
Returns true if p1 is greater than or equal to p2; otherwise returns false. The comparison is done on the first members of p1 and p2; if they compare equal, the second members are compared to break the tie.
This function requires the T1 and T2 types to have an implementation of operator > ( QDataStream & in, QPair & pair )
Это перегруженная функция, предоставленная для удобства.
Reads a pair from stream in into pair.
This function requires the T1 and T2 types to implement operator>>().
Qt Documentation
Contents
The QPair class is a template class that stores a pair of items. More.
Public Types
Public Functions
QPair() | |
QPair(const T1 &value1, const T2 &value2) | |
QPair(const QPair &p) | |
QPair(QPair &&p) | |
void | swap(QPair &other) |
QPair & | operator=(const QPair &p) |
QPair & | operator=(QPair &&p) |
Public Variables
Related Non-Members
QPair | qMakePair(const T1 &value1, const T2 &value2) |
void | swap(QPair &lhs, QPair &rhs) |
bool | operator!=(const QPair &p1, const QPair &p2) |
bool | operator &p1, const QPair &p2) |
QDataStream & | operator &pair) |
bool | operator &p1, const QPair &p2) |
bool | operator==(const QPair &p1, const QPair &p2) |
bool | operator>(const QPair &p1, const QPair &p2) |
bool | operator>=(const QPair &p1, const QPair &p2) |
QDataStream & | operator>>(QDataStream &in, QPair &pair) |
Detailed Description
The QPair class is a template class that stores a pair of items.
QPair can be used in your application if the STL pair type is not available. It stores one value of type T1 and one value of type T2. It can be used as a return value for a function that needs to return two values, or as the value type of a generic container.
Here's an example of a QPair that stores one QString and one double value:
The components are accessible as public data members called first and second. For example:
Note, however, that it is almost always preferable to define a small struct to hold the result of a function with multiple return values. A struct trivially generalizes to more than two values, and allows more descriptive member names than first and second :
QPair's template data types (T1 and T2) must be assignable data types. You cannot, for example, store a QWidget as a value; instead, store a QWidget *. A few functions have additional requirements; these requirements are documented on a per-function basis.
Member Type Documentation
typedef QPair:: first_type
The type of the first element in the pair (T1).
typedef QPair:: second_type
The type of the second element in the pair (T2).
Member Function Documentation
QPair:: QPair ()
Constructs an empty pair. The first and second elements are initialized with default-constructed values.
QPair:: QPair (const T1 &value1, const T2 &value2)
Constructs a pair and initializes the first element with value1 and the second element with value2.
This function was introduced in Qt 5.2.
Move-constructs a QPair instance, making it point to the same object that p was pointing to.
This function was introduced in Qt 5.2.
void QPair:: swap ( QPair &other)
Swaps this pair with other.
This function was introduced in Qt 5.5.
Copies pair p into this pair.
This function was introduced in Qt 5.2.
Move-assigns pair p into this pair instance.
This function was introduced in Qt 5.2.
Member Variable Documentation
T1 QPair:: first
The first element in the pair.
T2 QPair:: second
The second element in the pair.
Related Non-Members
Returns a QPair that contains value1 and value2. Example:
This is equivalent to QPair (value1, value2), but usually requires less typing.
This is an overloaded function.
This function was introduced in Qt 5.5.
Returns true if p1 is not equal to p2; otherwise returns false. Two pairs compare as not equal if their first data members are not equal or if their second data members are not equal.
Returns true if p1 is less than p2; otherwise returns false. The comparison is done on the first members of p1 and p2; if they compare equal, the second members are compared to break the tie.
Writes the pair pair to stream out.
Returns true if p1 is greater than p2; otherwise returns false. The comparison is done on the first members of p1 and p2; if they compare equal, the second members are compared to break the tie.
Reads a pair from stream in into pair.
В© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.
Qt Documentation
Contents
The QPair class is a template class that stores a pair of items. More.
Public Types
Public Functions
QPair() | |
QPair(const T1 &value1, const T2 &value2) | |
QPair(const QPair &p) | |
QPair(QPair &&p) | |
void | swap(QPair &other) |
QPair & | operator=(const QPair &p) |
QPair & | operator=(QPair &&p) |
Public Variables
Related Non-Members
QPair | qMakePair(const T1 &value1, const T2 &value2) |
void | swap(QPair &lhs, QPair &rhs) |
bool | operator!=(const QPair &p1, const QPair &p2) |
bool | operator &p1, const QPair &p2) |
QDataStream & | operator &pair) |
bool | operator &p1, const QPair &p2) |
bool | operator==(const QPair &p1, const QPair &p2) |
bool | operator>(const QPair &p1, const QPair &p2) |
bool | operator>=(const QPair &p1, const QPair &p2) |
QDataStream & | operator>>(QDataStream &in, QPair &pair) |
Detailed Description
The QPair class is a template class that stores a pair of items.
QPair can be used in your application if the STL pair type is not available. It stores one value of type T1 and one value of type T2. It can be used as a return value for a function that needs to return two values, or as the value type of a generic container.
Here's an example of a QPair that stores one QString and one double value:
The components are accessible as public data members called first and second. For example:
Note, however, that it is almost always preferable to define a small struct to hold the result of a function with multiple return values. A struct trivially generalizes to more than two values, and allows more descriptive member names than first and second :
QPair's template data types (T1 and T2) must be assignable data types. You cannot, for example, store a QWidget as a value; instead, store a QWidget *. A few functions have additional requirements; these requirements are documented on a per-function basis.
Member Type Documentation
typedef QPair:: first_type
The type of the first element in the pair (T1).
typedef QPair:: second_type
The type of the second element in the pair (T2).
Member Function Documentation
QPair:: QPair ()
Constructs an empty pair. The first and second elements are initialized with default-constructed values.
QPair:: QPair (const T1 &value1, const T2 &value2)
Constructs a pair and initializes the first element with value1 and the second element with value2.
This function was introduced in Qt 5.2.
Move-constructs a QPair instance, making it point to the same object that p was pointing to.
This function was introduced in Qt 5.2.
void QPair:: swap ( QPair &other)
Swaps this pair with other.
This function was introduced in Qt 5.5.
Copies pair p into this pair.
This function was introduced in Qt 5.2.
Move-assigns pair p into this pair instance.
This function was introduced in Qt 5.2.
Member Variable Documentation
T1 QPair:: first
The first element in the pair.
T2 QPair:: second
The second element in the pair.
Related Non-Members
Returns a QPair that contains value1 and value2. Example:
This is equivalent to QPair (value1, value2), but usually requires less typing.
This is an overloaded function.
This function was introduced in Qt 5.5.
Returns true if p1 is not equal to p2; otherwise returns false. Two pairs compare as not equal if their first data members are not equal or if their second data members are not equal.
Returns true if p1 is less than p2; otherwise returns false. The comparison is done on the first members of p1 and p2; if they compare equal, the second members are compared to break the tie.
Writes the pair pair to stream out.
Returns true if p1 is greater than p2; otherwise returns false. The comparison is done on the first members of p1 and p2; if they compare equal, the second members are compared to break the tie.
Reads a pair from stream in into pair.
В© 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.