⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qpair.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
字号:
'\" t.TH QPair 3qt "9 December 2002" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQPair \- Value-based template class that provides a pair of elements.SH SYNOPSIS\fC#include <qpair.h>\fR.PP.SS "Public Members".in +1c.ti -1c.BI "typedef T1 \fBfirst_type\fR".br.ti -1c.BI "typedef T2 \fBsecond_type\fR".br.ti -1c.BI "\fBQPair\fR ()".br.ti -1c.BI "\fBQPair\fR ( const T1 & t1, const T2 & t2 )".br.in -1c.SH RELATED FUNCTION DOCUMENTATION.in +1c.ti -1c.BI "QPair \fBqMakePair\fR ( T1 t1, T2 t2 )".br.in -1c.SH DESCRIPTIONThe QPair class is a value-based template class that provides a pair of elements..PPQPair 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..PPQPair<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 \fIvalue based\fR. If you're interested in \fIpointer based\fR classes see, for example, QPtrList and QDict..PPQPair 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 (\fCfirst\fR and \fCsecond\fR) 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..PPSome 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:.TPA copy constructor.TPAn assignment operator.TPA constructor that takes no arguments.PPNote that C++ defaults to field-by-field assignment operators and copy constructors if no explicit version is supplied. In many cases this is sufficient..PPQPair uses an STL-like syntax to manipulate and address the objects it contains. See the QTL documentation for more information..PPFunctions that need to return two values can use a QPair. The qMakePair() convenience function makes it easy to create QPair objects..PPSee also Qt Template Library Classes, Implicitly and Explicitly Shared Classes, and Non-GUI Classes..SS "Member Type Documentation".SH "QPair::first_type"The type of the first element in the pair..SH "QPair::second_type"The type of the second element in the pair..SH MEMBER FUNCTION DOCUMENTATION.SH "QPair::QPair ()"Constructs an empty pair. The \fCfirst\fR and \fCsecond\fR elements are default constructed..SH "QPair::QPair ( const T1 & t1, const T2 & t2 )"Constructs a pair and initializes the \fCfirst\fR element with \fIt1\fR and the \fCsecond\fR element with \fIt2\fR..SH RELATED FUNCTION DOCUMENTATION.SH "QPair qMakePair ( T1 t1, T2 t2 )"This is a template convenience function. It is used to create a QPair<> object that contains \fIt1\fR and \fIt2\fR. For example:.PP.nf.br        QMap<QString,QString> m;.br        m.insert( qMakePair("Clinton", "Bill") );.br.fi.PPThe above code is equivalent to:.PP.nf.br        QMap<QString,QString> m;.br        QPair<QString,QString> p( "Clinton", "Bill" );.br        m.insert( p );.br.fi.SH "SEE ALSO".BR http://doc.trolltech.com/qpair.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qpair.3qt) and the Qtversion (3.1.1).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -