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
src_corelib_kernel_qobject.cpp File Reference

(81e3d10ca5913a79f5e53043bfd33d03f25253f5)

Go to the source code of this file.

Classes

class  MainWindow
 [5] More...
 
class  MyObject
 [7] More...
 
class  KeyPressEater
 [14] More...
 
class  MyWidget
 [23] More...
 
class  MyClass
 [4] More...
 
class  QItemSelectionModel
 [38] More...
 

Functions

obj metaObject () -> className()
 
QPushButton::staticMetaObject className ()
 [1]
 
timer inherits ("QTimer")
 
timer inherits ("QObject")
 
timer inherits ("QAbstractButton")
 
layout inherits ("QLayoutItem")
 
 qDebug ("MyClass::setPrecision(): (%s) invalid precision %f", qPrintable(objectName()), newPrecision)
 [4]
 
myObject moveToThread (QApplication::instance() ->thread())
 [6]
 
monitoredObj installEventFilter (filterObj)
 [13]
 
pushButton installEventFilter (keyPressEater)
 
 if (receivers(SIGNAL(valueChanged(QByteArray))) > 0)
 [21]
 
myObject disconnect ()
 [26]
 
 disconnect (myObject, SIGNAL(mySignal()), nullptr, nullptr)
 [27]
 
myObject disconnect (SIGNAL(mySignal()))
 [28]
 
 disconnect (myObject, nullptr, myReceiver, nullptr)
 [29]
 
myObject disconnect (myReceiver)
 [30]
 
 if (signal==QMetaMethod::fromSignal(&MyObject::valueChanged))
 [31]
 
void on_< object name_< signal name > (< signal parameters >)
 [32]
 
void on_button1_clicked ()
 [33]
 
void someFunction ()
 [44]
 
socket connectToHost ("qt-project.org", 80)
 
 disconnect (myObject, &MyObject::mySignal(), nullptr, nullptr)
 [46]
 
 if (isSignalConnected(valueChangedSignal))
 
someQObject blockSignals (wasBlocked)
 

Variables

QObjectobj = new QPushButton
 [1]
 
QTimertimer = qobject_cast<QTimer *>(obj)
 [3]
 
QAbstractButtonbutton = qobject_cast<QAbstractButton *>(obj)
 [8]
 
QVBoxLayoutlayout = new QVBoxLayout
 
QListWidgetlist = parentWidget->findChild<QListWidget *>()
 [10]
 
QList< QWidget * > widgets = parentWidget.findChildren<QWidget *>("widgetname")
 [11]
 
QList< QPushButton * > allPButtons = parentWidget.findChildren<QPushButton *>()
 [12]
 
KeyPressEaterkeyPressEater = new KeyPressEater(this)
 [15]
 
QPushButtonpushButton = new QPushButton(this)
 
QListViewlistView = new QListView(this)
 
QLabellabel = new QLabel
 [21]
 
QScrollBarscrollBar = new QScrollBar
 
QObject::connect __pad0__
 [24]
 
QObject::connect nullptr
 
QString title
 [35]
 
QList< QPushButton * > childButtons = parentWidget.findChildren<QPushButton *>(Qt::FindDirectChildrenOnly)
 [42]
 
QLineEditlineEdit = new QLineEdit
 
QByteArray page = ...
 [45]
 
QTcpSocketsocket = new QTcpSocket
 [1]
 
static const QMetaMethod valueChangedSignal = QMetaMethod::fromSignal(&MyObject::valueChanged)
 [48]
 
const bool wasBlocked = someQObject->blockSignals(true)
 [52]
 
const auto id = Qt::TimerId{obj->startTimer(100ms)}
 [54]
 

Function Documentation

◆ _< signal name >()

void on_< object name > _< signal name > ( < signal parameters > )

[32]

[1]

[33]

[1] [2]

◆ blockSignals()

someQObject blockSignals ( wasBlocked )

◆ className()

QPushButton::staticMetaObject className ( )

[1]

[2]

Definition at line 99 of file qwizard.cpp.

◆ connectToHost()

socket connectToHost ( "qt-project.org" ,
80  )

◆ disconnect() [1/6]

myObject disconnect ( )

[26]

A helper class for iterating over a model that might change.

[27]

When populating the ListView from a model under normal circumstances, we would iterate over the range of model indices correspondning to the visual range, and basically call createItem(index++) in order to create each item.

This will also emit Component.onCompleted() for each item, which might do some weird things... For instance, it might remove itself from the model, and this might change model count and the indices of the other subsequent entries in the model.

This class takes such changes to the model into consideration while iterating, and will adjust the iterator index and keep track of whether the iterator has reached the end of the range.

It keeps track of changes to the model by connecting to QQmlInstanceModel::modelUpdated() from its constructor. When destroyed, it will automatically disconnect. You can explicitly disconnect earlier by calling

◆ disconnect() [2/6]

disconnect ( myObject ,
& MyObject::mySignal(),
nullptr ,
nullptr  )

[46]

[47]

◆ disconnect() [3/6]

disconnect ( myObject ,
nullptr ,
myReceiver ,
nullptr  )

[29]

[30]

◆ disconnect() [4/6]

disconnect ( myObject ,
SIGNAL(mySignal()) ,
nullptr ,
nullptr  )

[27]

[28]

◆ disconnect() [5/6]

myObject disconnect ( myReceiver )

[30]

[31]

◆ disconnect() [6/6]

myObject disconnect ( SIGNAL(mySignal()) )

[28]

[29]

◆ if() [1/3]

if ( isSignalConnected(valueChangedSignal) )

Definition at line 401 of file src_corelib_kernel_qobject.cpp.

◆ if() [2/3]

if ( receivers(SIGNAL(valueChanged(QByteArray))) ,
0  )

[21]

Definition at line 192 of file src_corelib_kernel_qobject.cpp.

◆ if() [3/3]

if ( signal = QMetaMethod::fromSignal(&MyObject::valueChanged))

[31]

[32]

Definition at line 276 of file src_corelib_kernel_qobject.cpp.

◆ inherits() [1/4]

timer inherits ( "QAbstractButton" )

◆ inherits() [2/4]

layout inherits ( "QLayoutItem" )

◆ inherits() [3/4]

layout inherits ( "QObject" )

◆ inherits() [4/4]

timer inherits ( "QTimer" )

◆ installEventFilter() [1/2]

monitoredObj installEventFilter ( filterObj )

[13]

[14]

◆ installEventFilter() [2/2]

listView installEventFilter ( keyPressEater )

◆ metaObject()

obj metaObject ( ) -> className()

◆ moveToThread()

myObject moveToThread ( QApplication::instance() ->thread() )

[6]

[7]

◆ on_button1_clicked()

void on_button1_clicked ( )

[33]

[34]

◆ qDebug()

qDebug ( "MyClass::setPrecision(): (%s) invalid precision %f" ,
qPrintable(objectName()) ,
newPrecision  )

[4]

[5]

◆ someFunction()

void someFunction ( )

[44]

[0]

[49]

[45]

[50]

[44]

Definition at line 5 of file src_corelib_thread_qfuturesynchronizer.cpp.

Variable Documentation

◆ __pad0__

QObject::connect __pad0__

[24]

[25]

Definition at line 240 of file src_corelib_kernel_qobject.cpp.

◆ allPButtons

QList< QPushButton * > allPButtons = parentWidget.findChildren<QPushButton *>()

[12]

[13]

Definition at line 139 of file src_corelib_kernel_qobject.cpp.

◆ button

[8]

[39]

[10]

[41]

Definition at line 26 of file src_corelib_kernel_qobject.cpp.

◆ childButtons

QList< QPushButton * > childButtons = parentWidget.findChildren<QPushButton *>(Qt::FindDirectChildrenOnly)

[42]

[43]

Definition at line 365 of file src_corelib_kernel_qobject.cpp.

◆ id

const auto id = Qt::TimerId{obj->startTimer(100ms)}

[54]

Definition at line 468 of file src_corelib_kernel_qobject.cpp.

◆ keyPressEater

KeyPressEater * keyPressEater = new KeyPressEater(this)

[15]

[16]

Definition at line 173 of file src_corelib_kernel_qobject.cpp.

◆ label

[21]

[43]

[22]

[44]

Definition at line 201 of file src_corelib_kernel_qobject.cpp.

◆ layout

QFormLayout * layout = new QVBoxLayout

Definition at line 38 of file src_corelib_kernel_qobject.cpp.

◆ lineEdit

QLineEdit * lineEdit = new QLineEdit

Definition at line 370 of file src_corelib_kernel_qobject.cpp.

◆ list

QListWidget* list = parentWidget->findChild<QListWidget *>()

[10]

[41]

[11]

[42]

Definition at line 129 of file src_corelib_kernel_qobject.cpp.

◆ listView

QListView * listView = new QListView(this)

Definition at line 175 of file src_corelib_kernel_qobject.cpp.

◆ nullptr

return nullptr

Definition at line 246 of file src_corelib_kernel_qobject.cpp.

◆ obj

[1]

[2]

[3]

Definition at line 5 of file src_corelib_kernel_qobject.cpp.

◆ page

QByteArray page = ...

[45]

[50]

[46]

[51]

Definition at line 382 of file src_corelib_kernel_qobject.cpp.

Referenced by QAccessibleQuickPage::QAccessibleQuickPage().

◆ pushButton

QGraphicsWidget * pushButton = new QPushButton(this)

Definition at line 174 of file src_corelib_kernel_qobject.cpp.

◆ scrollBar

QScrollBar * scrollBar = new QScrollBar

Definition at line 202 of file src_corelib_kernel_qobject.cpp.

◆ socket

QSslSocket socket = new QTcpSocket

[1]

[0]

[2]

[3]

Definition at line 383 of file src_corelib_kernel_qobject.cpp.

◆ timer

QTimer * timer = qobject_cast<QTimer *>(obj)

[3]

[4]

Definition at line 23 of file src_corelib_kernel_qobject.cpp.

◆ title

QString title
readwrite

[35]

[37]

Definition at line 305 of file src_corelib_kernel_qobject.cpp.

◆ valueChangedSignal

static const QMetaMethod valueChangedSignal = QMetaMethod::fromSignal(&MyObject::valueChanged)
static

[48]

[49]

Definition at line 400 of file src_corelib_kernel_qobject.cpp.

◆ wasBlocked

const bool wasBlocked = someQObject->blockSignals(true)

[52]

[53] [53] [54]

Definition at line 459 of file src_corelib_kernel_qobject.cpp.

◆ widgets

QList< QWidget * > widgets = parentWidget.findChildren<QWidget *>("widgetname")

[11]

[12]

Definition at line 134 of file src_corelib_kernel_qobject.cpp.