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

📄 qvariant.3qt

📁 linux下GUI编程工具qt的在线连接帮助手册
💻 3QT
📖 第 1 页 / 共 3 页
字号:
.PPReturns a reference to the stored font..PPSee also toFont()..SH "QIconSet & QVariant::asIconSet ()"Tries to convert the variant to hold a QIconSet value. If that is not possible the variant is set to an empty iconset..PPReturns a reference to the stored iconset..PPSee also toIconSet()..SH "QImage & QVariant::asImage ()"Tries to convert the variant to hold an image value. If that is not possible the variant is set to a null image..PPReturns a reference to the stored image..PPSee also toImage()..SH "int & QVariant::asInt ()"Returns the variant's value as int reference..SH "QKeySequence & QVariant::asKeySequence ()"Tries to convert the variant to hold a QKeySequence value. If that is not possible then the variant is set to an empty key sequence..PPReturns a reference to the stored key sequence..PPSee also toKeySequence()..SH "QValueList<QVariant> & QVariant::asList ()"Returns the variant's value as variant list reference..SH "QMap<QString, QVariant> & QVariant::asMap ()"Returns the variant's value as variant map reference..SH "QPalette & QVariant::asPalette ()"Tries to convert the variant to hold a QPalette value. If that is not possible the variant is set to a palette with black colors only..PPReturns a reference to the stored palette..PPSee also toString()..SH "QPixmap & QVariant::asPixmap ()"Tries to convert the variant to hold a pixmap value. If that is not possible the variant is set to a null pixmap..PPReturns a reference to the stored pixmap..PPSee also toPixmap()..SH "QPoint & QVariant::asPoint ()"Tries to convert the variant to hold a point value. If that is not possible the variant is set to a null point..PPReturns a reference to the stored point..PPSee also toPoint()..SH "QPointArray & QVariant::asPointArray ()"Tries to convert the variant to hold a QPointArray value. If that is not possible the variant is set to an empty point array..PPReturns a reference to the stored point array..PPSee also toPointArray()..SH "QRect & QVariant::asRect ()"Tries to convert the variant to hold a rectangle value. If that is not possible the variant is set to an empty rectangle..PPReturns a reference to the stored rectangle..PPSee also toRect()..SH "QRegion & QVariant::asRegion ()"Tries to convert the variant to hold a QRegion value. If that is not possible the variant is set to a null region..PPReturns a reference to the stored region..PPSee also toRegion()..SH "QSize & QVariant::asSize ()"Tries to convert the variant to hold a QSize value. If that is not possible the variant is set to an invalid size..PPReturns a reference to the stored size..PPSee also toSize() and QSize::isValid()..SH "QSizePolicy & QVariant::asSizePolicy ()"Tries to convert the variant to hold a QSizePolicy value. If that fails, the variant is set to an arbitrary size policy..SH "QString & QVariant::asString ()"Tries to convert the variant to hold a string value. If that is not possible the variant is set to an empty string..PPReturns a reference to the stored string..PPSee also toString()..SH "QStringList & QVariant::asStringList ()"Tries to convert the variant to hold a QStringList value. If that is not possible the variant is set to an empty string list..PPReturns a reference to the stored string list..PPSee also toStringList()..SH "QTime & QVariant::asTime ()"Tries to convert the variant to hold a QTime value. If that is not possible then the variant is set to an invalid time..PPReturns a reference to the stored time..PPSee also toTime()..SH "uint & QVariant::asUInt ()"Returns the variant's value as unsigned int reference..SH "bool QVariant::canCast ( Type t ) const"Returns TRUE if the variant's type can be cast to the requested type, \fIt\fR. Such casting is done automatically when calling the toInt(), toBool(), ... or asInt(), asBool(), ... methods..PPThe following casts are done automatically:.TPBool => Double, Int, UInt.TPCString => String.TPDate => String.TPDateTime => String, Date, Time.TPDouble => String, Int, Bool, UInt.TPInt => String, Double, Bool, UInt.TPList => StringList (if the list contains strings or something that can be cast to a string).TPString => CString, Int, Uint, Double, Date, Time, DateTime.TPStringList => List.TPTime => String.TPUInt => String, Double, Bool, Int.SH "bool QVariant::cast ( Type t )"Casts the variant to the requested type. If the cast cannot be done, the variant is set to the default value of the requested type (e.g. an empty string if the requested type \fIt\fR is QVariant::String, an empty point array if the requested type \fIt\fR is QVariant::PointArray, etc). Returns TRUE if the current type of the variant was successfully casted; otherwise returns FALSE..PPSee also canCast()..SH "void QVariant::clear ()"Convert this variant to type Invalid and free up any resources used..SH "bool QVariant::isValid () const"Returns TRUE if the storage type of this variant is not QVariant::Invalid; otherwise returns FALSE..SH "QValueListConstIterator<QVariant> QVariant::listBegin () const"Returns an iterator to the first item in the list if the variant's type is appropriate, or else a null iterator..SH "QValueListConstIterator<QVariant> QVariant::listEnd () const"Returns the end iterator for the list if the variant's type is appropriate, or else a null iterator..SH "QMapConstIterator<QString, QVariant> QVariant::mapBegin () const"Returns an iterator to the first item in the map, if the variant's type is appropriate, or else a null iterator..SH "QMapConstIterator<QString, QVariant> QVariant::mapEnd () const"Returns the end iterator for the map, if the variant's type is appropriate, or else a null iterator..SH "QMapConstIterator<QString, QVariant> QVariant::mapFind ( const QString & key ) const"Returns an iterator to the item in the map with \fIkey\fR as key, if the variant's type is appropriate and \fIkey\fR is a valid key, or else a null iterator..SH "Type QVariant::nameToType ( const char * name )\fC [static]\fR"Converts the string representation of the storage type gven in \fIname\fR, to its enum representation..PPIf the string representation cannot be converted to any enum representation, the variant is set to Invalid..SH "bool QVariant::operator!= ( const QVariant & v ) const"Compares this QVariant with \fIv\fR and returns TRUE if they are not equal; otherwise returns FALSE..SH "QVariant & QVariant::operator= ( const QVariant & variant )"Assigns the value of the variant \fIvariant\fR to this variant..PPThis is a deep copy of the variant, but note that if the variant holds an explicitly shared type such as QImage, a shallow copy is performed..SH "bool QVariant::operator== ( const QVariant & v ) const"Compares this QVariant with \fIv\fR and returns TRUE if they are equal; otherwise returns FALSE..SH "QValueListConstIterator<QString> QVariant::stringListBegin () const"Returns an iterator to the first string in the list if the variant's type is StringList, or else a null iterator..SH "QValueListConstIterator<QString> QVariant::stringListEnd () const"Returns the end iterator for the list if the variant's type is StringList, or else a null iterator..SH "const QBitArray QVariant::toBitArray () const"Returns the variant as a QBitArray if the variant has type() BitArray, or an empty bitarray otherwise..PPSee also asBitArray()..SH "const QBitmap QVariant::toBitmap () const"Returns the variant as a QBitmap if the variant has type() Bitmap, or a null QBitmap otherwise..PPSee also asBitmap()..SH "bool QVariant::toBool () const"Returns the variant as a bool if the variant has type() Bool..PPReturns TRUE if the variant has type Int, UInt or Double and its value is non-zero; otherwise returns FALSE..PPSee also asBool()..SH "const QBrush QVariant::toBrush () const"Returns the variant as a QBrush if the variant has type() Brush, or a default brush (with all black colors) otherwise..PPSee also asBrush()..SH "const QByteArray QVariant::toByteArray () const"Returns the variant as a QByteArray if the variant has type() ByteArray, or an empty bytearray otherwise..PPSee also asByteArray()..SH "const QCString QVariant::toCString () const"Returns the variant as a QCString if the variant has type() CString or String, or a 0 otherwise..PPSee also asCString()..SH "const QColor QVariant::toColor () const"Returns the variant as a QColor if the variant has type() Color, or an invalid color otherwise..PPSee also asColor()..SH "const QColorGroup QVariant::toColorGroup () const"Returns the variant as a QColorGroup if the variant has type() ColorGroup, or a completely black color group otherwise..PPSee also asColorGroup()..SH "const QCursor QVariant::toCursor () const"Returns the variant as a QCursor if the variant has type() Cursor, or the default arrow cursor otherwise..PPSee also asCursor()..SH "const QDate QVariant::toDate () const"Returns the variant as a QDate if the variant has type() Date, DateTime or String, or an invalid date otherwise..PPNote that if the type() is String an invalid date will be returned if the string cannot be parsed as an Qt::ISODate format date..PPSee also asDate()..SH "const QDateTime QVariant::toDateTime () const"Returns the variant as a QDateTime if the variant has type() DateTime or String, or an invalid date/time otherwise..PPNote that if the type() is String an invalid date/time will be returned if the string cannot be parsed as an Qt::ISODate format date/time..PPSee also asDateTime()..SH "double QVariant::toDouble ( bool * ok = 0 ) const"Returns the variant as a double if the variant has type() String, CString, Double, Int, UInt, or Bool; or 0.0 otherwise..PPIf \fIok\fR is non-null, \fI*ok\fR is set to TRUE if the value could be converted to a double and FALSE otherwise..PPSee also asDouble()..SH "const QFont QVariant::toFont () const"Returns the variant as a QFont if the variant has type() Font, or the default font otherwise..PPSee also asFont()..SH "const QIconSet QVariant::toIconSet () const"Returns the variant as a QIconSet if the variant has type() IconSet, or an icon set of null pixmaps otherwise..PPSee also asIconSet()..SH "const QImage QVariant::toImage () const"Returns the variant as a QImage if the variant has type() Image, or a null image otherwise..PPSee also asImage()..SH "int QVariant::toInt ( bool * ok = 0 ) const"Returns the variant as an int if the variant has type() String, CString, Int, UInt, Double, Bool or KeySequence; or 0 otherwise..PPIf \fIok\fR is non-null, \fI*ok\fR is set to TRUE if the value could be converted to an int and FALSE otherwise..PPSee also asInt() and canCast()..SH "const QKeySequence QVariant::toKeySequence () const"Returns the variant as a QKeySequence if the variant has type() KeySequence, Int or String, or an empty key sequence otherwise..PPNote that not all Ints and Strings are valid key sequences and in such cases an empty key sequence will be returned..PPSee also asKeySequence()..SH "const QValueList<QVariant> QVariant::toList () const"Returns the variant as a QValueList<QVariant> if the variant has type() List or StringList, or an empty list otherwise..PPSee also asList()..SH "const QMap<QString, QVariant> QVariant::toMap () const"Returns the variant as a QMap<QString,QVariant> if the variant has type() Map, or an empty map otherwise..PPSee also asMap()..SH "const QPalette QVariant::toPalette () const"Returns the variant as a QPalette if the variant has type() Palette, or a completely black palette otherwise..PPSee also asPalette()..SH "const QPixmap QVariant::toPixmap () const"Returns the variant as a QPixmap if the variant has type() Pixmap, or a null pixmap otherwise..PPSee also asPixmap()..SH "const QPoint QVariant::toPoint () const"Returns the variant as a QPoint if the variant has type() Point, or a point (0, 0) otherwise..PPSee also asPoint()..SH "const QPointArray QVariant::toPointArray () const"Returns the variant as a QPointArray if the variant has type() PointArray, or an empty QPointArray otherwise..PPSee also asPointArray()..SH "const QRect QVariant::toRect () const"Returns the variant as a QRect if the variant has type() Rect, or an empty rectangle otherwise..PPSee also asRect()..SH "const QRegion QVariant::toRegion () const"Returns the variant as a QRegion if the variant has type() Region, or an empty QRegion otherwise..PPSee also asRegion()..SH "const QSize QVariant::toSize () const"Returns the variant as a QSize if the variant has type() Size, or an invalid size otherwise..PPSee also asSize()..SH "QSizePolicy QVariant::toSizePolicy () const"Returns the variant as a QSizePolicy if the variant has type() SizePolicy, or an undefined (but legal) size policy otherwise..SH "const QString QVariant::toString () const"Returns the variant as a QString if the variant has type() String, CString, ByteArray, Int, Uint, Bool, Double, Date, Time, or DateTime, or QString::null otherwise..PPSee also asString()..SH "const QStringList QVariant::toStringList () const"Returns the variant as a QStringList if the variant has type() StringList or List of a type that can be converted to QString, or an empty list otherwise..PPSee also asStringList()..SH "const QTime QVariant::toTime () const"Returns the variant as a QTime if the variant has type() Time, DateTime or String, or an invalid time otherwise..PPNote that if the type() is String an invalid time will be returned if the string cannot be parsed as an Qt::ISODate format time..PPSee also asTime()..SH "uint QVariant::toUInt ( bool * ok = 0 ) const"Returns the variant as an unsigned int if the variant has type() String, CString, UInt, Int, Double, or Bool; or 0 otherwise..PPIf \fIok\fR is non-null, \fI*ok\fR is set to TRUE if the value could be converted to a uint and FALSE otherwise..PPSee also asUInt()..SH "Type QVariant::type () const"Returns the storage type of the value stored in the variant. Usually it's best to test with canCast() whether the variant can deliver the data type you are interested in..SH "const char * QVariant::typeName () const"Returns the name of the type stored in the variant. The returned strings describe the C++ datatype used to store the data: for example, "QFont", "QString", or "QValueList<QVariant>". An Invalid variant returns 0..SH "const char * QVariant::typeToName ( Type typ )\fC [static]\fR"Converts the enum representation of the storage type, \fItyp\fR, to itsstring representation..SH "SEE ALSO".BR http://doc.trolltech.com/qvariant.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 (qvariant.3qt) and the Qtversion (3.0.0).

⌨️ 快捷键说明

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