QtBase  v6.3.1
Functions | Variables
src_corelib_kernel_qvariant.cpp File Reference

Go to the source code of this file.

Functions

 qDebug ("Type is %s", v.typeName())
 
v setValue (5)
 
v setValue (c)
 
 if (v.canConvert< MyCustomStruct >()) c
 
v canConvert< int > ()
 
v canConvert< QString > ()
 
v setValue (s)
 
v canConvert< MyCustomStruct > ()
 
 if (variant.canConvert< QVariantList >())
 
mapping insert (7, "Seven")
 
mapping insert (11, "Eleven")
 
mapping insert (42, "Forty-two")
 
 if (variant.canConvert< QVariantHash >())
 

Variables

QDataStream out (...)
 [0] More...
 
QVariant v (123) = v.toInt() + 100
 [3] More...
 
int x = v.toInt()
 [0] More...
 
int z = v.toInt()
 
QVariant y = QVariant::fromValue(nullptr)
 
QVariant variant = color
 [1] More...
 
QColor color = variant.value<QColor>()
 [2] More...
 
int i = v.toInt()
 
QString s = v.toString()
 [6] More...
 
MyCustomStruct c
 
MyCustomStruct c2 = v.value<MyCustomStruct>()
 
QObjectobject = getObjectFromSomewhere()
 [7] More...
 
QVariant data = QVariant::fromValue(object)
 
QList< int > intList = {7, 11, 42}
 [8] More...
 
QHash< int, QStringmapping
 [9] More...
 

Function Documentation

◆ canConvert< int >()

v canConvert< int > ( )

◆ canConvert< MyCustomStruct >()

v canConvert< MyCustomStruct > ( )

◆ canConvert< QString >()

v canConvert< QString > ( )

◆ if() [1/3]

if ( v.canConvert< MyCustomStruct >  ())

◆ if() [2/3]

if ( variant.canConvert< QVariantHash ())

Definition at line 177 of file src_corelib_kernel_qvariant.cpp.

Here is the call graph for this function:

◆ if() [3/3]

if ( variant.canConvert< QVariantList ())

Definition at line 149 of file src_corelib_kernel_qvariant.cpp.

Here is the call graph for this function:

◆ insert() [1/3]

mapping insert ( 11  ,
"Eleven"   
)

◆ insert() [2/3]

mapping insert ( 42  ,
"Forty-two"   
)

◆ insert() [3/3]

mapping insert ( ,
"Seven"   
)

◆ qDebug()

qDebug ( "Type is %s ,
v.  typeName() 
)
Here is the caller graph for this function:

◆ setValue() [1/3]

v setValue ( )

◆ setValue() [2/3]

v setValue ( c  )

◆ setValue() [3/3]

v setValue ( s  )

Variable Documentation

◆ c

MyCustomStruct c

Definition at line 96 of file src_corelib_kernel_qvariant.cpp.

◆ c2

MyCustomStruct c2 = v.value<MyCustomStruct>()

Definition at line 101 of file src_corelib_kernel_qvariant.cpp.

◆ color

[2]

[3]

Definition at line 79 of file src_corelib_kernel_qvariant.cpp.

◆ data

Definition at line 141 of file src_corelib_kernel_qvariant.cpp.

◆ i

int i = v.toInt()

Definition at line 93 of file src_corelib_kernel_qvariant.cpp.

◆ intList

QList<int> intList = {7, 11, 42}

[8]

[9]

Definition at line 146 of file src_corelib_kernel_qvariant.cpp.

◆ mapping

[9]

[10]

Definition at line 171 of file src_corelib_kernel_qvariant.cpp.

◆ object

QObject* object = getObjectFromSomewhere()

[7]

[8]

Definition at line 140 of file src_corelib_kernel_qvariant.cpp.

◆ out

QDataStream out(...) (   ...)

[0]

◆ s

MyCustomStruct s = v.toString()

[6]

[7]

Definition at line 94 of file src_corelib_kernel_qvariant.cpp.

◆ v

QVariant v ( 123  ) = v.toInt() + 100

[3]

[4]

[5]

[6]

Definition at line 62 of file src_corelib_kernel_qvariant.cpp.

◆ variant

QVariant variant = color

[1]

[2]

Definition at line 77 of file src_corelib_kernel_qvariant.cpp.

◆ x

QVariant x = v.toInt()

[0]

[1]

Definition at line 54 of file src_corelib_kernel_qvariant.cpp.

◆ y

Definition at line 72 of file src_corelib_kernel_qvariant.cpp.

◆ z

int z = v.toInt()

Definition at line 63 of file src_corelib_kernel_qvariant.cpp.