Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
doc_src_qsignalspy.cpp File Reference

(69d4ecd6ef9057cb3703178277042ff7a7411459)

Go to the source code of this file.

Functions

QSignalSpy spy (box, SIGNAL(clicked(bool)))
 
box animateClick ()
 
 QCOMPARE (spy.count(), 1)
 
 QVERIFY (arguments.at(0).toBool()==true)
 
myCustomObject doSomething ()
 
 QVERIFY (arguments.at(0).typeId()==QMetaType::Int)
 
 QVERIFY (arguments.at(1).typeId()==QMetaType::QString)
 
 QVERIFY (arguments.at(2).typeId()==QMetaType::Double)
 
 qRegisterMetaType< SomeStruct > ()
 [1]
 
QSignalSpy spymodel (whatever(SomeStruct))
 
QSignalSpy spy (myPushButton, SIGNAL(clicked(bool)))
 [3]
 
QSignalSpy spy (myPushButton, &QPushButton::clicked)
 [4]
 
object setObjectName ("A new object name")
 
 for (int i=mo.propertyOffset();i< mo.propertyCount();++i)
 [13]
 

Variables

QCheckBoxbox = ...
 [0]
 
QList< QVariantarguments = spy.takeFirst()
 
QSignalSpy spy (myCustomObject, SIGNAL(mySignal(int, QString, double)))
 [0]
 
SomeStruct result = qvariant_cast<SomeStruct>(spy.at(0).at(0))
 [2]
 
QObject object
 [6]
 
auto mo = object.metaObject()
 [7]
 
auto signalIndex = mo->indexOfSignal("objectNameChanged(QString)")
 
auto signal = mo->method(signalIndex)
 

Function Documentation

◆ animateClick()

box animateClick ( )

◆ doSomething()

myCustomObject doSomething ( )

◆ for()

for ( )
new

[13]

[3]

[14]

[4]

[13]

[4]

Definition at line 68 of file doc_src_qsignalspy.cpp.

◆ model()

QSignalSpy spy & model ( whatever(SomeStruct) )

◆ QCOMPARE()

QCOMPARE ( spy. count(),
1  )

◆ qRegisterMetaType< SomeStruct >()

qRegisterMetaType< SomeStruct > ( )

[1]

[2]

◆ QVERIFY() [1/4]

QVERIFY ( arguments. at0).toBool( = =true)

◆ QVERIFY() [2/4]

QVERIFY ( arguments. at0).typeId( = =QMetaType::Int)

◆ QVERIFY() [3/4]

QVERIFY ( arguments. at1).typeId( = =QMetaType::QString)

◆ QVERIFY() [4/4]

QVERIFY ( arguments. at2).typeId( = =QMetaType::Double)

◆ setObjectName()

object setObjectName ( "A new object name" )

◆ spy() [1/3]

QSignalSpy spy ( box ,
SIGNAL(clicked(bool))  )

◆ spy() [2/3]

QSignalSpy spy ( myPushButton ,
&QPushButton::clicked  )

[4]

[6]

◆ spy() [3/3]

QSignalSpy spy ( myPushButton ,
SIGNAL(clicked(bool))  )

[3]

[4]

Variable Documentation

◆ arguments

QList< QVariant > arguments = spy.takeFirst()

Definition at line 12 of file doc_src_qsignalspy.cpp.

◆ box

QCheckBox* box = ...

[0]

Definition at line 5 of file doc_src_qsignalspy.cpp.

◆ mo

auto mo = object.metaObject()

[7]

[8]

Definition at line 53 of file doc_src_qsignalspy.cpp.

◆ object

[6]

[7]

Definition at line 52 of file doc_src_qsignalspy.cpp.

◆ result

SomeStruct result = qvariant_cast<SomeStruct>(spy.at(0).at(0))

[2]

[3]

Definition at line 38 of file doc_src_qsignalspy.cpp.

◆ signal

auto signal = mo->method(signalIndex)

Definition at line 55 of file doc_src_qsignalspy.cpp.

◆ signalIndex

auto signalIndex = mo->indexOfSignal("objectNameChanged(QString)")

Definition at line 54 of file doc_src_qsignalspy.cpp.

◆ spy

QSignalSpy spy ( myCustomObject ,
SIGNAL(mySignal(int, QString, double))  )

[0]

[3]

[1]

[4]

[6]