QPair(3qt)
π QPair π
okay bestie, so this is the manual page for QPair from the 3qt manual β it's a value-based template class that provides a pair of elements β¨
πΈ NAME πΈ
QPair β a value-based template class that provides a pair of elements π«Ά
β¨ SYNOPSIS β¨
#include <qpair.h>
π Public Members
typedef T1 first_type
typedef T2 second_type
QPair ()
QPair ( const T1 & t1, const T2 & t2 )
QPair<T1, T2> & operator= ( const QPair<T1, T2> & other )
π RELATED FUNCTION DOCUMENTATION
QPair qMakePair ( T1 t1, T2 t2 )
π¦ DESCRIPTION π¦
The QPair class is a value-based template class that provides a pair of elements. no cap, that's the whole vibe π
QPair is a Qt implementation of an STL-like pair. It can be used in your application if the standard pair<> is not available on your target platforms. like, it's giving "we have pair at home" but the pair at home actually slays π₯
QPair<T1, T2> defines a template instance to create a pair of values that contains two values of type T1 and T2. Please note that QPair does not store pointers to the two elements; it holds a copy of every member. This is why these kinds of classes are called value based. If you're interested in pointer based classes see, for example, QPtrList and QDict.
QPair holds one copy of type T1 and one copy of type T2, but does not provide iterators to access these elements. Instead, the two elements (first and second) are public member variables of the pair. QPair owns the contained elements. For more relaxed ownership semantics, see QPtrCollection and friends which are pointer-based containers. it's giving "you break it, you bought it" energy ngl π
Some classes cannot be used within a QPair: for example, all classes derived from QObject and thus all classes that implement widgets. Only "values" can be used in a QPair. To qualify as a value the class must provide:
- A copy constructor
- An assignment operator
- A constructor that takes no arguments
Note that C++ defaults to field-by-field assignment operators and copy constructors if no explicit version is supplied. In many cases this is sufficient. π
QPair uses an STL-like syntax to manipulate and address the objects it contains. See the QTL documentation for more information.
Functions that need to return two values can use a QPair. two birds one iconic stone π
See also Qt Template Library Classes, Implicitly and Explicitly Shared Classes, and Non-GUI Classes.
π§ Member Type Documentation π§
QPair::first_type
The type of the first element in the pair. the main character, arguably β
QPair::second_type
The type of the second element in the pair. the supporting lead but make it iconic π
π MEMBER FUNCTION DOCUMENTATION π
QPair::QPair ()
Constructs an empty pair. The first and second elements are default constructed. blank slate era β¨
QPair::QPair ( const T1 & t1, const T2 & t2 )
Constructs a pair and initializes the first element with t1 and the second element with t2. matchmaker behavior fr fr π«Ά
π RELATED FUNCTION DOCUMENTATION π
QPair qMakePair ( T1 t1, T2 t2 )
This is a template convenience function. It is used to create a QPair<> object that contains t1 and t2. it's giving "let me just build that for you" π
π SEE ALSO π
π COPYRIGHT π
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. read the license bestie, it's literally right there π
π AUTHOR π
Generated automatically from the source code. not a human, just vibes π€β¨
π BUGS π
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. π«Ά
The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. lowkey a side quest but we respect it π§
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qpair.3qt) and the Qt version (3.3.8). don't forget those two, they need them or the report is just a scream into the void π
and that's the whole page bestie, every flag, every type, every path β nothing skipped, nothing invented π
Trolltech AS β 2 February 2007 β Qt version 3.3.8 β¨ that's the source, the version and the date, mwah π periodt πΈ
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms