Qt 4.8
|
The QObject class is the base class of all Qt objects. More...
#include <qobject.h>
Public Slots | |
void | deleteLater () |
Schedules this object for deletion. More... | |
Signals | |
void | destroyed (QObject *=0) |
This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More... | |
Public Functions | |
bool | blockSignals (bool b) |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More... | |
const QObjectList & | children () const |
Returns a list of child objects. More... | |
bool | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0) |
bool | disconnect (const QObject *receiver, const char *member=0) |
void | dumpObjectInfo () |
Dumps information about signal connections, etc. More... | |
void | dumpObjectTree () |
Dumps a tree of children to the debug output. More... | |
QList< QByteArray > | dynamicPropertyNames () const |
Returns the names of all properties that were dynamically added to the object using setProperty(). More... | |
virtual bool | event (QEvent *) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. More... | |
virtual bool | eventFilter (QObject *, QEvent *) |
Filters events if this object has been installed as an event filter for the watched object. More... | |
template<typename T > | |
T | findChild (const QString &aName=QString()) const |
Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More... | |
template<typename T > | |
QList< T > | findChildren (const QString &aName=QString()) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More... | |
template<typename T > | |
QList< T > | findChildren (const QRegExp &re) const |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More... | |
void | installEventFilter (QObject *) |
Installs an event filter filterObj on this object. More... | |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false. More... | |
void | killTimer (int id) |
Kills the timer with timer identifier, id. More... | |
virtual const QMetaObject * | metaObject () const |
Returns a pointer to the meta-object of this object. More... | |
void | moveToThread (QThread *thread) |
Changes the thread affinity for this object and its children. More... | |
QString | objectName () const |
QObject * | parent () const |
Returns a pointer to the parent object. More... | |
QVariant | property (const char *name) const |
Returns the value of the object's name property. More... | |
Q_INVOKABLE | QObject (QObject *parent=0) |
Constructs an object with parent object parent. More... | |
void | removeEventFilter (QObject *) |
Removes an event filter object obj from this object. More... | |
void | setObjectName (const QString &name) |
void | setParent (QObject *) |
Makes the object a child of parent. More... | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. More... | |
void | setUserData (uint id, QObjectUserData *data) |
bool | signalsBlocked () const |
Returns true if signals are blocked; otherwise returns false. More... | |
int | startTimer (int interval) |
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More... | |
QThread * | thread () const |
Returns the thread in which the object lives. More... | |
QObjectUserData * | userData (uint id) const |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. More... | |
Static Public Functions | |
static bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More... | |
static bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
Disconnects signal in object sender from method in object receiver. More... | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static uint | registerUserData () |
static QString | tr (const char *sourceText, const char *comment=0, int n=-1) |
static QString | trUtf8 (const char *sourceText, const char *comment=0, int n=-1) |
Static Public Variables | |
static const QMetaObject | staticMetaObject |
This variable stores the meta-object for the class. More... | |
Protected Functions | |
virtual void | childEvent (QChildEvent *) |
This event handler can be reimplemented in a subclass to receive child events. More... | |
virtual void | connectNotify (const char *signal) |
This virtual function is called when something has been connected to signal in this object. More... | |
virtual void | customEvent (QEvent *) |
This event handler can be reimplemented in a subclass to receive custom events. More... | |
virtual void | disconnectNotify (const char *signal) |
This virtual function is called when something has been disconnected from signal in this object. More... | |
QObject (QObjectPrivate &dd, QObject *parent=0) | |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. More... | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More... | |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *) |
This event handler can be reimplemented in a subclass to receive timer events for the object. More... | |
Protected Variables | |
QScopedPointer< QObjectData > | d_ptr |
Static Protected Variables | |
static const QMetaObject | staticQtMetaObject |
Properties | |
QString | objectName |
the name of this object More... | |
Friends | |
class | QApplication |
class | QApplicationPrivate |
class | QCoreApplication |
class | QCoreApplicationPrivate |
struct | QMetaObject |
class | QThreadData |
class | QWidget |
Related Functions | |
(Note that these are not member functions.) | |
T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QRegExp ®Exp)() |
T * | qobject_cast (QObject *object) |
QObjectList | |
void * | qt_find_obj_child (QObject *parent, const char *type, const QString &name) |
Returns a pointer to the object named name that inherits type and with a given parent. More... | |
The QObject class is the base class of all Qt objects.
QObject is the heart of the Qt Object Model. The central feature in this model is a very powerful mechanism for seamless object communication called signals and slots. You can connect a signal to a slot with connect() and destroy the connection with disconnect(). To avoid never ending notification loops you can temporarily block signals with blockSignals(). The protected functions connectNotify() and disconnectNotify() make it possible to track connections.
QObjects organize themselves in Object Trees & Ownership {object trees}. When you create a QObject with another object as parent, the object will automatically add itself to the parent's children() list. The parent takes ownership of the object; i.e., it will automatically delete its children in its destructor. You can look for an object by name and optionally type using findChild() or findChildren().
Every object has an objectName() and its class name can be found via the corresponding metaObject() (see QMetaObject::className()). You can determine whether the object's class inherits another class in the QObject inheritance hierarchy by using the inherits() function.
When an object is deleted, it emits a destroyed() signal. You can catch this signal to avoid dangling references to QObjects.
QObjects can receive events through event() and filter the events of other objects. See installEventFilter() and eventFilter() for details. A convenience handler, childEvent(), can be reimplemented to catch child events.
Last but not least, QObject provides the basic timer support in Qt; see QTimer for high-level support for timers.
Notice that the Q_OBJECT macro is mandatory for any object that implements signals, slots or properties. You also need to run the Meta Object Compiler on the source file. We strongly recommend the use of this macro in all subclasses of QObject regardless of whether or not they actually use signals, slots and properties, since failure to do so may lead certain functions to exhibit strange behavior.
All Qt widgets inherit QObject. The convenience function isWidgetType() returns whether an object is actually a widget. It is much faster than qobject_cast<QWidget *>(obj) or obj->inherits("QWidget").
Some QObject functions, e.g. children(), return a QObjectList. QObjectList is a typedef for QList<QObject *>.
A QObject instance is said to have a thread affinity, or that it lives in a certain thread. When a QObject receives a queued signal or a The Event System::Sending Events{posted event}, the slot or event handler will run in the thread that the object lives in.
By default, a QObject lives in the thread in which it is created. An object's thread affinity can be queried using thread() and changed using moveToThread().
All QObjects must live in the same thread as their parent. Consequently:
setParent() will fail if the two QObjects involved live in different threads.
QObject has neither a copy constructor nor an assignment operator. This is by design. Actually, they are declared, but in a private
section with the macro Q_DISABLE_COPY(). In fact, all Qt classes derived from QObject (direct or indirect) use this macro to declare their copy constructor and assignment operator to be private. The reasoning is found in the discussion on Identity vs Value {Identity vs Value} on the Qt Object Model page.
The main consequence is that you should use pointers to QObject (or to your QObject subclass) where you might otherwise be tempted to use your QObject subclass as a value. For example, without a copy constructor, you can't use a subclass of QObject as the value to be stored in one of the container classes. You must store pointers.
Qt's meta-object system provides a mechanism to automatically connect signals and slots between QObject subclasses and their children. As long as objects are defined with suitable object names, and slots follow a simple naming convention, this connection can be performed at run-time by the QMetaObject::connectSlotsByName() function.
uic generates code that invokes this function to enable auto-connection to be performed between widgets on forms created with . More information about using auto-connection with is given in the Using a Designer UI File in Your Application section of the manual.
From Qt 4.2, dynamic properties can be added to and removed from QObject instances at run-time. Dynamic properties do not need to be declared at compile-time, yet they provide the same advantages as static properties and are manipulated using the same API - using property() to read them and setProperty() to write them.
From Qt 4.3, dynamic properties are supported by Qt Designer's Widget Editing Mode::The Property Editor{Qt Designer}, and both standard Qt widgets and user-created forms can be given dynamic properties.
All QObject subclasses support Qt's translation features, making it possible to translate an application's user interface into different languages.
To make user-visible text translatable, it must be wrapped in calls to the tr() function. This is explained in detail in the Writing Source Code for Translation document.
|
explicit |
Constructs an object with parent object parent.
The parent of an object may be viewed as the object's owner. For instance, a dialog box is the parent of the OK and Cancel buttons it contains.
The destructor of a parent object destroys all child objects.
Setting parent to 0 constructs an object with no parent. If the object is a widget, it will become a top-level window.
Definition at line 753 of file qobject.cpp.
Referenced by connManager(), QThread::priority(), QCopChannel::QCopChannel(), QCoreApplication::QCoreApplication(), QDeclarativePixmapReader::QDeclarativePixmapReader(), QDeclarativeXmlQueryEngine::QDeclarativeXmlQueryEngine(), QFtp::QFtp(), QHttpNetworkConnection::QHttpNetworkConnection(), QSignalMapper::QSignalMapper(), QSocketNotifier::QSocketNotifier(), QSound::QSound(), QTimer::QTimer(), QTranslator::QTranslator(), QValidator::QValidator(), QWidget::QWidget(), QWSServer::QWSServer(), and QAction::setFont().
|
virtual |
Destroys the object, deleting all its child objects.
All signals to and from the object are automatically disconnected, and any pending posted events for the object are removed from the event queue. However, it is often safer to use deleteLater() rather than deleting a QObject subclass directly.
Definition at line 853 of file qobject.cpp.
|
protected |
Definition at line 801 of file qobject.cpp.
bool QObject::blockSignals | ( | bool | block | ) |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it).
If block is false, no such blocking will occur.
The return value is the previous value of signalsBlocked().
Note that the destroyed() signal will be emitted even if the signals for this object have been blocked.
Definition at line 1406 of file qobject.cpp.
Referenced by QPlainTextEditPrivate::_q_adjustScrollbars(), QAbstractSpinBoxPrivate::_q_editorCursorPositionChanged(), QHttpPrivate::_q_slotError(), QHttpPrivate::_q_slotReadyRead(), QHttpPrivate::_q_slotSendRequest(), QTabWidgetPrivate::_q_tabMoved(), QFontComboBoxPrivate::_q_updateModel(), QWorkspace::cascade(), QDateTimeEditPrivate::clearSection(), QMenuPrivate::hideMenu(), isProcessBeingDebugged(), operator>>(), QDataStream::QDataStream(), QSocks5SocketEnginePrivate::reauthenticate(), QTreeModel::removeRows(), QItemSelectionModel::reset(), QColSpinBox::setValue(), QDateTimeEditPrivate::syncCalendarWidget(), QWorkspace::tile(), QMdiAreaPrivate::updateActiveWindow(), QDateTimeEditPrivate::updateEdit(), QAbstractSpinBoxPrivate::updateEdit(), QDockAreaLayoutInfo::updateTabBar(), and QTextStreamPrivate::~QTextStreamPrivate().
|
protectedvirtual |
This event handler can be reimplemented in a subclass to receive child events.
The event is passed in the event parameter.
QEvent::ChildAdded and QEvent::ChildRemoved events are sent to objects when children are added or removed. In both cases you can only rely on the child being a QObject, or if isWidgetType() returns true, a QWidget. (This is because, in the ChildAdded case, the child is not yet fully constructed, and in the ChildRemoved case it might have been destructed already).
QEvent::ChildPolished events are sent to widgets when children are polished, or when polished children are added. If you receive a child polished event, the child's construction is usually completed. However, this is not guaranteed, and multiple polish events may be delivered during the execution of a widget's constructor.
For every child widget, you receive one ChildAdded event, zero or more ChildPolished events, and one ChildRemoved event.
The ChildPolished event is omitted if a child is removed immediately after it is added. If a child is polished several times during construction and destruction, you may receive several child polished events for the same child, each time with a different virtual table.
Reimplemented in QWorkspaceChild, QLayout, QMdiArea, QToolBar, QMdiSubWindow, QSplitter, QWorkspace, and QGroupBox.
Definition at line 1332 of file qobject.cpp.
Referenced by QToolBar::childEvent(), QAnimationGroup::event(), event(), and QToolBar::isAreaAllowed().
|
inline |
Returns a list of child objects.
The QObjectList class is defined in the <QObject>
header file as the following:
src/corelib/kernel/qobject.h /typedef .*QObjectList/ QObjectList
The first child added is the first object in the list and the last child added is the last object in the list, i.e. new children are appended at the end.
Note that the list order changes when QWidget children are raised or lowered. A widget that is raised becomes the last object in the list, and a widget that is lowered becomes the first object in the list.
Definition at line 197 of file qobject.h.
Referenced by QWidgetPrivate::activateChildLayoutsRecursively(), boundingRectOfFloatsInSelection(), buddyString(), QDeclarativeEngineDebugService::buildObjectDump(), QDeclarativeEngineDebugService::buildStatesList(), QDeclarativeContents::calcHeight(), QDeclarativeContents::calcWidth(), QDeclarativeItem::childAt(), QWidgetPrivate::childAt_helper(), QWidgetPrivate::childAtRecursiveHelper(), QGraphicsItemPrivate::children_at(), children_at_helper(), QGraphicsItemPrivate::childrenList(), QStatePrivate::childStates(), childWidgets(), QDeclarativeContents::complete(), QWidgetPrivate::createRecursively(), QDeclarativeFlickablePrivate::data_at(), QDeclarativeFlickablePrivate::data_clear(), QDeclarativeFlickablePrivate::data_count(), QTreeView::drawBranches(), QWidgetPrivate::drawWidget(), QWidget::ensurePolished(), QDockWidget::event(), find_child(), findChildObject(), findChildrenHelper(), findMenuBar(), QWidgetPrivate::getOpaqueChildren(), QWidgetPrivate::hideChildren(), QStatePrivate::historyStates(), QTreeModel::insertColumns(), QAxServerBase::internalCreate(), QMdiAreaPrivate::internalRaise(), killTimer(), QTreeViewPrivate::layout(), QWidget::lower(), make_win_eventUPP(), markFrames(), QDirModel::parent(), QDBusAdaptorConnector::polish(), QDeclarativeEngineDebugService::prepareDeferredObjects(), QDeclarativeBasePositioner::prePositioning(), QWidgetPrivate::propagatePaletteChange(), q_createNativeChildrenAndSetParent(), qDBusFindAdaptorConnector(), QObject(), QScript::qobjectProtoFuncFindChildren(), qt_find_obj_child(), qt_qFindChild_helper(), qt_qFindChildren_helper(), qt_set_windows_updateScrollBar(), qt_x11_recreateNativeWidgetsRecursive(), QWidget::raise(), QAccessibleGroupBox::relationTo(), QFileSystemModel::remove(), QStyleSheetStyle::repolish(), QDeclarativeItemPrivate::resources_at(), QDeclarativeItemPrivate::resources_clear(), QDeclarativeItemPrivate::resources_count(), QDeclarativeParentChange::saveCurrentValues(), QWidget::scroll(), QWidgetPrivate::sendPendingMoveAndResizeEvents(), sendResizeEvents(), QWidgetPrivate::setEnabled_helper(), QDeclarativeItemPrivate::setImplicitLayoutMirror(), QWidgetPrivate::setLayoutDirection_helper(), QWidgetPrivate::setLocale_helper(), QWidgetResizeHandler::setMouseCursor(), setObjectName(), QObjectPrivate::setParent_helper(), QDeclarativePropertyPrivate::setSignalExpression(), QLocalSocket::setSocketDescriptor(), QWidgetPrivate::setStyle_helper(), QWidgetPrivate::setUpdatesEnabled_helper(), QDeclarativeVisualItemModel::setWatchedRoles(), QWidgetPrivate::setWindowIcon_helper(), QWidgetPrivate::showChildren(), QDeclarativePropertyPrivate::signalExpression(), QWidget::stackUnder(), QStateMachinePrivate::stateEntryLessThan(), QStateMachinePrivate::stateExitLessThan(), QWidgetBackingStore::staticContents(), QWidgetPrivate::subtractOpaqueChildren(), QWidgetPrivate::subtractOpaqueSiblings(), QMdiAreaPrivate::subWindowList(), QStatePrivate::transitions(), QWidgetBackingStoreTracker::unregisterWidgetSubtree(), QWidgetPrivate::updateFont(), QWidgetBackingStore::updateLists(), QWorkspace::windowList(), QDeclarativeContents::~QDeclarativeContents(), and QSingleDesktopWidget::~QSingleDesktopWidget().
|
static |
Creates a connection of the given type from the signal in the sender object to the method in the receiver object.
Returns true if the connection succeeds; otherwise returns false.
You must use the SIGNAL()
and SLOT()
macros when specifying the signal and the method, for example:
This example ensures that the label always displays the current scroll bar value. Note that the signal and slots parameters must not contain any variable names, only the type. E.g. the following would not work and return false:
A signal can also be connected to another signal:
In this example, the MyWidget
constructor relays a signal from a private member variable, and makes it available under a name that relates to MyWidget
.
A signal can be connected to many slots and signals. Many signals can be connected to one slot.
If a signal is connected to several slots, the slots are activated in the same order as the order the connection was made, when the signal is emitted.
The function returns true if it successfully connects the signal to the slot. It will return false if it cannot create the connection, for example, if QObject is unable to verify the existence of either signal or method, or if their signatures aren't compatible.
By default, a signal is emitted for every connection you make; two signals are emitted for duplicate connections. You can break all of these connections with a single disconnect() call. If you pass the Qt::UniqueConnection type, the connection will only be made if it is not a duplicate. If there is already a duplicate (exact same signal to the exact same slot on the same objects), the connection will fail and connect will return false.
The optional type parameter describes the type of connection to establish. In particular, it determines whether a particular signal is delivered to a slot immediately or queued for delivery at a later time. If the signal is queued, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
call qRegisterMetaType() to register the data type before you establish the connection.
Definition at line 2580 of file qobject.cpp.
Referenced by QNetworkReplyImplPrivate::_q_bufferOutgoingData(), QAbstractSocketPrivate::_q_connectToNextAddress(), QTextControlPrivate::_q_documentLayoutChanged(), QGraphicsScenePrivate::_q_emitUpdated(), QWSServerPrivate::_q_newConnection(), QScriptDebuggerLocalsWidgetPrivate::_q_onCompletionTaskFinished(), QNetworkReplyImplPrivate::_q_startOperation(), QDeclarativeItemPrivate::_states(), QmlJSDebugger::AbstractViewInspector::AbstractViewInspector(), QToolButton::actionEvent(), QMenuBar::actionEvent(), QMenu::actionEvent(), QNetworkManagerInterface::activateConnection(), QObjectCleanupHandler::add(), _IapAddTimer::add(), QDBusPendingCallWatcherHelper::add(), QActionGroup::addAction(), QMenuBar::addAction(), QMenu::addAction(), QToolBar::addAction(), QDialogButtonBoxPrivate::addButton(), QDeclarativeAnchorsPrivate::addDepend(), QJSDebugService::addEngine(), QWizardPrivate::addField(), QPrintPropertiesDialog::addItemToOptions(), QAxScriptManager::addObject(), QWindowsFileSystemWatcherEngine::addPaths(), QConnmanEngine::addServiceConfiguration(), QGLShaderProgram::addShader(), QMainWindow::addToolBar(), QWorkspace::addWindow(), QApplication::alert(), QWidgetAnimator::animate(), QCopChannel::answer(), QMdiAreaPrivate::appendChild(), QStateMachinePrivate::applyProperties(), QDeclarativeXmlListModel::classBegin(), QScriptDebugger::clearConsoleAction(), QScriptDebugger::clearDebugOutputAction(), QScriptDebugger::clearErrorLogAction(), QScriptDebuggerLocalsWidgetPrivate::complete(), QDeclarativePath::componentComplete(), QBBVirtualKeyboardPps::connect(), QUnixSocket::connect(), QWizardPrivate::connectButton(), QDeclarativePixmap::connectDownloadProgress(), QDeclarativePixmap::connectFinished(), QOfonoManagerInterface::connectNotify(), QConnmanManagerInterface::connectNotify(), QOfonoModemInterface::connectNotify(), QOfonoNetworkRegistrationInterface::connectNotify(), QOfonoNetworkOperatorInterface::connectNotify(), QConnmanServiceInterface::connectNotify(), QOfonoSimInterface::connectNotify(), QConnmanTechnologyInterface::connectNotify(), QOfonoDataConnectionManagerInterface::connectNotify(), QOfonoPrimaryDataContextInterface::connectNotify(), QOfonoSmsInterface::connectNotify(), QDeclarativeProperty::connectNotifySignal(), ShaderEffectItem::connectPropertySignals(), QDBusConnectionPrivate::connectSignal(), QFtpDTP::connectToHost(), QProxyModel::connectToModel(), QAnimationGroupPrivate::connectUncontrolledAnimation(), connManager(), QScriptDebugger::continueAction(), QMdi::ControlContainer::ControlContainer(), QLineControl::copy(), QSoftKeyManager::createAction(), QmlJSDebugger::BoundingRectHighlighter::createBoundingBox(), QProcessPrivate::createChannel(), QColumnViewPrivate::createColumn(), QmlJSDebugger::LiveSelectionTool::createContextMenu(), QScriptEngineDebuggerPrivate::createDebugger(), QBBIntegration::createDisplay(), QScriptDebuggerLocalsItemDelegate::createEditor(), QScriptBreakpointsItemDelegate::createEditor(), QToolBarLayout::createItem(), QSoftKeyManager::createKeyedAction(), QFileDialogPrivate::createMenuActions(), QUndoGroup::createRedoAction(), QUndoStack::createRedoAction(), QNetworkAccessManager::createRequest(), QNetworkAccessManagerPrivate::createSession(), QLineEdit::createStandardContextMenu(), QFileDialogPrivate::createToolButtons(), QUndoGroup::createUndoAction(), QUndoStack::createUndoAction(), QFileDialogPrivate::createWidgets(), QWSDisplay::Data::Data(), QMenuBar::defaultAction(), QCopChannel::detach(), QNetworkManagerEngine::deviceAdded(), QAbstractSocket::disconnectFromHostImplementation(), QDeclarativeFontObject::download(), QVGPaintEngine::drawCachedGlyphs(), QAbstractItemViewPrivate::editor(), QNetworkAccessCache::emitEntryReady(), QInputDialogPrivate::ensureComboBox(), QIcdEngine::ensureDBusConnection(), QInputDialogPrivate::ensureDoubleSpinBox(), QInputDialogPrivate::ensureEnabledConnection(), QInputDialogPrivate::ensureIntSpinBox(), QInputDialogPrivate::ensureLayout(), QInputDialogPrivate::ensureLineEdit(), QInputDialogPrivate::ensureListView(), QLabelPrivate::ensureTextControl(), QDialog::exec(), QDeclarativeViewPrivate::execute(), QWSSoundServerPrivate::feedDevice(), QScriptDebugger::findInScriptAction(), QScriptDebugger::findNextInScriptAction(), QScriptDebugger::findPreviousInScriptAction(), QDeclarativeInclude::finished(), QLineEdit::focusInEvent(), QNetworkSessionManagerPrivate::forceSessionClose(), QNetworkAccessFtpBackend::ftpConnectionReady(), QMainWindowLayout::getTabBar(), QScriptDebugger::goToLineAction(), QWizardPrivate::handleAeroStyleChange(), QGLWindowSurface::hijackWindow(), QWorkspaceChild::iconWidget(), QGraphicsSvgItemPrivate::init(), QToolButtonPrivate::init(), QTextBrowserPrivate::init(), QColorDialogPrivate::init(), QTextEditPrivate::init(), QCompleterPrivate::init(), QToolBarPrivate::init(), QDialPrivate::init(), QDeclarativeTextEditPrivate::init(), QAbstractScrollAreaPrivate::init(), QFontDialogPrivate::init(), QDockWidgetPrivate::init(), QLineEditPrivate::init(), QProgressDialogPrivate::init(), QAuServerNAS::init(), QFileSystemWatcherPrivate::init(), QAbstractItemViewPrivate::init(), QPlainTextEditPrivate::init(), QSidebar::init(), QGraphicsSceneIndexPrivate::init(), QHttpPrivate::init(), QHttpNetworkConnectionChannel::init(), QStandardItemModelPrivate::init(), QTableViewPrivate::init(), QTabBarPrivate::init(), QPrintPreviewDialogPrivate::init(), QDeclarativeGridViewPrivate::init(), Maemo::IcdPrivate::init(), QMessageBoxPrivate::init(), QPrintPreviewWidgetPrivate::init(), QTabWidgetPrivate::init(), QDeclarativeListViewPrivate::init(), QPageSetupDialogPrivate::init(), QVNCServer::init(), QWorkspacePrivate::init(), QDateTimeEditPrivate::initCalendarPopup(), QFileSystemWatcherPrivate::initForcedEngine(), QSocks5SocketEngine::initialize(), QHttpSocketEngine::initialize(), QConnmanEngine::initialize(), QNetworkManagerEngine::initialize(), QTreeViewPrivate::initialize(), QColumnViewPrivate::initialize(), QSocks5SocketEnginePrivate::initialize(), QItemSelectionModelPrivate::initModel(), QFileSystemWatcherPrivate::initPollerEngine(), QWSServerPrivate::initServer(), QStyleSheetStyle::initWidget(), QToolBox::insertItem(), QTabBar::insertTab(), QMainWindow::insertToolBar(), QBBSystemLocaleData::installSocketNotifiers(), QNetworkManagerEngine::interfacePropertiesChanged(), QScriptDebugger::interruptAction(), QDeclarativeGridView::itemsRemoved(), QDeclarativeListView::itemsRemoved(), QScriptDebuggerConsoleWidget::keyPressEvent(), QTcpServerConnection::listen(), QUnixSocketServer::listen(), QDeclarativeLoaderPrivate::load(), QDeclarativeAnimatedImage::load(), QPatternist::AccelTreeResourceLoader::load(), QDeclarativeDataLoader::load(), loadDocument(), QHostInfo::lookupHost(), QDeclarativeAnimatedImage::movieRequestFinished(), QDeclarativeDataLoader::networkReplyFinished(), QNetworkManagerEngine::newAccessPoint(), QTcpServerConnection::newConnection(), QNetworkManagerEngine::newConnection(), QVNCServer::newConnection(), QWSPcMouseHandlerPrivate::notify(), QScriptDBusConnection::objectRegisteredAt(), QNetworkAccessFileBackend::open(), QPrintPreviewDialog::open(), QColorDialog::open(), QFontDialog::open(), QProgressDialog::open(), QAudioInputPrivate::open(), QPrintDialog::open(), QMessageBox::open(), QInputDialog::open(), QTipLabel::placeTip(), QStyleSheetStyle::polish(), QToolButtonPrivate::popupTimerDone(), QNetworkAccessHttpBackend::postRequest(), QConnmanEngine::propertyChangedContext(), QAuBucketQWS::QAuBucketQWS(), QAudioInput::QAudioInput(), QAudioInputPrivate::QAudioInputPrivate(), QAudioOutput::QAudioOutput(), QtMultimediaInternal::QAudioOutputBuffer::QAudioOutputBuffer(), QAudioOutputPrivate::QAudioOutputPrivate(), QAuServerNAS::QAuServerNAS(), QAuServerQWS::QAuServerQWS(), QAuthDevice::QAuthDevice(), QAxScript::QAxScript(), QAxSelect::QAxSelect(), QBalloonTip::QBalloonTip(), QBBIntegration::QBBIntegration(), QByteDeviceWrappingIoDevice::QByteDeviceWrappingIoDevice(), QCalendarWidget::QCalendarWidget(), QColorShower::QColorShower(), QComboBoxPrivateContainer::QComboBoxPrivateContainer(), QCoreWlanEngine::QCoreWlanEngine(), QDBusAbstractInterface::QDBusAbstractInterface(), QDBusConnectionInterface::QDBusConnectionInterface(), qDBusRealAddWatch(), QDBusServer::QDBusServer(), QDeclarativeContents::QDeclarativeContents(), QDeclarativeDebugConnectionPrivate::QDeclarativeDebugConnectionPrivate(), QDeclarativeEngineDebugService::QDeclarativeEngineDebugService(), QDeclarativeFolderListModel::QDeclarativeFolderListModel(), QDeclarativeInclude::QDeclarativeInclude(), QDeclarativePixmapReader::QDeclarativePixmapReader(), QDeclarativeTimer::QDeclarativeTimer(), QmlJSDebugger::QDeclarativeViewInspector::QDeclarativeViewInspector(), QDeclarativeWatchProxy::QDeclarativeWatchProxy(), QDeclarativeWorkerScriptEngine::QDeclarativeWorkerScriptEngine(), QDeclarativeXmlQueryEngine::QDeclarativeXmlQueryEngine(), QDirectFBKeyboardHandlerPrivate::QDirectFBKeyboardHandlerPrivate(), QDirectFBMouseHandlerPrivate::QDirectFBMouseHandlerPrivate(), QDirectFBScreenPrivate::QDirectFBScreenPrivate(), QDnotifyFileSystemWatcherEngine::QDnotifyFileSystemWatcherEngine(), QErrorMessage::QErrorMessage(), QExpandingLineEdit::QExpandingLineEdit(), QFbScreen::QFbScreen(), QFileInfoGatherer::QFileInfoGatherer(), QFontComboBox::QFontComboBox(), QFtp::QFtp(), QFtpDTP::QFtpDTP(), QFtpPI::QFtpPI(), QHostInfoLookupManager::QHostInfoLookupManager(), QInputDialogDoubleSpinBox::QInputDialogDoubleSpinBox(), QInputDialogSpinBox::QInputDialogSpinBox(), QIntMouseHandler::QIntMouseHandler(), QPatternist::QIODeviceDelegate::QIODeviceDelegate(), QLinuxInputKeyboardHandler::QLinuxInputKeyboardHandler(), QLinuxInputMouseHandler::QLinuxInputMouseHandler(), QMdiSubWindow::QMdiSubWindow(), QmlApplicationViewer::QmlApplicationViewer(), QmlJSDebugger::QmlToolBar::QmlToolBar(), QMovie::QMovie(), QMultiInputContext::QMultiInputContext(), QNativeWifiEngine::QNativeWifiEngine(), QNetworkConfigurationManager::QNetworkConfigurationManager(), QNetworkManagerEngine::QNetworkManagerEngine(), QNetworkManagerInterface::QNetworkManagerInterface(), QNetworkSession::QNetworkSession(), QNlaEngine::QNlaEngine(), QNonContiguousByteDeviceBufferImpl::QNonContiguousByteDeviceBufferImpl(), QNonContiguousByteDeviceIoDeviceImpl::QNonContiguousByteDeviceIoDeviceImpl(), QScriptEnginePrivate::qobjectData(), QPacketProtocolPrivate::QPacketProtocolPrivate(), QPageSetupWidget::QPageSetupWidget(), QPaintBufferResource::QPaintBufferResource(), QPrintPropertiesDialog::QPrintPropertiesDialog(), QQnxMouseHandler::QQnxMouseHandler(), QScriptBreakpointsWidget::QScriptBreakpointsWidget(), QScriptDebuggerCodeFinderWidget::QScriptDebuggerCodeFinderWidget(), QScriptDebuggerCodeView::QScriptDebuggerCodeView(), QScriptDebuggerConsoleWidget::QScriptDebuggerConsoleWidget(), QScriptEdit::QScriptEdit(), QScriptNewBreakpointWidget::QScriptNewBreakpointWidget(), QShortcut::QShortcut(), QSingleShotTimer::QSingleShotTimer(), QSmoothedAnimation::QSmoothedAnimation(), QSortFilterProxyModel::QSortFilterProxyModel(), QStackedWidget::QStackedWidget(), QSvgWidget::QSvgWidget(), qt_create_commandline(), QToolBarLayout::QToolBarLayout(), QToolButton::QToolButton(), QTreeWidget::QTreeWidget(), QTsLibMouseHandler::QTsLibMouseHandler(), QUndoModel::QUndoModel(), QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(), QUnixSocketPrivate::QUnixSocketPrivate(), QVFbKeyboardHandler::QVFbKeyboardHandler(), QVFbMouseHandler::QVFbMouseHandler(), QVFbScreenKeyboardHandler::QVFbScreenKeyboardHandler(), QVFbScreenMouseHandler::QVFbScreenMouseHandler(), QVFbScreenPrivate::QVFbScreenPrivate(), QWaylandDisplay::QWaylandDisplay(), QWhatsThis::QWhatsThis(), QWhatsThisAction::QWhatsThisAction(), QWizardPage::QWizardPage(), QWorkspaceChild::QWorkspaceChild(), QWSClient::QWSClient(), QWSIntKbPrivate::QWSIntKbPrivate(), QWSKbPrivate::QWSKbPrivate(), QWSLinuxInputKbPrivate::QWSLinuxInputKbPrivate(), QWSLinuxInputMousePrivate::QWSLinuxInputMousePrivate(), QWSLinuxTPMouseHandlerPrivate::QWSLinuxTPMouseHandlerPrivate(), QWSQnxKeyboardHandler::QWSQnxKeyboardHandler(), QWSSocket::QWSSocket(), QWSSoundServerClient::QWSSoundServerClient(), QWSTslibMouseHandlerPrivate::QWSTslibMouseHandlerPrivate(), QWSTtyKbPrivate::QWSTtyKbPrivate(), QWSUmKeyboardHandlerPrivate::QWSUmKeyboardHandlerPrivate(), QXcbConnection::QXcbConnection(), QXlibScreen::QXlibScreen(), QCopChannel::registerChannel(), QAbstractTextDocumentLayout::registerHandler(), QDBusConnectionPrivate::registerObject(), QTransportAuth::registerPolicyReceiver(), QWSDisplay::Data::reinit(), QDeclarativeXmlListModel::reload(), QAbstractScrollAreaPrivate::replaceScrollBar(), QDeclarativeXMLHttpRequest::requestFromUrl(), QWidgetAction::requestWidget(), QAlphaWidget::run(), QInotifyFileSystemWatcherEngine::run(), QDnotifySignalThread::run(), QPollingFileSystemWatcherEngine::run(), QRollEffect::run(), QScriptDebugger::runToCursorAction(), QScriptDebugger::runToNewScriptAction(), QDeclarativeListView::sectionCriteria(), QmlJSDebugger::LiveSelectionTool::selectedItemsChanged(), QSidebar::selectUrl(), QHttpNetworkConnectionChannel::sendRequest(), QDBusConnectionPrivate::sendWithReply(), QDBusConnectionPrivate::sendWithReplyAsync(), ShaderEffectItem::setActive(), QUndoGroup::setActiveStack(), QDeclarativeBehavior::setAnimation(), AVMediaObject::setAudioOutput(), QDBusAbstractAdaptor::setAutoRelaySignals(), QScriptEngineDebugger::setAutoShowStandardWindow(), QDeclarativeFlipable::setBack(), QScriptBreakpointsWidget::setBreakpointsModel(), QScriptDebuggerCodeWidget::setBreakpointsModel(), QDBusConnectionPrivate::setBusService(), QCalendarPopup::setCalendarWidget(), QProgressDialog::setCancelButton(), QAuthDevice::setClient(), QScriptDebugger::setCodeFinderWidget(), QLineEdit::setCompleter(), QNetworkManagerInterfaceAccessPoint::setConnections(), QNetworkManagerInterfaceDevice::setConnections(), QNetworkManagerInterfaceDeviceWired::setConnections(), QNetworkManagerInterfaceDeviceWireless::setConnections(), QNetworkManagerSettingsConnection::setConnections(), QNetworkManagerConnectionActive::setConnections(), QScriptDebugger::setConsoleWidget(), QTextControlPrivate::setContent(), QScriptDebuggerCodeWidget::setCurrentScript(), QDeclarativeTextEdit::setCursorDelegate(), QMenuBar::setDefaultAction(), QSyntaxHighlighter::setDocument(), QPPDOptionsEditor::setEditorData(), QUrlModel::setFileSystemModel(), QUndoView::setGroup(), QTreeView::setHeader(), QTableView::setHorizontalHeader(), QDataWidgetMapper::setItemDelegate(), QAbstractItemView::setItemDelegate(), QAbstractItemView::setItemDelegateForColumn(), QAbstractItemView::setItemDelegateForRow(), QComboBoxPrivateContainer::setItemView(), QAbstractSpinBox::setLineEdit(), QComboBox::setLineEdit(), QScriptDebuggerLocalsWidget::setLocalsModel(), QSignalMapper::setMapping(), QPushButton::setMenu(), QDeclarativeRepeater::setModel(), QTableView::setModel(), QDataWidgetMapper::setModel(), QTreeView::setModel(), QHeaderView::setModel(), QDeclarativePathView::setModel(), QCompleter::setModel(), QDeclarativeGridView::setModel(), QAbstractItemView::setModel(), QDeclarativeListView::setModel(), QDeclarativeVisualDataModel::setModel(), QComboBox::setModel(), QLabel::setMovie(), QMenuPrivate::setOverrideMenuAction(), QWizard::setPage(), QDeclarativePathView::setPath(), QCompleter::setPopup(), QmlOstPlugin::setPort(), QFileDialog::setProxyModel(), QColumnView::setResizeGripsVisible(), QDeclarativeAbstractAnimation::setRunning(), QGraphicsView::setScene(), QScriptDebuggerCodeWidget::setScriptsModel(), QScriptDebuggerScriptsWidget::setScriptsModel(), QScriptDebugger::setScriptsWidget(), QWorkspace::setScrollBarsEnabled(), QmlJSDebugger::QDeclarativeViewInspectorPrivate::setSelectedItemsForTools(), QTreeView::setSelectionModel(), QAbstractItemView::setSelectionModel(), QMenu::setSeparatorsCollapsible(), QHttpPrivate::setSock(), QUnixSocket::setSocketDescriptor(), QTableView::setSortingEnabled(), QTreeView::setSortingEnabled(), QDeclarativeFontLoader::setSource(), ShaderEffectItem::setSource(), ShaderEffectSource::setSourceItem(), QAbstractProxyModel::setSourceModel(), QIdentityProxyModel::setSourceModel(), QSortFilterProxyModel::setSourceModel(), QCompletionModel::setSourceModel(), QUndoModel::setStack(), QScriptDebuggerStackWidget::setStackModel(), QScriptDebugger::setStackWidget(), QTabWidget::setTabBar(), QTabWidget::setTabsClosable(), QTabBar::setTabsClosable(), QGraphicsItemAnimation::setTimeLine(), QListWidgetPrivate::setup(), QTableWidgetPrivate::setup(), QPrintPreviewDialogPrivate::setupActions(), QPrintDialogPrivate::setupDestination(), QDeviceClosedNotifier::setupDevice(), QPrintDialogPrivate::setupOptions(), QPrintDialogPrivate::setupPaper(), QPrintDialogPrivate::setupPrinterSettings(), QFtpDTP::setupSocket(), QDesktopServices::setUrlHandler(), QToolBarLayout::setUsePopupMenu(), QTableView::setVerticalHeader(), QMdiAreaPrivate::setViewMode(), QGraphicsProxyWidgetPrivate::setWidget_helper(), ShaderEffectItem::ShaderEffectItem(), QSidebar::showContextMenu(), QWorkspacePrivate::showMaximizeControls(), QStatusBar::showMessage(), QScriptEngineDebugger::standardWindow(), QBBNavigatorEventNotifier::start(), QBBButtonEventNotifier::start(), QNetworkConfigurationManagerPrivate::startPolling(), QProcessPrivate::startProcess(), QHttpThreadDelegate::startRequest(), QJSDebugService::statusChanged(), QScriptDebugger::stepIntoAction(), QScriptDebugger::stepOutAction(), QScriptDebugger::stepOverAction(), QStyleSheetStyle::styleRules(), QPSQLDriver::subscribeToNotificationImplementation(), QXcbConnection::sync(), QNetworkSessionPrivateImpl::syncStateWithInterface(), QGraphicsTextItemPrivate::textControl(), QCoreFuriCuri::timerEvent(), QScriptDebugger::toggleBreakpointAction(), QmlJSDebugger::ToolBarColorBox::ToolBarColorBox(), QNetworkConfigurationManagerPrivate::updateConfigurations(), QDeclarativeGridViewPrivate::updateTrackedItem(), QComboBoxPrivate::viewContainer(), QGraphicsView::viewportEvent(), QNetworkSession::waitForOpened(), QDeclarativeBasePositionerPrivate::watchChanges(), QmlJSDebugger::ZoomTool::ZoomTool(), and QVFbScreenPrivate::~QVFbScreenPrivate().
|
static |
Creates a connection of the given type from the signal in the sender object to the method in the receiver object. Returns true if the connection succeeds; otherwise returns false.
This function works in the same way as connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) but it uses QMetaMethod to specify signal and method.
Definition at line 2730 of file qobject.cpp.
|
inline |
Definition at line 337 of file qobject.h.
|
protectedvirtual |
This virtual function is called when something has been connected to signal in this object.
If you want to compare signal with a specific signal, use QLatin1String and the SIGNAL()
macro as follows:
If the signal contains multiple parameters or parameters that contain spaces, call QMetaObject::normalizedSignature() on the result of the SIGNAL()
macro.
Reimplemented in QOfonoSmsInterface, QOfonoPrimaryDataContextInterface, QConnmanAgentInterface, QOfonoDataConnectionManagerInterface, QConnmanTechnologyInterface, QOfonoSimInterface, QConnmanServiceInterface, QOfonoNetworkOperatorInterface, QOfonoNetworkRegistrationInterface, QConnmanProfileInterface, QOfonoModemInterface, QConnmanManagerInterface, QDBusAbstractInterface, QNetworkSession, QOfonoManagerInterface, QFutureWatcherBase, QClipboard, QAxWidget, QBuffer, and QAxObject.
Definition at line 3142 of file qobject.cpp.
Referenced by connect(), and QNetworkSession::connectNotify().
|
protectedvirtual |
This event handler can be reimplemented in a subclass to receive custom events.
Custom events are user-defined events with a type value at least as large as the QEvent::User item of the QEvent::Type enum, and is typically a QEvent subclass. The event is passed in the event parameter.
Reimplemented in QDBusConnectionPrivate.
Definition at line 1346 of file qobject.cpp.
Referenced by event().
|
slot |
Schedules this object for deletion.
The object will be deleted when control returns to the event loop. If the event loop is not running when this function is called (e.g. deleteLater() is called on an object before QCoreApplication::exec()), the object will be deleted once the event loop is started. If deleteLater() is called after the main event loop has stopped, the object will not be deleted. Since Qt 4.8, if deleteLater() is called on an object that lives in a thread with no running event loop, the object will be destroyed when the thread finishes.
Note that entering and leaving a new event loop (e.g., by opening a modal dialog) will not perform the deferred deletion; for the object to be deleted, the control must return to the event loop from which deleteLater() was called.
Note: It is safe to call this function more than once; when the first deferred deletion event is delivered, any pending events for the object are removed from the event queue.
Definition at line 2145 of file qobject.cpp.
Referenced by QWSServerPrivate::_q_clientClosed(), QScriptDebuggerLocalsWidgetPrivate::_q_onCompletionTaskFinished(), QScriptDebuggerConsoleWidgetPrivate::_q_onCompletionTaskFinished(), QToolBoxPrivate::_q_widgetDestroyed(), QUnixSocket::abort(), QHttpThreadDelegate::abortRequest(), QLocalServerPrivate::addListener(), QNetworkConfigurationManagerPrivate::cleanup(), QDeclarativeLoaderPrivate::clear(), QGraphicsWidget::close(), QColumnViewPrivate::closeColumns(), connManager(), QWidgetAction::deleteWidget(), QDBusConnectionPrivate::deleteYourself(), QDeclarativeObjectScriptClass::destroy(), QDeclarativeXMLHttpRequest::destroyNetwork(), QDeferredGraphicsSystemChange::doChange(), doDeleteLater(), QDragManager::drag(), QOleDropTarget::Drop(), QScriptEdit::extraAreaMouseEvent(), QDeclarativeInclude::finished(), QTipLabel::hideTipImmediately(), QDeclarativeDataLoader::networkReplyFinished(), QDeclarativePixmapReader::networkRequestDone(), QNetworkAccessHttpBackend::postRequest(), QDeclarativePixmapReader::processJobs(), qFadeEffect(), qScrollEffect(), QWSSoundServerClient::QWSSoundServerClient(), QDeclarativeVisualDataModel::release(), QAbstractItemViewPrivate::releaseEditor(), QNetworkManagerEngine::removeConnection(), QBBIntegration::removeDisplay(), QAlphaWidget::render(), QDeclarativeFontObject::replyFinished(), QRollEffect::scroll(), QMainWindow::setMenuBar(), QAbstractItemView::setModel(), QColumnView::setResizeGripsVisible(), QDeclarativeConnections::setTarget(), QToolBarLayout::takeAt(), QWidget::update(), QX11Data::xdndHandleBadwindow(), QDeclarativePixmapReader::~QDeclarativePixmapReader(), QDeclarativeWorkerScriptEngine::~QDeclarativeWorkerScriptEngine(), QDeclarativeXmlQueryEngine::~QDeclarativeXmlQueryEngine(), QEventDispatcherMac::~QEventDispatcherMac(), and QScriptEngineDebuggerBackendPrivate::~QScriptEngineDebuggerBackendPrivate().
|
signal |
This signal is emitted immediately before the object obj is destroyed, and can not be blocked.
All the objects's children are destroyed immediately after this signal is emitted.
Referenced by QObjectCleanupHandler::add(), QDeclarativeAnchorsPrivate::addDepend(), QWizardPrivate::addField(), QAxScriptManager::addObject(), QGLShaderProgram::addShader(), QDialogButtonBox::clear(), QDBusConnectionPrivate::connectSignal(), connManager(), QSoftKeyManager::createAction(), QmlJSDebugger::BoundingRectHighlighter::createBoundingBox(), QSoftKeyManager::createKeyedAction(), QDeclarativeData::destroyed(), QVGPaintEngine::drawCachedGlyphs(), QAbstractItemViewPrivate::editor(), QGLWindowSurface::hijackWindow(), QAuServerNAS::init(), QStyleSheetStyle::initWidget(), QToolBox::insertItem(), QTipLabel::placeTip(), QBalloonTip::QBalloonTip(), QDeclarativePixmapReader::QDeclarativePixmapReader(), QDeclarativeXmlQueryEngine::QDeclarativeXmlQueryEngine(), QHostInfoLookupManager::QHostInfoLookupManager(), QAbstractTextDocumentLayout::registerHandler(), QDBusConnectionPrivate::registerObject(), QWidgetAction::releaseWidget(), QDeclarativeAnchorsPrivate::remDepend(), QObjectCleanupHandler::remove(), QDialogButtonBox::removeButton(), QWizardPrivate::removeFieldAt(), QToolBox::removeItem(), QGLShaderProgram::removeShader(), QWidgetAction::requestWidget(), QTipLabel::reuseTip(), QAuthDevice::setClient(), QMenuBar::setDefaultAction(), QComboBoxPrivateContainer::setItemView(), QSignalMapper::setMapping(), QDataWidgetMapper::setModel(), QAbstractItemView::setModel(), QComboBox::setModel(), QMenuPrivate::setOverrideMenuAction(), QmlJSDebugger::QDeclarativeViewInspectorPrivate::setSelectedItemsForTools(), QAbstractProxyModel::setSourceModel(), QCompletionModel::setSourceModel(), QUndoModel::setStack(), QDesktopServices::setUrlHandler(), QGraphicsProxyWidgetPrivate::setWidget_helper(), QComboBox::~QComboBox(), QGraphicsProxyWidget::~QGraphicsProxyWidget(), ~QObject(), and QWidgetAction::~QWidgetAction().
|
static |
Disconnects signal in object sender from method in object receiver.
Returns true if the connection is successfully broken; otherwise returns false.
A signal-slot connection is removed when either of the objects involved are destroyed.
disconnect() is typically used in three ways, as the following examples demonstrate.
Disconnect everything connected to an object's signals:
equivalent to the non-static overloaded function
Disconnect everything connected to a specific signal:
equivalent to the non-static overloaded function
Disconnect a specific receiver:
equivalent to the non-static overloaded function
0 may be used as a wildcard, meaning "any signal", "any receiving object", or "any slot in the receiving object", respectively.
The sender may never be 0. (You cannot disconnect signals from more than one object in a single call.)
If signal is 0, it disconnects receiver and method from any signal. If not, only the specified signal is disconnected.
If receiver is 0, it disconnects anything connected to signal. If not, slots in objects other than receiver are not disconnected.
If method is 0, it disconnects anything that is connected to receiver. If not, only slots named method will be disconnected, and all other slots are left alone. The method must be 0 if receiver is left out, so you cannot disconnect a specifically-named slot on all objects.
Definition at line 2895 of file qobject.cpp.
Referenced by QStateMachinePrivate::_q_animationFinished(), QNetworkReplyImplPrivate::_q_bufferOutgoingDataFinished(), QMessageBoxPrivate::_q_buttonClicked(), QProgressDialogPrivate::_q_disconnectOnClose(), QNetworkAccessManagerPrivate::_q_networkSessionClosed(), QScriptDebuggerLocalsWidgetPrivate::_q_onCompletionTaskFinished(), QNetworkReplyImpl::abort(), QToolButton::actionEvent(), QMenuBar::actionEvent(), QMenu::actionEvent(), _IapAddTimer::add(), QMainWindow::addToolBar(), QStateMachinePrivate::applyProperties(), QNetworkSessionPrivateImpl::cleanupSession(), QDeclarativePixmap::clear(), QDialogButtonBox::clear(), QLabelPrivate::clearContents(), QNetworkReplyImpl::close(), QPSQLDriver::close(), QNetworkReplyImplPrivate::completeCacheSave(), QDeclarativeView::continueExecute(), QLineControl::copy(), QNetworkAccessManagerPrivate::createSession(), QNetworkSessionPrivateImpl::decrementTimeout(), QDeclarativeXmlListModelPrivate::deleteReply(), QDeclarativeCompiledBindingsPrivate::Binding::destroy(), QDeclarativeXMLHttpRequest::destroyNetwork(), QVistaHelper::disconnectBackButton(), QNetworkAccessFtpBackend::disconnectFromFtp(), QProxyModel::disconnectFromModel(), ShaderEffectItem::disconnectPropertySignals(), QMdiAreaPrivate::disconnectSubWindow(), QAnimationGroupPrivate::disconnectUncontrolledAnimation(), QAbstractPageSetupDialog::done(), QPrintPreviewDialog::done(), QPrintDialog::done(), QFontDialog::done(), QColorDialog::done(), QInputDialog::done(), QNetworkAccessCache::emitEntryReady(), QDeclarativeInclude::finished(), QLineEdit::focusOutEvent(), QNetworkSessionManagerPrivate::forceSessionClose(), QmlJSDebugger::BoundingRectHighlighter::freeBoundingBox(), QNetworkAccessFtpBackend::ftpDone(), QDBusConnectionPrivate::objectDestroyed(), QScriptDBusConnection::objectRegisteredAt(), QToolButtonPrivate::popupTimerDone(), QDeclarativeDebugConnectionPrivate::readyRead(), QPacketProtocolPrivate::readyToRead(), QDBusConnectionPrivate::registerObject(), QAbstractItemViewPrivate::releaseEditor(), QDeclarativeGridViewPrivate::releaseItem(), QWidgetAction::releaseWidget(), QDeclarativeAnchorsPrivate::remDepend(), QObjectCleanupHandler::remove(), QActionGroup::removeAction(), QDialogButtonBox::removeButton(), QConnmanEngine::removeConfiguration(), QWizardPrivate::removeFieldAt(), QToolBox::removeItem(), QGLShaderProgram::removeShader(), QMainWindowLayout::removeToolBar(), QAbstractSocketPrivate::resetSocketLayer(), QTipLabel::reuseTip(), QmlJSDebugger::LiveSelectionTool::selectedItemsChanged(), QSidebar::selectUrl(), QHttpNetworkConnectionChannel::sendRequest(), ShaderEffectItem::setActive(), QUndoGroup::setActiveStack(), AVMediaObject::setAudioOutput(), QDBusAbstractAdaptor::setAutoRelaySignals(), QScriptEngineDebugger::setAutoShowStandardWindow(), QNetworkReplyImplPrivate::setCachingEnabled(), QScriptDebugger::setCodeFinderWidget(), QLineEdit::setCompleter(), QScriptDebugger::setConsoleWidget(), QMenuBar::setDefaultAction(), QSyntaxHighlighter::setDocument(), QUrlModel::setFileSystemModel(), QUndoView::setGroup(), QInputDialogPrivate::setInputWidget(), QDataWidgetMapper::setItemDelegate(), QAbstractItemView::setItemDelegate(), QAbstractItemView::setItemDelegateForColumn(), QAbstractItemView::setItemDelegateForRow(), QComboBoxPrivateContainer::setItemView(), QScriptDebuggerLocalsWidget::setLocalsModel(), QDeclarativeRepeater::setModel(), QTableView::setModel(), QDataWidgetMapper::setModel(), QTreeView::setModel(), QHeaderView::setModel(), QDeclarativePathView::setModel(), QDeclarativeGridView::setModel(), QAbstractItemView::setModel(), QDeclarativeListView::setModel(), QDeclarativeVisualDataModel::setModel(), QComboBox::setModel(), QMenuPrivate::setOverrideMenuAction(), QDeclarativePathView::setPath(), QCompleter::setPopup(), QGraphicsView::setScene(), QScriptDebugger::setScriptsWidget(), QmlJSDebugger::QDeclarativeViewInspectorPrivate::setSelectedItemsForTools(), QTreeView::setSelectionModel(), QAbstractItemView::setSelectionModel(), QHttpPrivate::setSock(), QTableView::setSortingEnabled(), QTreeView::setSortingEnabled(), ShaderEffectSource::setSourceItem(), QAbstractProxyModel::setSourceModel(), QIdentityProxyModel::setSourceModel(), QSortFilterProxyModel::setSourceModel(), QCompletionModel::setSourceModel(), QUndoModel::setStack(), QScriptDebugger::setStackWidget(), QTabWidget::setTabsClosable(), QDeviceClosedNotifier::setupDevice(), QToolBarLayout::setUsePopupMenu(), QGraphicsProxyWidgetPrivate::setWidget_helper(), QHttpThreadDelegate::synchronousAuthenticationRequiredSlot(), QHttpThreadDelegate::synchronousProxyAuthenticationRequiredSlot(), QConnmanEngine::technologyPropertyChangedContext(), QStyleSheetStyle::unpolish(), QTransportAuth::unregisterPolicyReceiver(), QPSQLDriver::unsubscribeFromNotificationImplementation(), QDeclarativeBasePositionerPrivate::unwatchChanges(), QDeclarativeGridViewPrivate::updateTrackedItem(), _IapAddTimer::~_IapAddTimer(), Maemo::IcdPrivate::~IcdPrivate(), QAudioInputPrivate::~QAudioInputPrivate(), QAudioOutputPrivate::~QAudioOutputPrivate(), QComboBox::~QComboBox(), QGraphicsProxyWidget::~QGraphicsProxyWidget(), QIntMouseHandler::~QIntMouseHandler(), QVFbScreenPrivate::~QVFbScreenPrivate(), and QWidgetAction::~QWidgetAction().
|
static |
Disconnects signal in object sender from method in object receiver. Returns true if the connection is successfully broken; otherwise returns false.
This function provides the same possibilities like disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method) but uses QMetaMethod to represent the signal and the method to be disconnected.
Additionally this function returnsfalse and no signals and slots disconnected if:
signal is not a member of sender class or one of its parent classes.
method is not a member of receiver class or one of its parent classes.
signal instance represents not a signal.
QMetaMethod() may be used as wildcard in the meaning "any signal" or "any slot in receiving object". In the same way 0 can be used for receiver in the meaning "any receiving object". In this case method should also be QMetaMethod(). sender parameter should be never 0.
Definition at line 3026 of file qobject.cpp.
|
inline |
Definition at line 248 of file qobject.h.
|
inline |
Definition at line 251 of file qobject.h.
|
protectedvirtual |
This virtual function is called when something has been disconnected from signal in this object.
See connectNotify() for an example of how to compare signal with a specific signal.
Reimplemented in QOfonoSmsInterface, QOfonoPrimaryDataContextInterface, QConnmanAgentInterface, QOfonoDataConnectionManagerInterface, QConnmanTechnologyInterface, QOfonoSimInterface, QConnmanServiceInterface, QOfonoNetworkOperatorInterface, QOfonoNetworkRegistrationInterface, QConnmanProfileInterface, QOfonoModemInterface, QConnmanManagerInterface, QDBusAbstractInterface, QNetworkSession, QOfonoManagerInterface, QFutureWatcherBase, and QBuffer.
Definition at line 3162 of file qobject.cpp.
Referenced by disconnect(), and QNetworkSession::disconnectNotify().
void QObject::dumpObjectInfo | ( | ) |
Dumps information about signal connections, etc.
for this object to the debug output.
This function is useful for debugging, but does nothing if the library has been compiled in release mode (i.e. without debugging information).
Definition at line 3917 of file qobject.cpp.
void QObject::dumpObjectTree | ( | ) |
Dumps a tree of children to the debug output.
This function is useful for debugging, but does nothing if the library has been compiled in release mode (i.e. without debugging information).
Definition at line 3901 of file qobject.cpp.
QList< QByteArray > QObject::dynamicPropertyNames | ( | ) | const |
Returns the names of all properties that were dynamically added to the object using setProperty().
Definition at line 3839 of file qobject.cpp.
Referenced by QScript::QObjectDelegate::getOwnPropertyNames().
|
virtual |
This virtual function receives events to an object and should return true if the event e was recognized and processed.
The event() function can be reimplemented to customize the behavior of an object.
Reimplemented in QMainWindowTabBar, QExceptionNotifier, QWriteNotifier, QReadNotifier, QCalendarView, QWidget, QGLWidget, QMdi::ControllerWidget, QMdi::ControlLabel, QTreeWidget, QApplication, QMessageBox, QAbstractItemView, QTableWidget, QSettings, QDeclarativePinchArea, QTextEdit, QDeclarativeTextEdit, QListWidget, QWorkspaceTitleBar, QTextControl, QGraphicsScene, QDeclarativeTextInput, QDeclarativeListView, QGraphicsView, QLineEdit, QPlainTextEdit, QComboBox, QAction, QGraphicsWidget, QMainWindow, QDeclarativeGridView, QCoreApplication, QHeaderView, QWizard, QTabBar, QDeclarativeWorkerScriptEnginePrivate, QMenu, QDeclarativePathView, QSplitterHandle, QStateMachine, QDeclarativeItem, QSystemTrayIconSys, QDeclarativeXmlQueryThreadObject, QCalendarPopup, QDateTimeEdit, QTabWidget, QDialogButtonBox, QFileSystemModel, QCalendarWidget, QMdiArea, QToolBar, QCompleter, QStyleSheetStyle, QMenuBar, QListView, QLabel, QAbstractSlider, QSidebar, QAbstractButton, QDeclarativePixmapReaderThreadObject, QAxHostWidget, QFrame, QScriptDebuggerBackendEventReceiver, QAbstractAnimation, QMacStyle, QAbstractSpinBox, QDockWidget, QX11EmbedContainer, QLCDNumber, QSplitter, QDeclarativePixmapReply, QProgressBar, QSystemTrayIcon, QMdiSubWindow, QDeclarativeListModelWorkerAgent, QDeclarativeWorkerScript, QToolButton, QDeclarativeSystemPalette, QTextBrowser, QDialog, QDnotifySignalThread, QClipboard, QState, QSpinBox, QWorkspace, QVariantAnimation, QStatusBar, QToolBox, QAbstractTransition, QMotifStyle, QEventDispatcherWin32, QAbstractScrollArea, QShortcut, QSlider, QProxyStyle, QMDIControl, QFontComboBox, QGraphicsSceneBspTreeIndex, QSoftKeyManager, QGroupBox, QPushButton, QWindowsVistaStyle, QDial, QNetworkReplyImpl, QStackedWidget, QScriptDebuggerCodeView, QScriptEditExtraArea, QFutureWatcherBase, QScrollArea, QSplashScreen, QWinEventNotifier, QGraphicsProxyWidget, QHistoryState, QAbstractState, QRubberBand, QCheckBox, QSocketNotifier, QX11EmbedWidget, QSequentialAnimationGroup, QEventTransition, QSignalTransition, QAnimationGroup, QPropertyAnimation, QSizeGrip, QScriptDebuggerFrontendEventReceiver, QWidgetAction, QCommandLinkButton, QPauseAnimation, QParallelAnimationGroup, QRadioButton, QScrollBar, QFinalState, QFocusFrame, and QMacNativeWidget.
Definition at line 1200 of file qobject.cpp.
Referenced by QWSServerPrivate::_q_newConnection(), QEventDispatcherUNIX::activateSocketNotifiers(), QDeclarativeDebugTrace::addEventImpl(), QDeclarativeState::apply(), clipboardData(), QGestureManager::deliverEvents(), QStyleSheetStyle::deref(), QBBBpsEventFilter::dispatcherEventFilter(), QStyledItemDelegate::editorEvent(), QItemDelegate::editorEvent(), QBBInputContext::endComposition(), QSocketNotifier::event(), QAbstractState::event(), QWinEventNotifier::event(), QFutureWatcherBase::event(), QNetworkReplyImpl::event(), QWindowsVistaStyle::event(), QGraphicsSceneBspTreeIndex::event(), QEventDispatcherWin32::event(), QAbstractTransition::event(), QMotifStyle::event(), QClipboard::event(), QDnotifySignalThread::event(), QDeclarativeSystemPalette::event(), QDeclarativeWorkerScript::event(), QDeclarativeListModelWorkerAgent::event(), QSystemTrayIcon::event(), QDeclarativePixmapReply::event(), QAbstractAnimation::event(), QDeclarativePixmapReaderThreadObject::event(), QStyleSheetStyle::event(), QCompleter::event(), QFileSystemModel::event(), QDeclarativeXmlQueryThreadObject::event(), QDeclarativeItem::event(), QDeclarativeWorkerScriptEnginePrivate::event(), QCoreApplication::event(), QGraphicsWidget::event(), QAction::event(), QGraphicsScene::event(), QTextControl::event(), QSettings::event(), QXlibScreen::eventDispatcher(), QBBInputContext::eventFilter(), QVistaHelper::eventFilter(), QScriptDebuggerLocalsItemDelegate::eventFilter(), QBBInputContext::filterEvent(), QBBEngine::filterEvent(), QApplicationPrivate::globalEventProcessor(), QDirectFbInput::handleEvents(), QBBInputContext::hasPhysicalKeyboard(), QAbstractItemDelegate::helpEvent(), QSystemTrayIcon::hide(), QmlJSDebugger::AbstractTool::inspector(), QGraphicsScene::invalidate(), QWSServerPrivate::invokeCreate(), QWSServerPrivate::invokeScreenTransform(), QBBInputContext::isComposing(), isProcessBeingDebugged(), QWSInputContext::language(), QCoreApplicationPrivate::notify_helper(), QApplicationPrivate::notify_helper(), QBBInputContext::onCommitText(), QBBInputContext::onDeleteSurroundingText(), QBBInputContext::onFinishComposingText(), QBBInputContext::onSetComposingRegion(), QShortcut::parentWidget(), QXlibScreen::physicalSize(), QKeyMapper::possibleKeys(), QEventDispatcherQPA::processEvents(), QEventDispatcherQWS::processEvents(), QEventDispatcherX11::processEvents(), QXcbConnection::processXcbEvents(), QExceptionNotifier::QExceptionNotifier(), QReadNotifier::QReadNotifier(), qt_x11_incr_event_filter(), QUIKitSoftwareInputHandler::QUIKitSoftwareInputHandler(), QWriteNotifier::QWriteNotifier(), QInotifyFileSystemWatcherEngine::readFromInotify(), QFactoryLoader::refreshAll(), QBBScreenEventThread::run(), QIntMouseListenThread::run(), QEventDispatcherBlackberry::select(), QWSClient::sendConnectedEvent(), QWSClient::sendEmbedEvent(), QWSServerPrivate::sendFontRemovedEvent(), QWSServer::sendIMEvent(), QWSServer::sendIMQuery(), QWSServerPrivate::sendKeyEventUnfiltered(), QWSClient::sendMaxWindowRectEvent(), QWSServerPrivate::sendMouseEventUnfiltered(), QWSClient::sendPropertyNotifyEvent(), QWSClient::sendPropertyReplyEvent(), QWSServerPrivate::sendQCopEvent(), QWSClient::sendRegionEvent(), QWSClient::sendSelectionClearEvent(), QWSClient::sendSelectionRequestEvent(), QBBInputContext::setComposingText(), QMacInputContext::setLastKeydownEvent(), QObjectPrivate::setThreadData_helper(), QBBScreenEventThread::shutdown(), QmlJSDebugger::AbstractViewInspector::slowDownFactor(), QTextControl::toHtml(), QSidebar::urls(), QmlJSDebugger::QDeclarativeViewInspector::viewWidget(), QXlibScreen::waitForClipboardEvent(), and QEventDispatcherBlackberry::wakeUp().
Filters events if this object has been installed as an event filter for the watched object.
In your reimplementation of this function, if you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.
Example:
Notice in the example above that unhandled events are passed to the base class's eventFilter() function, since the base class might have reimplemented eventFilter() for its own internal purposes.
Reimplemented in QWorkspaceChild, QWhatsThisPrivate, QAxServerBase, QGtkStyleFilter, QGraphicsScene, QComboBoxPrivateContainer, QScriptBreakpointsItemDelegate, QDragManager, QMacStylePrivate, QScriptDebuggerLocalsItemDelegate, QScriptDebugger, QStateMachine, QCalendarWidget, QMdiArea, QCompleter, QMenuBar, QmlJSDebugger::AbstractViewInspector, QVistaHelper, QTipLabel, QAxHostWidget, QFontDialog, QDialog, QX11EmbedContainer, QAbstractScrollAreaFilter, QMdiSubWindow, QItemDelegate, QMotifStyle, QDeclarativeSystemPalette, QWorkspace, QDeclarativeView, QPlastiqueStyle, QStyledItemDelegate, QWidgetResizeHandler, QWindowsStyle, QDeclarativeLoader, QMeeGoGraphicsSystemSwitchHandler, QScrollArea, QGraphicsProxyWidget, QCalendarTextNavigator, QmlJSDebugger::QDeclarativeViewInspector, QX11EmbedWidget, QAlphaWidget, QBBInputContext, QWidgetAction, QSizeGrip, QDeclarativeApplication, QFocusFrame, QWSEmbedWidget, and QUIKitSoftwareInputHandler.
Definition at line 1375 of file qobject.cpp.
Referenced by QWSEmbedWidget::eventFilter(), QSizeGrip::eventFilter(), QWidgetAction::eventFilter(), QBBInputContext::eventFilter(), QAlphaWidget::eventFilter(), QX11EmbedWidget::eventFilter(), QmlJSDebugger::QDeclarativeViewInspector::eventFilter(), QCalendarTextNavigator::eventFilter(), QGraphicsProxyWidget::eventFilter(), QDeclarativeLoader::eventFilter(), QWindowsStyle::eventFilter(), QDeclarativeView::eventFilter(), QWorkspace::eventFilter(), QDeclarativeSystemPalette::eventFilter(), QMotifStyle::eventFilter(), QMdiSubWindow::eventFilter(), QX11EmbedContainer::eventFilter(), QDialog::eventFilter(), QAxHostWidget::eventFilter(), QVistaHelper::eventFilter(), QmlJSDebugger::AbstractViewInspector::eventFilter(), QCompleter::eventFilter(), QCalendarWidget::eventFilter(), QMdiArea::eventFilter(), QComboBoxPrivateContainer::eventFilter(), QGtkStyleFilter::eventFilter(), QAxServerBase::eventFilter(), QWorkspaceChild::eventFilter(), QGraphicsScene::invalidate(), QCalendarWidget::isNavigationBarVisible(), QVistaHelper::leftMargin(), QApplication::notify(), QCoreApplicationPrivate::sendThroughApplicationEventFilters(), QCoreApplicationPrivate::sendThroughObjectEventFilters(), and QWidgetResizeHandler::setFrameWidth().
Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object.
Omitting the name argument causes all object names to be matched. The search is performed recursively.
If there is more than one child matching the search, the most direct ancestor is returned. If there are several direct ancestors, it is undefined which one will be returned. In that case, findChildren() should be used.
This example returns a child QPushButton of parentWidget
named "button1"
:
This example returns a QListWidget child of parentWidget
:
Definition at line 158 of file qobject.h.
Referenced by QDeclarativeVisualDataModelPrivate::data(), QPlastiqueStylePrivate::drawPartialFrame(), QWindowsVistaStyle::drawPrimitive(), embeddedWidget(), QStateMachinePrivate::goToState(), QWorkspacePrivate::maximizeWindow(), menuItemEntry(), QWorkspacePrivate::minimizeWindow(), QWorkspacePrivate::normalizeWindow(), QAxClientSite::OnPosRectChange(), QWindowsVistaStyle::polish(), qFindChild(), QScript::qobjectProtoFuncFindChild(), QPrintDialogPrivate::setupDestination(), QPrintDialogPrivate::setupOptions(), QPrintDialogPrivate::setupPaper(), QPrintDialogPrivate::setupPrinterSettings(), QMdiSubWindow::setWidget(), showNewMessageBox(), QWindowsStyle::styleHint(), QStyleSheetStyle::styleHint(), QMacStyle::unpolish(), and QWindowsVistaStyle::unpolish().
|
inline |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
Omitting the name argument causes all object names to be matched. The search is performed recursively.
The following example shows how to find a list of child QWidget of the specified parentWidget
named widgetname
:
This example returns all QPushButton
s that are children of parentWidget
:
Definition at line 162 of file qobject.h.
Referenced by QStateMachinePrivate::applyProperties(), QMetaObject::connectSlotsByName(), QWindowsStyle::eventFilter(), QEventDispatcherMac::flush(), qFindChildren(), QScript::qobjectProtoFuncFindChildren(), QAbstractButtonPrivate::queryButtonList(), QAccessibleApplication::relationTo(), QStyleSheetStyle::repolish(), QWorkspaceChild::setActive(), QWidget::setTabOrder(), and QStateMachinePrivate::unregisterAllTransitions().
Definition at line 176 of file qobject.h.
|
inline |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false.
A class is considered to inherit itself.
Example:
If you need to determine whether an object is an instance of a particular class for the purpose of casting it, consider using qobject_cast<Type *>(object) instead.
Definition at line 275 of file qobject.h.
Referenced by QMacStylePrivate::addWidget(), axc_FilterProc(), QX11Data::clipboardWaitForEvent(), QPlastiqueStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), QPlastiqueStyle::drawControl(), QWindowsCEStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QGtkStyle::drawPrimitive(), QApplication::font(), QToolButton::initStyleOption(), QWindowsXPStylePrivate::isItemViewDelegateLineEdit(), isTreeView(), killTimer(), QAccessibleMdiSubWindow::navigate(), QApplication::palette(), QWindowsXPStyle::pixelMetric(), QPlastiqueStyle::pixelMetric(), QWindowsStyle::pixelMetric(), QMacStyle::pixelMetric(), QWindowsXPStyle::polish(), QWindowsVistaStyle::polish(), QPlastiqueStyle::polish(), QCleanlooksStyle::polish(), qt_aqua_get_known_size(), qt_find_obj_child(), qt_set_x11_resources(), qt_x11_recreateWidget(), QMacStylePrivate::removeWidget(), QWidget::setAttribute(), QStyledItemDelegate::setEditorData(), QItemDelegate::setEditorData(), QWidget::setFocus(), QApplication::setFont(), setObjectName(), QApplicationPrivate::setPalette_helper(), QGraphicsView::setupViewport(), QFocusFrame::setWidget(), QStyleSheetStyle::sizeFromContents(), QCleanlooksStyle::styleHint(), QMacStyle::styleHint(), QCommonStyle::subControlRect(), QWindowsXPStyle::unpolish(), QPlastiqueStyle::unpolish(), QCleanlooksStyle::unpolish(), QAuthDevice::writeData(), and QApplicationPrivate::x11_apply_settings().
void QObject::installEventFilter | ( | QObject * | filterObj | ) |
Installs an event filter filterObj on this object.
For example:
An event filter is an object that receives all events that are sent to this object. The filter can either stop the event or forward it to this object. The event filter filterObj receives events via its eventFilter() function. The eventFilter() function must return true if the event should be filtered, (i.e. stopped); otherwise it must return false.
If multiple event filters are installed on a single object, the filter that was installed last is activated first.
Here's a KeyPressEater
class that eats the key presses of its monitored objects:
And here's how to install it on two widgets:
The QShortcut class, for example, uses this technique to intercept shortcut key presses.
Note that the filtering object must be in the same thread as this object. If filterObj is in a different thread, this function does nothing. If either filterObj or this object are moved to a different thread after calling this function, the event filter will not be called until both objects have the same thread affinity again (it is not removed).
Definition at line 2070 of file qobject.cpp.
Referenced by QDataWidgetMapper::addMapping(), QMeeGoGraphicsSystemSwitchHandler::addWidget(), QMacStylePrivate::addWidget(), QWorkspace::addWindow(), QMdiAreaPrivate::appendChild(), QAbstractItemView::commitData(), QAbstractItemViewPrivate::editor(), QScrollArea::event(), QDataWidgetMapperPrivate::flipEventFilters(), QMenuBarPrivate::handleReparent(), QDeclarativeLoaderPrivate::initResize(), QAxServerBase::internalActivate(), QWindowsStyle::polish(), QMotifStyle::polish(), QPlastiqueStyle::polish(), QBalloonTip::QBalloonTip(), QBBInputContext::QBBInputContext(), QMdiArea::QMdiArea(), QWidgetResizeHandler::QWidgetResizeHandler(), QWorkspaceChild::QWorkspaceChild(), QX11EmbedWidget::QX11EmbedWidget(), QStateMachinePrivate::registerEventTransition(), QWorkspaceChild::setActive(), QScriptDebugger::setCodeWidget(), QMenuBar::setCornerWidget(), QComboBoxPrivateContainer::setItemView(), QCalendarWidgetPrivate::setNavigatorEnabled(), QCompleter::setPopup(), QMdiSubWindowPrivate::setSizeGrip(), QFocusFrame::setWidget(), QScrollArea::setWidget(), QMdiSubWindow::setWidget(), QGraphicsProxyWidgetPrivate::setWidget_helper(), QMdiSubWindowPrivate::showButtonsInMenuBar(), QSizeGripPrivate::updateTopLevelWidget(), and QWSEmbedWidgetPrivate::updateWindow().
|
inline |
Returns true if the object is a widget; otherwise returns false.
Calling this function is equivalent to calling inherits("QWidget"), except that it is much faster.
Definition at line 146 of file qobject.h.
Referenced by QGroupBoxPrivate::_q_setChildrenEnabled(), QGroupBox::childEvent(), QSplitter::childEvent(), classIDL(), QScriptEnginePrivate::convertValue(), CompatAccessibleFactory::create(), AccessibleFactory::create(), QPanGestureRecognizer::create(), QWinNativePanGestureRecognizer::create(), QPinchGestureRecognizer::create(), QSwipeGestureRecognizer::create(), QTapGestureRecognizer::create(), QTapAndHoldGestureRecognizer::create(), QGestureManager::deliverEvents(), QWidget::destroy(), do_size_hints(), dumpRecursive(), effectiveState(), QWidget::ensurePolished(), QScrollArea::eventFilter(), QWindowsStyle::eventFilter(), QWhatsThisPrivate::eventFilter(), getNamedAttribute(), QGestureManager::getState(), QWindowsAccessible::GetWindow(), QAccessibleApplication::indexOfChild(), QWidgetPrivate::isBackgroundInherited(), QAxServerBase::isPropertyExposed(), isServerProcess(), killTimer(), make_win_eventUPP(), QCoreApplication::notify(), QApplication::notify(), QApplicationPrivate::notify_helper(), QAction::parentWidget(), parseGeometry(), q_createNativeChildrenAndSetParent(), qSmartSpacing(), qt_grab_cursor(), qt_mac_unregister_widget(), qt_mac_update_widget_position(), qt_set_windows_updateScrollBar(), QMacSwipeGestureRecognizer::recognize(), QMacPinchGestureRecognizer::recognize(), QDeclarativeVME::run(), sendResizeEvents(), QWidget::setLayout(), setObjectName(), QLayout::update(), QAccessible::updateAccessibility(), and QLayout::widgetEvent().
void QObject::killTimer | ( | int | id | ) |
Kills the timer with timer identifier, id.
The timer identifier is returned by startTimer() when a timer event is started.
Definition at line 1650 of file qobject.cpp.
Referenced by QUnixSocket::abort(), QStateMachine::cancelDelayedEvent(), QDBusConnectionPrivate::customEvent(), QAxHostWidget::event(), QStateMachine::event(), QPlastiqueStyle::eventFilter(), QMotifStyle::eventFilter(), QTestEventLoop::exitLoop(), findRealWindow(), QAxHostWidget::focusOutEvent(), QFontCache::increaseCost(), QGLBlurTextureCache::insertBlurTextureInfo(), QLineControl::internalInsert(), QMenu::mouseMoveEvent(), QLineControl::processEvent(), QLineControl::processMouseEvent(), qDBusRemoveTimeout(), QTapAndHoldGestureRecognizer::recognize(), QTapAndHoldGestureRecognizer::reset(), QLineControl::resetCursorBlinkTimer(), QMdiSubWindow::resizeEvent(), restartXdndDropExpiryTimer(), QLineControl::setCursorBlinkPeriod(), QTimer::setInterval(), QTimeLine::setPaused(), QMacAnimateCursor::start(), QMacAnimateCursor::stop(), QTimer::stop(), QTimeLine::stop(), QWindowsStylePrivate::stopAnimation(), QBalloonTip::timerEvent(), QMdiSubWindow::timerEvent(), QAbstractSpinBox::timerEvent(), QTableView::timerEvent(), QMdiArea::timerEvent(), QCoreFuriCuri::timerEvent(), QMenu::timerEvent(), QScriptDebugger::timerEvent(), QTreeView::timerEvent(), QPMCache::timerEvent(), QMacStylePrivate::timerEvent(), QFontCache::timerEvent(), QSingleShotTimer::timerEvent(), QGLBlurTextureCache::timerEvent(), QLineControl::timerEvent(), QDeclarativePixmapStore::timerEvent(), QClipboardINCRTransaction::x11Event(), and QSingleShotTimer::~QSingleShotTimer().
|
virtual |
Returns a pointer to the meta-object of this object.
A meta-object contains information about a class that inherits QObject, e.g. class name, superclass name, properties, signals and slots. Every QObject subclass that contains the Q_OBJECT macro will have a meta-object.
The meta-object information is required by the signal/slot connection mechanism and the property system. The inherits() function also makes use of the meta-object.
If you have no pointer to an actual object instance but still want to access the meta-object of a class, you can use staticMetaObject .
Example:
Reimplemented in QScript::QObjectConnectionManager, QDBusInterface, QSignalEventGenerator, QAxWidget, and QAxObject.
Referenced by QLayout::activate(), QMetaObject::activate(), ActiveObject::ActiveObject(), QAxServerBase::ActiveXProc(), QDBusAdaptorConnector::addAdaptor(), QGraphicsLayoutPrivate::addChildLayoutItem(), QLayout::addChildWidget(), QAccessibleWidget::addControllingSignal(), QGraphicsScene::addItem(), QAxScriptManager::addObject(), QScript::QObjectConnectionManager::addSignalHandler(), QState::addTransition(), QDeclarativeWatcher::addWatch(), QGridLayout::addWidget(), QDeclarativeListReference::append(), QMacStylePrivate::aquaSizeConstrain(), QStyleSheetStyleSelector::attribute(), QDeclarativePropertyPrivate::binding(), QDeclarativeEngineDebugService::buildObjectDump(), QDeclarativeCompiler::buildValueTypeProperty(), QDeclarativeEnginePrivate::cache(), QDeclarativeObjectMethodScriptClass::callOverloaded(), QDeclarativeObjectMethodScriptClass::callPrecise(), QDBusAbstractInterface::callWithArgumentList(), QMetaObject::cast(), check_method_code(), check_parent_thread(), check_signal_macro(), QCoreApplicationPrivate::checkReceiverThread(), checkWidget(), QAxFactory::classID(), QDeclarativeCompiler::compileAlias(), QDeclarativeObjectMethodScriptClass::connect(), QDeclarativePropertyPrivate::connect(), connect(), QMetaObject::connect(), QDeclarativeVMEMetaObject::connectAlias(), QDBusAdaptorConnector::connectAllSignals(), QDeclarativeProperty::connectNotifySignal(), ShaderEffectItem::connectPropertySignals(), QMetaObject::connectSlotsByName(), QDeclarativeContext::contextProperty(), QDeclarativeEnginePrivate::createCache(), QLayoutPrivate::createSpacerItem(), QDeclarativeItemPrivate::data_append(), QDeclarativeMetaType::defaultMethod(), QDeclarativeMetaType::defaultProperty(), QDeclarativeNotifierEndpoint::disconnect(), QDeclarativeObjectMethodScriptClass::disconnect(), disconnect(), QMetaObject::disconnect(), QDBusAdaptorConnector::disconnectAllSignals(), QMetaObject::disconnectOne(), QWindowsStyle::drawPrimitive(), dumpObjectInfo(), dumpRecursive(), QProxyStylePrivate::ensureBaseStyle(), QWidget::ensurePolished(), QApplicationPrivate::enterModal_sys(), err_method_notfound(), QAxFactory::eventsID(), QCoreApplication::exec(), QScript::QtFunction::execute(), QScript::QtPropertyFunction::execute(), QAxFactory::exposeToSuperClass(), QDeclarativePropertyPrivate::findAliasTarget(), QDeclarativeCompiledBindingsPrivate::findproperty(), QDBusConnectionPrivate::findSlot(), QApplication::font(), fromScriptValue(), QScript::QObjectDelegate::getOwnPropertyNames(), QApplicationPrivate::globalEventProcessor(), QStateMachinePrivate::handleTransitionSignal(), QDeclarativeProperty::hasNotifySignal(), QAxFactory::hasStockEvents(), hasValidSignal(), QNetworkReply::ignoreSslErrors(), QDeclarativeBoundSignal::init(), QNetworkReplyImplPrivate::initCacheSaveDevice(), QDeclarativeVisualDataModelDataMetaObject::initialValue(), QDeclarativePropertyPrivate::initProperty(), QAxFactory::interfaceID(), QAxServerBase::internalActivate(), QMetaObject::invokeMethod(), QTest::invokeMethod(), QDeclarativeProperty::isDesignable(), QAxServerBase::isPropertyExposed(), QDeclarativeKeysAttached::keyPressed(), keyTypeForObject(), QStyle::layoutSpacing(), QApplicationPrivate::leaveModal_sys(), make_widget_eventUPP(), QDataWidgetMapper::mappedPropertyName(), QMetaObjectPrivate::memberIndexes(), QDeclarativeProxyMetaObject::metaCall(), QDeclarativeVMEMetaObject::metaCall(), QScript::QtFunction::metaObject(), QDeclarativeProperty::method(), QDeclarativeProperty::name(), QDeclarativePropertyCache::Data::name(), QStyleSheetStyle::nativeFrameWidth(), QDeclarativeEngineDebugService::objectData(), QDeclarativeDebugService::objectToString(), operator<<(), QDeclarativeBindingCompilerPrivate::Result::operator==(), QApplication::palette(), parentWidget(), QStyleSheetStyle::polish(), QDeclarativeValueTypeScriptClass::property(), QDeclarativeObjectMethodScriptClass::property(), QDeclarativeProperty::property(), QDeclarativeObjectScriptClass::property(), QDeclarativePropertyCache::property(), property(), QDeclarativeEngineDebugService::propertyData(), QDeclarativeObjectScriptClass::propertyNames(), QDeclarativeProperty::propertyTypeName(), ptr(), qax_generateDocumentation(), QAxServerBase::QAxServerBase(), qDBusInterfaceInObject(), qDBusIntrospectObject(), qDBusPropertyGet(), QDeclarativeBoundSignalParameters::QDeclarativeBoundSignalParameters(), QDeclarativeOpenMetaObject::QDeclarativeOpenMetaObject(), QDeclarativeVMEMetaObject::QDeclarativeVMEMetaObject(), QTest::qExec(), QTest::qInvokeTestMethods(), QIODevice::QIODevice(), QLayout::QLayout(), qmlExecuteDeferred(), QScript::qobjectProtoFuncToString(), QTest::qPrintDataTags(), QTest::qPrintTestSlots(), QRenderRule::QRenderRule(), QScriptDBusInterfaceConstructor::QScriptDBusInterfaceConstructor(), QScriptDBusMessageConstructor::QScriptDBusMessageConstructor(), QTest::qSignalDumperCallback(), QTest::qSignalDumperCallbackEndSignal(), QTest::qSignalDumperCallbackSlot(), QSignalSpy::QSignalSpy(), qt_adopted_thread_watcher_function(), qt_aqua_get_known_size(), qt_mac_send_modifiers_changed(), QDBusAbstractInterfaceBase::qt_metacall(), qt_nograb(), QTest::qtest_qParseArgs(), QDeclarativeValueTypeScriptClass::queryProperty(), queued_activate(), QVariantToVARIANT(), QDeclarativePropertyPrivate::readValueProperty(), QAxFactory::registerActiveObject(), QStateMachinePrivate::registerSignalTransition(), QDBusAdaptorConnector::relay(), QDBusAdaptorConnector::relaySlot(), QCoreApplicationPrivate::removePostedEvent(), QScript::QObjectConnectionManager::removeSignalHandler(), QGraphicsLayoutPrivate::reparentChildItems(), QDeclarativeEngineDebugService::resetBinding(), QDeclarativeCompiledBindingsPrivate::run(), QScriptEnginePrivate::scriptConnect(), QScriptEnginePrivate::scriptDisconnect(), QKeyMapper::sendKeyEvent(), QDBusAbstractAdaptor::setAutoRelaySignals(), QDeclarativePropertyPrivate::setBinding(), QDeclarativeData::setBindingBit(), QDeclarativePropertyPrivate::setBindingNoEnable(), QNetworkReplyImplPrivate::setCachingEnabled(), QDeclarativeContext::setContextProperty(), QStyledItemDelegate::setEditorData(), QItemDelegate::setEditorData(), QWidget::setFocusProxy(), QGraphicsWidget::setLayout(), QWidget::setLayout(), QStyledItemDelegate::setModelData(), QItemDelegate::setModelData(), QStyleSheetStyle::setProperties(), QDeclarativeValueTypeScriptClass::setProperty(), setProperty(), QDBusPendingCallPrivate::setReplyCallback(), QDeclarativeAbstractAnimation::setRunning(), QNetworkReply::setSslConfiguration(), QDeclarativeBehavior::setTarget(), setupDBusInterface(), QNetworkReply::sslConfiguration(), QThreadPrivate::start(), QmlJSDebugger::AbstractLiveEditTool::titleForItem(), QDeclarativeObjectScriptClass::tostring(), QAxServerBase::UIDeactivate(), QAccessible::updateAccessibility(), QPropertyAnimationPrivate::updateMetaProperty(), QGLContext::updatePaintDevice(), QAxFactory::validateLicenseKey(), QDeclarativeValueTypeFactory::valueType(), VARIANTToQVariant(), QGraphicsView::viewportEvent(), QDeclarativePropertyPrivate::write(), writeProperty(), and QDeclarativeInfo::~QDeclarativeInfo().
void QObject::moveToThread | ( | QThread * | targetThread | ) |
Changes the thread affinity for this object and its children.
The object cannot be moved if it has a parent. Event processing will continue in the targetThread.
To move an object to the main thread, use QApplication::instance() to retrieve a pointer to the current application, and then use QApplication::thread() to retrieve the thread in which the application lives. For example:
If targetThread is zero, all event processing for this object and its children stops.
Note that all active timers for the object will be reset. The timers are first stopped in the current thread and restarted (with the same interval) in the targetThread. As a result, constantly moving an object between threads can postpone timer events indefinitely.
A QEvent::ThreadChange event is sent to this object just before the thread affinity is changed. You can handle this event to perform any special processing. Note that any new events that are posted to this object will be handled in the targetThread.
Definition at line 1458 of file qobject.cpp.
Referenced by QDBusConnectionPrivate::checkThread(), connManager(), QAdoptedThread::createThreadForAdoption(), QCoreApplication::init(), QNetworkConfigurationManagerPrivate::initialize(), QGLSignalProxy::instance(), QScriptDebuggerBackendPrivate::postEvent(), QNetworkAccessHttpBackend::postRequest(), QDBusDefaultConnection::QDBusDefaultConnection(), QDeclarativePixmapReader::QDeclarativePixmapReader(), QDeclarativeWorkerScriptEngine::QDeclarativeWorkerScriptEngine(), QDnotifySignalThread::QDnotifySignalThread(), QFactoryLoader::QFactoryLoader(), QFileSystemWatcherEngine::QFileSystemWatcherEngine(), QHostInfoLookupManager::QHostInfoLookupManager(), QInotifyFileSystemWatcherEngine::QInotifyFileSystemWatcherEngine(), QPollingFileSystemWatcherEngine::QPollingFileSystemWatcherEngine(), QWaylandScreen::QWaylandScreen(), QWindowsFileSystemWatcherEngineThread::QWindowsFileSystemWatcherEngineThread(), QDBusConnectionPrivate::sendWithReplyAsync(), and QNetworkConfigurationManagerPrivate::updateConfigurations().
QString QObject::objectName | ( | ) | const |
Referenced by QLayout::activate(), QLayout::addChildLayout(), QGraphicsLayoutPrivate::addChildLayoutItem(), QLayout::addChildWidget(), QDockAreaLayout::addDockWidget(), QFileSystemWatcher::addPaths(), QGridLayout::addWidget(), QMacStylePrivate::aquaSizeConstrain(), QDeclarativeEngineDebugService::buildObjectList(), checkWidget(), childWidgets(), QGLShaderPrivate::compile(), AccessibleFactory::create(), QLayoutPrivate::createSpacerItem(), DllCanUnloadNow(), dumpObjectInfo(), QAccessibleAbstractScrollArea::elementType(), QApplicationPrivate::enterModal_sys(), QGLEngineSharedShaders::findProgramInCache(), QApplicationPrivate::globalEventProcessor(), QFormLayout::insertRow(), QSplitterPrivate::insertWidget(), QStyleSheetStyle::isNaturalChild(), QApplicationPrivate::leaveModal_sys(), QGLShaderProgram::link(), make_widget_eventUPP(), QDeclarativeEngineDebugService::messageReceived(), QDeclarativeDebugService::objectToString(), operator<<(), QAccessibleItemView::QAccessibleItemView(), QAxHostWidget::QAxHostWidget(), QLayout::QLayout(), QMainWindowLayout::QMainWindowLayout(), QPlaceHolderItem::QPlaceHolderItem(), qt_adopted_thread_watcher_function(), qt_nograb(), QtWndProc(), QDBusAdaptorConnector::relaySlot(), QGraphicsLayoutPrivate::reparentChildItems(), QDockAreaLayout::restoreDockWidget(), QDockAreaLayoutInfo::restoreState(), QToolBarAreaLayout::restoreState(), QToolBarAreaLayout::saveState(), QKeyMapper::sendKeyEvent(), QLCDNumber::setDigitCount(), QStateMachinePrivate::setError(), QWidget::setFocusProxy(), QGraphicsWidget::setLayout(), QWidget::setLayout(), QWSDisplay::setWindowCaption(), QDockAreaLayout::splitDockWidget(), QThreadPrivate::start(), QDockAreaLayout::tabifyDockWidget(), QmlJSDebugger::AbstractLiveEditTool::titleForItem(), QGLContext::updatePaintDevice(), QWSWindowSurface::winId(), QObjectPrivate::Connection::~Connection(), and ~QObject().
|
inline |
Returns a pointer to the parent object.
Definition at line 273 of file qobject.h.
Referenced by QColumnViewPrivate::_q_clicked(), QAbstractItemViewPrivate::_q_columnsAboutToBeRemoved(), QLayout::addChildLayout(), QDnotifyFileSystemWatcherEngine::addPaths(), QFileSystemModelPrivate::addVisibleFiles(), QPushButtonPrivate::adjustedMenuPosition(), QWidgetPrivate::adjustFlags(), QLayout::adoptLayout(), QDeclarativeParticleMotionWander::advance(), ancestorOf(), QAbstractTextDocumentLayout::anchorAt(), QDeclarativeGraphicsWidget::anchors(), QDirModelPrivate::appendChild(), QMdiAreaPrivate::appendChild(), QPlainTextEditControl::canInsertFromMimeData(), QTextEditControl::canInsertFromMimeData(), QRubberBand::changeEvent(), QMdiSubWindow::changeEvent(), QNativeSocketEnginePrivate::checkProxy(), QToolBarLayout::checkUsePopupMenu(), QDirModelPrivate::children(), QMenu::clear(), QAbstractItemViewPrivate::clearOrRemove(), QColumnViewPrivate::closeColumns(), QDeclarativeComponentPrivate::complete(), QPanGestureRecognizer::create(), QDeclarativeBinding::createBinding(), QGraphicsScene::createItemGroup(), QPlainTextEditControl::createMimeDataFromSelection(), QTextEditControl::createMimeDataFromSelection(), QUrlModel::dataChanged(), QDeclarativeCompiledBindingsPrivate::Binding::destroy(), QDeclarativeCompiledBindingsPrivate::Binding::disconnect(), QApplicationPrivate::dispatchEnterLeave(), QGraphicsScenePrivate::dispatchHoverEvent(), QTextObject::docHandle(), QTextObject::document(), QTreeView::doItemsLayout(), QTreeView::drawBranches(), QWindowsCEStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QTreeView::drawRow(), QTreeWidget::dropEvent(), QDirModel::dropMimeData(), QListModel::dropMimeData(), QTableModel::dropMimeData(), QScriptEditExtraArea::editor(), QAbstractItemViewPrivate::editor(), QLineControl::emitCursorPositionChanged(), QWinInputContext::enablePopupChild(), QTreeModel::ensureSorted(), QTreeWidgetItemIteratorPrivate::ensureValidIterator(), QRadioButton::event(), QCheckBox::event(), QStatusBar::event(), QMdiSubWindow::event(), QGraphicsScene::event(), QWorkspace::eventFilter(), QMdiSubWindow::eventFilter(), QMenuBar::eventFilter(), QScriptDebuggerLocalsItemDelegate::eventFilter(), QCompletionEngine::filter(), findRealWindow(), QTextHtmlExporter::findUrlForImage(), QSplitterPrivate::findWidget(), QGLWindowSurface::flush(), QGraphicsWidget::focusNextPrevChild(), QDeclarativeItem::forceActiveFocus(), QAbstractTextDocumentLayout::format(), QAbstractTextDocumentLayout::formatIndex(), QGraphicsScenePrivate::gestureEventHandler(), getImage(), getPixmap(), QInputDialog::getText(), QPushButtonPrivate::hitButton(), QTableModel::index(), QDirModel::index(), QSortedModelEngine::indexHint(), QTreeView::indexRowSizeHint(), QCoreApplication::init(), QListModel::insert(), QPlainTextEditControl::insertFromMimeData(), QTextEditControl::insertFromMimeData(), QListModel::insertRows(), QModelIndex::internalId(), QWorkspaceChild::internalRaise(), QLineControl::internalSetText(), isAncestor(), QWidgetPrivate::isBackgroundInherited(), isEmbeddedTabBar(), isStandaloneTabBar(), QStandardItemModel::itemFromIndex(), QAbstractItemView::keyboardSearch(), QDeclarativeKeyNavigationAttached::keyPressed(), QMdiSubWindow::keyPressEvent(), QTreeView::keyPressEvent(), QDeclarativeKeyNavigationAttached::keyReleased(), QTreeViewPrivate::layout(), QGraphicsScenePrivate::leaveScene(), QTextDocumentWithImageResources::loadResource(), QTextControl::loadResource(), QTextDocument::loadResource(), QCompletionEngine::lookupCache(), QAbstractStatePrivate::machine(), QCompletionModel::mapToSource(), QScript::QObjectConnection::mark(), QAbstractItemModel::match(), QCompletionEngine::matchHint(), QScriptDebuggerPrivate::maybeDelete(), QMdiSubWindow::mdiArea(), QListModel::mimeData(), QTableModel::mimeData(), QListModel::mimeTypes(), QTableModel::mimeTypes(), QMdiSubWindow::minimumSizeHint(), QColumnViewGrip::mouseDoubleClickEvent(), QMdiSubWindow::mouseDoubleClickEvent(), QMdiSubWindow::mouseMoveEvent(), QWorkspaceTitleBar::mouseMoveEvent(), QMdiSubWindow::mousePressEvent(), QGroupBox::mouseReleaseEvent(), QMdiSubWindow::mouseReleaseEvent(), QMdiSubWindow::moveEvent(), QColumnViewGrip::moveGrip(), QWidget::nativeParentWidget(), QAccessibleWidget::navigate(), QDeclarativeObjectScriptClass::newQObject(), QTreeWidgetItemIteratorPrivate::next(), QDirModelPrivate::node(), QFileSystemModelPrivate::node(), QDeclarativeEngineDebugService::objectCreated(), QDeclarativeEngineDebugService::objectData(), QWidgetPrivate::paintBackground(), QToolBoxButton::paintEvent(), QMdiSubWindow::paintEvent(), CloseButton::paintEvent(), QTreeModel::parent(), parent(), QAccessibleWidget::parentObject(), QAbstractState::parentState(), QShortcut::parentWidget(), QAction::parentWidget(), QWidget::parentWidget(), QNlaThread::parseBlob(), QNlaThread::parseQuerySet(), QCompleter::pathFromIndex(), QMacStyle::pixelMetric(), QWindowsXPStyle::polish(), QPlastiqueStyle::polish(), QDBusAdaptorConnector::polish(), QToolButtonPrivate::popupTimerDone(), QTreeWidgetItemIteratorPrivate::previous(), QThread::priority(), QAction::QAction(), QBoxLayout::QBoxLayout(), QColorShower::QColorShower(), QComboBox::QComboBox(), QCopChannel::QCopChannel(), qDBusFindAdaptorConnector(), qDBusNewConnection(), QDeclarativeBoundSignalParameters::QDeclarativeBoundSignalParameters(), QDeclarativeDebugClient::QDeclarativeDebugClient(), QDeclarativeKeysAttached::QDeclarativeKeysAttached(), QDeclarativeListModel::QDeclarativeListModel(), QDefaultItemEditorFactory::QDefaultItemEditorFactory(), QDial::QDial(), QDialog::QDialog(), QExceptionNotifier::QExceptionNotifier(), QFrame::QFrame(), QFtp::QFtp(), QGLOverlayWidget::QGLOverlayWidget(), QGridLayout::QGridLayout(), QHttpNetworkConnection::QHttpNetworkConnection(), QLabel::QLabel(), QLineEdit::QLineEdit(), QMainWindow::QMainWindow(), QMenuBar::QMenuBar(), QMessageBoxPrivate::QMessageBoxPrivate(), QAxObject::qObject(), QAxWidget::qObject(), QObject(), QReadNotifier::QReadNotifier(), QScrollBar::QScrollBar(), QSignalMapper::QSignalMapper(), QSizeGrip::QSizeGrip(), QSlider::QSlider(), qSmartSpacing(), QSocketNotifier::QSocketNotifier(), QSound::QSound(), QSpinBox::QSpinBox(), QSplitterHandle::QSplitterHandle(), QSignalEventGenerator::qt_metacall(), QTabWidget::QTabWidget(), QTextBrowser::QTextBrowser(), QTextEdit::QTextEdit(), QTimer::QTimer(), QToolBar::QToolBar(), QToolBarLayout::QToolBarLayout(), QToolButton::QToolButton(), QTranslator::QTranslator(), QTreeModel::QTreeModel(), QTreeWidgetItemIterator::QTreeWidgetItemIterator(), QAbstractButtonPrivate::queryButtonList(), QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(), QValidator::QValidator(), QWhatsThis::QWhatsThis(), QWidget::QWidget(), QWorkspace::QWorkspace(), QWriteNotifier::QWriteNotifier(), QWSServer::QWSServer(), QSplitterPrivate::recalc(), QAccessibleWidget::relationTo(), QDBusAdaptorConnector::relay(), QDBusAdaptorConnector::relaySlot(), QDirModel::remove(), QFileSystemModelPrivate::removeNode(), QFileSystemModelPrivate::removeVisibleFile(), QTextDocumentWithImageResources::requestFinished(), QMdiSubWindow::resizeEvent(), QExpandingLineEdit::resizeToContents(), QBBScreen::resizeWindows(), QDirModel::rmdir(), QAbstractItemView::rowsAboutToBeRemoved(), QCompletionEngine::saveInCache(), QTreeView::scrollTo(), QTreeViewPrivate::select(), QColumnView::selectAll(), QItemSelectionModel::selectedColumns(), QItemSelectionModel::selectedRows(), QPrintDialogPrivate::selectPrinter(), QInputContext::sendEvent(), QDBusContextPrivate::set(), QGraphicsScene::setActiveWindow(), QDBusAbstractAdaptor::setAutoRelaySignals(), QPrintPropertiesDialog::setCups(), QStackedLayout::setCurrentIndex(), QFileSystemModel::setData(), QTableModel::setData(), QAction::setFont(), QTableModel::setHorizontalHeaderItem(), QAbstractButton::setIconSize(), QTableModel::setItem(), QTableModel::setItemData(), QWidget::setLayout(), QPageSetupWidget::setRightMargin(), QApplication::setStyle(), QMdiSubWindow::setSystemMenu(), QTableModel::setVerticalHeaderItem(), QGraphicsProxyWidgetPrivate::setWidget_helper(), QMessageBox::setWindowModality(), QMdiSubWindow::showEvent(), QWidget::showFullScreen(), QWidget::showMaximized(), QWidget::showMinimized(), QWidget::showNormal(), QMdiSubWindow::showShaded(), QAbstractItemModel::sibling(), QMacStyle::sizeFromContents(), QStateMachinePrivate::stateEntryLessThan(), QStateMachinePrivate::stateExitLessThan(), QListModel::supportedDropActions(), QTableModel::supportedDropActions(), QTableModel::tableIndex(), QBoxLayout::takeAt(), QFormLayout::takeAt(), QGridLayoutPrivate::takeAt(), QWidget::testAttribute(), QPlastiqueStyle::unpolish(), QLayout::update(), QDeclarativeCompiledBindingsPrivate::Binding::update(), QAbstractItemViewPrivate::updateEditorData(), QMenuBarPrivate::updateGeometries(), QWidgetPrivate::updateGeometry_helper(), QDeclarativeGradientStop::updateGradient(), QStyleSheetStyle::updateStyleSheetFont(), QTreeModel::view(), QMdiArea::viewportEvent(), QHeaderViewPrivate::viewSectionSizeHint(), QListView::visualRegionForSelection(), QTreeView::visualRegionForSelection(), QAxScriptSite::window(), QX11EmbedWidgetPrivate::xEmbedWidget(), ObjectData::~ObjectData(), QApplication::~QApplication(), QComboBoxPrivate::~QComboBoxPrivate(), QDeclarativeConnections::~QDeclarativeConnections(), QDeclarativePackageAttached::~QDeclarativePackageAttached(), QScript::QObjectDelegate::~QObjectDelegate(), QObjectPrivate::~QObjectPrivate(), and QPPDOptionsEditor::~QPPDOptionsEditor().
QVariant QObject::property | ( | const char * | name | ) | const |
Returns the value of the object's name property.
If no such property exists, the returned variant is invalid.
Information about all available properties is provided through the metaObject() and dynamicPropertyNames().
Definition at line 3807 of file qobject.cpp.
Referenced by QNetworkManagerInterfaceDeviceWireless::activeAccessPoint(), QNetworkManagerInterface::activeConnections(), QSocks5SocketEngine::bind(), QNetworkManagerInterfaceDeviceWireless::bitrate(), QNetworkManagerInterfaceDeviceWired::carrier(), ShaderEffectItem::changeSource(), QX11Data::clipboardWaitForEvent(), QDataWidgetMapperPrivate::commit(), QDeclarativeCompiledBindings::configBinding(), QNetworkManagerConnectionActive::connection(), QFtpDTP::connectToHost(), QFtpPI::connectToHost(), QDeclarativeContext::contextProperty(), QAccessibleAbstractSpinBox::currentValue(), QNetworkManagerConnectionActive::defaultRoute(), QDeclarativeAction::deleteFromBinding(), QNetworkManagerConnectionActive::devices(), QNetworkManagerInterfaceDevice::deviceType(), QNetworkManagerIp4Config::domains(), QWindowsVistaStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), QWindowsVistaStyle::drawPrimitive(), QWizard::field(), QDeclarativeCompiledBindingsPrivate::findproperty(), QNetworkManagerInterfaceAccessPoint::flags(), QNetworkManagerInterfaceAccessPoint::frequency(), QXlibClipboard::getDataInFormat(), QOfonoManagerInterface::getProperty(), QConnmanManagerInterface::getProperty(), QOfonoModemInterface::getProperty(), QOfonoNetworkRegistrationInterface::getProperty(), QOfonoNetworkOperatorInterface::getProperty(), QOfonoSimInterface::getProperty(), QOfonoDataConnectionManagerInterface::getProperty(), QOfonoPrimaryDataContextInterface::getProperty(), QOfonoSmsInterface::getProperty(), QApplicationPrivate::globalEventProcessor(), QNetworkManagerInterfaceAccessPoint::hwAddress(), QNetworkManagerInterfaceDeviceWired::hwAddress(), QNetworkManagerInterfaceDeviceWireless::hwAddress(), QWizardPrivate::init(), QHttpSocketEngine::initialize(), QDeclarativeVisualDataModelDataMetaObject::initialValue(), QDBusAbstractInterface::internalPropGet(), QAxServerBase::Invoke(), QNetworkManagerInterfaceDevice::ip4Address(), QNetworkManagerInterfaceDevice::ip4config(), QWizardPage::isComplete(), QAxServerBase::isPropertyExposed(), QInputDialogSpinBox::keyPressEvent(), QInputDialogDoubleSpinBox::keyPressEvent(), QTcpServer::listen(), QAxServerBase::Load(), QHostInfo::lookupHost(), QNetworkManagerInterfaceAccessPoint::maxBitrate(), QAccessibleAbstractSpinBox::maximumValue(), QDeclarativeEngineDebugService::messageReceived(), QJSDebugService::messageReceived(), QAccessibleAbstractSpinBox::minimumValue(), QNetworkManagerInterfaceAccessPoint::mode(), QNetworkManagerInterfaceDeviceWireless::mode(), QNetworkManagerInterfaceDevice::networkInterface(), QAxEventSink::OnChanged(), QNetworkAccessFtpBackend::open(), parentWidget(), QNetworkAccessHttpBackend::postRequest(), QTextControlPrivate::rectForPosition(), QStateMachinePrivate::registerRestorable(), QTextEditPrivate::relayoutDocument(), QDeclarativeEngineDebugService::resetBinding(), QTextEdit::resizeEvent(), QNetworkManagerInterfaceAccessPoint::rsnFlags(), QAxServerBase::Save(), send_targets_selection(), QWSServer::sendIMQuery(), QWSClient::sendPropertyNotifyEvent(), QWSClient::sendPropertyReplyEvent(), QNetworkManagerConnectionActive::serviceName(), QDeclarativeEngineDebugService::setBinding(), QStyledItemDelegate::setEditorData(), QItemDelegate::setEditorData(), QDeclarativeKeyNavigationAttached::setFocusNavigation(), QStyleSheetStyle::setGeometry(), QStyledItemDelegate::setModelData(), QItemDelegate::setModelData(), QStyleSheetStyle::setPalette(), QStyleSheetStyle::setProperties(), QTcpServer::setSocketDescriptor(), QAbstractSocket::setSocketDescriptor(), QDeclarativeBehavior::setTarget(), QFtpDTP::setupListener(), QHttpSocketEngine::slotSocketConnected(), QNetworkManagerConnectionActive::specificObject(), QNetworkManagerInterfaceDeviceWired::speed(), QNetworkManagerInterfaceAccessPoint::ssid(), QNetworkManagerInterface::state(), QNetworkManagerInterfaceDevice::state(), QNetworkManagerConnectionActive::state(), QNetworkManagerInterfaceAccessPoint::strength(), QDeclarativeVisualDataModel::stringValue(), QMacStylePrivate::timerEvent(), QNetworkManagerInterfaceDevice::udi(), QStyleSheetStyle::unsetPalette(), ShaderEffectItem::updateEffectState(), QDeclarativeQtScriptExpression::updateGuards(), ShaderEffectItem::updateProperties(), QWizardHeader::vistaDisabled(), QAbstractSocket::waitForConnected(), QNetworkManagerInterfaceDeviceWireless::wirelessCapabilities(), QNetworkManagerInterface::wirelessEnabled(), QNetworkManagerInterface::wirelessHardwareEnabled(), and QNetworkManagerInterfaceAccessPoint::wpaFlags().
|
protected |
Returns the number of receivers connected to the signal.
Since both slots and signals can be used as receivers for signals, and the same connections can be made many times, the number of receivers is the same as the number of connections made from this signal.
When calling this function, you can use the SIGNAL()
macro to pass a specific signal:
As the code snippet above illustrates, you can use this function to avoid emitting a signal that nobody listens to.
Definition at line 2406 of file qobject.cpp.
Referenced by QToolButtonPrivate::popupTimerDone(), and qt_mac_watchingAboutToShow().
|
static |
Definition at line 3989 of file qobject.cpp.
void QObject::removeEventFilter | ( | QObject * | obj | ) |
Removes an event filter object obj from this object.
The request is ignored if such an event filter has not been installed.
All event filters for this object are automatically removed when this object is destroyed.
It is always safe to remove an event filter, even during event filter activation (i.e. from the eventFilter() function).
Definition at line 2099 of file qobject.cpp.
Referenced by QDataWidgetMapper::clearMapping(), QAbstractItemView::closeEditor(), QAbstractItemView::commitData(), QMdiAreaPrivate::disconnectSubWindow(), QScrollArea::event(), QDataWidgetMapperPrivate::flipEventFilters(), QMenuBarPrivate::handleReparent(), QAbstractItemViewPrivate::releaseEditor(), QMdiSubWindowPrivate::removeBaseWidget(), QMdiSubWindowPrivate::removeButtonsFromMenuBar(), QDataWidgetMapper::removeMapping(), QWorkspaceChild::setActive(), QComboBoxPrivateContainer::setItemView(), QCalendarWidgetPrivate::setNavigatorEnabled(), QFocusFrame::setWidget(), QGraphicsProxyWidgetPrivate::setWidget_helper(), QAxServerBase::UIDeactivate(), QWindowsStyle::unpolish(), QMotifStyle::unpolish(), QPlastiqueStyle::unpolish(), QSizeGripPrivate::updateTopLevelWidget(), QWSEmbedWidgetPrivate::updateWindow(), and QBBInputContext::~QBBInputContext().
|
protected |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0.
The pointer is valid only during the execution of the slot that calls this function from this object's thread context.
The pointer returned by this function becomes invalid if the sender is destroyed, or if the slot is disconnected from the sender's signal.
Definition at line 2327 of file qobject.cpp.
Referenced by QApplicationPrivate::_q_alertTimeOut(), QWSServerPrivate::_q_clientClosed(), QTabBarPrivate::_q_closeTab(), QWSServerPrivate::_q_doClient(), QWizardPrivate::_q_emitCustomButtonClicked(), QColumnViewPrivate::_q_gripMoved(), QDialogButtonBoxPrivate::_q_handleButtonDestroyed(), QTabBarPrivate::_q_scrollTabs(), QMetaObject::activate(), QScript::QObjectConnectionManager::addSignalHandler(), QWidgetAnimator::animationFinished(), QmlJSDebugger::QmlToolBar::changeAnimationSpeed(), QMetaObjectPrivate::connect(), connect(), QmlJSDebugger::LiveSelectionTool::contextMenuElementSelected(), QMetaObjectPrivate::disconnect(), disconnect(), QVGFontEngineCleaner::fontEngineDestroyed(), QSignalMapper::map(), QUnicodeControlCharacterMenu::menuActionTriggered(), QDeclarativeDataLoader::networkReplyFinished(), QDeclarativeDataLoader::networkReplyProgress(), QDeclarativePixmapReaderThreadObject::networkRequestDone(), QNetworkManagerEngine::newConnection(), QSignalTransition::QSignalTransition(), QSignalEventGenerator::qt_metacall(), QAxServerBase::qt_metacall(), QNetworkManagerEngine::removeConnection(), QScript::QObjectConnectionManager::removeSignalHandler(), QAxScriptManager::scriptError(), QSoftKeyManager::sendKeyEvent(), QSignalTransition::setSenderObject(), QGLShaderProgram::shaderDestroyed(), QMainWindowLayout::tabChanged(), QNetworkManagerEngine::updateAccessPoint(), QNetworkConfigurationManagerPrivate::updateConfigurations(), QNetworkManagerEngine::updateConnection(), QScriptBreakpointsItemDelegate::validateInput(), and ~QObject().
|
protected |
Returns the meta-method index of the signal that called the currently executing slot, which is a member of the class returned by sender(). If called outside of a slot activated by a signal, -1 is returned.
For signals with default parameters, this function will always return the index with all parameters, regardless of which was used with connect(). For example, the signal {destroyed
(QObject *obj = 0)} will have two different indexes (with and without the parameter), but this function will always return the index with a parameter. This does not apply when overloading signals with different parameters.
Definition at line 2368 of file qobject.cpp.
void QObject::setObjectName | ( | const QString & | name | ) |
Definition at line 1112 of file qobject.cpp.
Referenced by QWorkspace::addWindow(), QX11Data::clipboardReadIncrementalProperty(), QFtpDTP::connectToHost(), QFileDialogPrivate::createMenuActions(), QCalendarWidgetPrivate::createNavigationBar(), QLineEdit::createStandardContextMenu(), QScriptDebugger::createStandardToolBar(), QFileDialogPrivate::createWidgets(), QWizardPrivate::ensureButton(), QMdiSubWindowPrivate::enterRubberBandMode(), QRadioButton::event(), QCheckBox::event(), QGLEngineSharedShaders::findProgramInCache(), QSplitterPrivate::findWidget(), QMainWindowLayout::getSeparatorWidget(), QGestureManager::getState(), QMdiAreaPrivate::highlightNextSubWindow(), QPushButtonPrivate::hitButton(), QWorkspaceChild::iconWidget(), QDockWidgetPrivate::init(), QAbstractSpinBoxPrivate::init(), QMessageBoxPrivate::init(), QTabWidgetPrivate::init(), QDateTimeEditPrivate::initCalendarPopup(), QToolBox::insertItem(), QSplitterPrivate::insertWidget(), QGroupBox::mouseReleaseEvent(), QPageSetupDialogPrivate::openCarbonPageLayout(), QPrintDialogPrivate::openCarbonPrintPanel(), QToolBoxButton::paintEvent(), QAuBucketQWS::QAuBucketQWS(), QAuServerNAS::QAuServerNAS(), QAuServerQWS::QAuServerQWS(), qax_create_object_wrapper(), QAxHostWidget::QAxHostWidget(), QAxScriptEngine::QAxScriptEngine(), QBoxLayout::QBoxLayout(), QCleanlooksStyle::QCleanlooksStyle(), QComboBox::QComboBox(), QCopChannel::QCopChannel(), QDesktopWidget::QDesktopWidget(), QDial::QDial(), QDialog::QDialog(), QDoubleValidator::QDoubleValidator(), QFrame::QFrame(), QFtp::QFtp(), QFtpDTP::QFtpDTP(), QFtpPI::QFtpPI(), QGridLayout::QGridLayout(), QHBoxLayout::QHBoxLayout(), QIntValidator::QIntValidator(), QLabel::QLabel(), QLineEdit::QLineEdit(), QLinuxInputKeyboardHandler::QLinuxInputKeyboardHandler(), QLinuxInputMouseHandler::QLinuxInputMouseHandler(), QMainWindow::QMainWindow(), QMainWindowLayout::QMainWindowLayout(), QMDIControl::QMDIControl(), QMenuBar::QMenuBar(), QMenuBarExtension::QMenuBarExtension(), QObject(), QPlastiqueStyle::QPlastiqueStyle(), QRegExpValidator::QRegExpValidator(), QScrollBar::QScrollBar(), QSessionManager::QSessionManager(), QSignalMapper::QSignalMapper(), QSizeGrip::QSizeGrip(), QSlider::QSlider(), QSocketNotifier::QSocketNotifier(), QSound::QSound(), QSpinBox::QSpinBox(), QSpinBoxValidator::QSpinBoxValidator(), qt_tablet_init(), qt_tablet_init_wce(), QTabWidget::QTabWidget(), QTextBrowser::QTextBrowser(), QTextEdit::QTextEdit(), QTimer::QTimer(), QToolBar::QToolBar(), QToolBarExtension::QToolBarExtension(), QToolButton::QToolButton(), QTranslator::QTranslator(), QTsLibMouseHandler::QTsLibMouseHandler(), QValidator::QValidator(), QVBoxLayout::QVBoxLayout(), QVNCIntegration::QVNCIntegration(), QWidget::QWidget(), QWorkspace::QWorkspace(), QWSLinuxInputKbPrivate::QWSLinuxInputKbPrivate(), QWSLinuxInputMousePrivate::QWSLinuxInputMousePrivate(), QWSServer::QWSServer(), QWSTtyKbPrivate::QWSTtyKbPrivate(), QAction::setFont(), QAbstractButton::setIconSize(), QMessageBox::setInformativeText(), setupOwner(), QFtpDTP::setupSocket(), QMessageBox::setWindowModality(), QWorkspacePrivate::showMaximizeControls(), QToolTip::showText(), QScriptEngineDebugger::standardWindow(), and QThreadPoolPrivate::startThread().
void QObject::setParent | ( | QObject * | parent | ) |
Makes the object a child of parent.
Definition at line 1950 of file qobject.cpp.
Referenced by QLocalServerPrivate::_q_onNewConnection(), QToolBar::actionEvent(), QLayout::addChildLayout(), QStateMachine::addState(), QState::addTransition(), QDeclarativeWatcher::addWatch(), QDeclarativeComponentPrivate::createObject(), QGraphicsProxyWidget::createProxyForChildWidget(), QDeclarativeEnginePrivate::createQmlObject(), QNetworkAccessManager::createRequest(), QLayoutPrivate::createSpacerItem(), QNetworkDiskCache::data(), QDeclarativeItemPrivate::data_append(), QDeclarativeFlickablePrivate::data_append(), QDeclarativeFlickablePrivate::data_clear(), effectiveState(), QProxyStylePrivate::ensureBaseStyle(), QGestureManager::getState(), inherits(), QLineEditPrivate::init(), QDeclarativeVisualDataModelPartsMetaObject::initialValue(), QAnimationGroup::insertAnimation(), QNetworkReplyImplPrivate::migrateBackend(), QNetworkAccessFtpBackend::open(), QNetworkAccessManager::post(), QNetworkAccessHttpBackend::postRequest(), QNetworkAccessManager::put(), QAbstractAnimation::QAbstractAnimation(), QDeclarativeBinding::QDeclarativeBinding(), QHBoxLayout::QHBoxLayout(), QLayout::QLayout(), QMainWindowLayout::QMainWindowLayout(), QObject(), QProxyStyle::QProxyStyle(), QStateMachine::QStateMachine(), QVBoxLayout::QVBoxLayout(), QWizardPrivate::recreateLayout(), QStateMachine::removeState(), QState::removeTransition(), QDeclarativeItemPrivate::resources_append(), QDeclarativeItemPrivate::resources_clear(), QNetworkAccessCacheBackend::sendCacheContents(), QNetworkAccessHttpBackend::sendCacheContents(), QDeclarativeAbstractAnimation::setGroup(), QApplication::setInputContext(), QWidget::setLayout(), QDeclarativeGraphics_DerivedObject::setParent_noEvent(), QFileDialog::setProxyModel(), QApplication::setStyle(), QApplication::setStyleSheet(), QHttpThreadDelegate::startRequest(), QApplication::style(), QAnimationGroup::takeAnimation(), QBoxLayout::takeAt(), QFormLayout::takeAt(), QGridLayoutPrivate::takeAt(), QWidget::takeLayout(), QCoreFuriCuri::timerEvent(), QDeclarativePackage::~QDeclarativePackage(), and QSingleDesktopWidget::~QSingleDesktopWidget().
bool QObject::setProperty | ( | const char * | name, |
const QVariant & | value | ||
) |
Sets the value of the object's name property to value.
If the property is defined in the class using ) and;.
Dynamic properties can be queried again using property() and can be removed by setting the property value to an invalid QVariant. Changing the value of a dynamic property causes a QDynamicPropertyChangeEvent to be sent to the object.
Note: Dynamic properties starting with "_q_" are reserved for internal purposes.
Definition at line 3755 of file qobject.cpp.
Referenced by QStateMachinePrivate::_q_animationFinished(), QStateMachinePrivate::applyProperties(), QSocks5SocketEngine::bind(), QWizardPage::cleanupPage(), QStyleSheetStyle::clearWidgetFont(), QFtpDTP::connectToHost(), QFtpPI::connectToHost(), QWSDisplay::convertSelection(), QSslSocketPrivate::createPlainSocket(), QDirectFBWindowSurface::createWindow(), QWindowsVistaStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), QWindowsVistaStyle::drawPrimitive(), QHttpNetworkConnectionChannel::ensureConnection(), QHttpNetworkConnectionChannel::init(), QSocks5SocketEnginePrivate::initialize(), QAbstractSocketPrivate::initSocketLayer(), QDBusAbstractInterface::internalPropSet(), QInputDialogSpinBox::keyPressEvent(), QInputDialogDoubleSpinBox::keyPressEvent(), QScriptEngine::newFunction(), QNetworkAccessFtpBackend::open(), QTipLabel::placeTip(), QDataWidgetMapperPrivate::populate(), QStyleSheetStyle::saveWidgetFont(), QAccessibleAbstractSpinBox::setCurrentValue(), QStyledItemDelegate::setEditorData(), QItemDelegate::setEditorData(), QWizard::setField(), QDirectFBWindowSurface::setGeometry(), QStyleSheetStyle::setGeometry(), QStyleSheetStyle::setProperties(), QFtpDTP::setupListener(), QNetworkAccessBackend::start(), QTipLabel::styleSheetParentDestroyed(), QStyleSheetStyle::unpolish(), and QPropertyAnimationPrivate::updateProperty().
void QObject::setUserData | ( | uint | id, |
QObjectUserData * | data | ||
) |
Definition at line 4003 of file qobject.cpp.
Referenced by QTextBlock::operator<().
|
inline |
Returns true if signals are blocked; otherwise returns false.
Signals are not blocked by default.
Definition at line 148 of file qobject.h.
Referenced by QTreeModel::emitDataChanged(), QAxEventSink::Invoke(), QAxEventSink::OnChanged(), QTreeModel::removeRows(), QColSpinBox::setValue(), and QBuffer::writeData().
int QObject::startTimer | ( | int | interval | ) |
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer.
A timer event will occur every interval milliseconds until killTimer() is called. If interval is 0, then the timer event occurs once every time there are no more window system events to process.
The virtual timerEvent() function is called with the QTimerEvent event parameter class when a timer event occurs. Reimplement this function to get timer events.
If multiple timers are running, the QTimerEvent::timerId() can be used to find out which timer was activated.
Example:
Note that QTimer's accuracy depends on the underlying operating system and hardware. Most platforms support an accuracy of 20 milliseconds; some provide more. If Qt is unable to deliver the requested number of timer events, it will silently discard some.
The QTimer class provides a high-level programming interface with single-shot timers and timer signals instead of events. There is also a QBasicTimer class that is more lightweight than QTimer and less clumsy than using timer IDs directly.
Definition at line 1623 of file qobject.cpp.
Referenced by QBalloonTip::balloon(), QUnixSocket::close(), QTableView::columnResized(), QTreeView::columnResized(), QX11Data::dndEnable(), QComboBoxPrivateScroller::enterEvent(), QTestEventLoop::enterLoop(), QPlastiqueStyle::eventFilter(), QMotifStyle::eventFilter(), QAxHostWidget::focusInEvent(), QClipboardWatcher::getDataInFormat(), QFontCache::increaseCost(), QPMCache::insert(), QGLBlurTextureCache::insertBlurTextureInfo(), QLineControl::internalInsert(), QMenu::mouseMoveEvent(), QStateMachine::postDelayedEvent(), QLineControl::processKeyEvent(), QLineControl::processMouseEvent(), QClipboardINCRTransaction::QClipboardINCRTransaction(), QCoreFuriCuri::QCoreFuriCuri(), qDBusRealAddTimeout(), QSingleShotTimer::QSingleShotTimer(), qt_check_clipboard_sentinel(), qt_check_selection_sentinel(), QTapAndHoldGestureRecognizer::recognize(), QPMCache::replace(), QLineControl::resetCursorBlinkTimer(), QMdiSubWindow::resizeEvent(), restartXdndDropExpiryTimer(), QTimeLine::resume(), QTableView::rowResized(), QLineControl::setCursorBlinkPeriod(), QTimer::setInterval(), QTimeLine::setPaused(), QBasicTimer::start(), QMacAnimateCursor::start(), QTimer::start(), QTimeLine::start(), QWindowsStylePrivate::startAnimation(), QMacStylePrivate::startAnimationTimer(), QAbstractSpinBox::timerEvent(), QCoreFuriCuri::timerEvent(), QPMCache::timerEvent(), QFontCache::timerEvent(), QDeclarativePixmapStore::unreferencePixmap(), and QClipboardINCRTransaction::x11Event().
QThread * QObject::thread | ( | ) | const |
Returns the thread in which the object lives.
Definition at line 1419 of file qobject.cpp.
Referenced by QDBusConnectionPrivate::activateCall(), QEventDispatcherUNIX::activateTimers(), QWindowsFileSystemWatcherEngine::addPaths(), QDBusAbstractInterface::callWithArgumentList(), QCoreApplicationPrivate::checkReceiverThread(), QDBusConnectionPrivate::checkThread(), QNetworkConfigurationManagerPrivate::cleanup(), QDBusConnectionPrivate::deleteYourself(), QDBusConnectionPrivate::deliverCall(), QNetworkSession::disconnectNotify(), QEventLoop::exec(), QDBusConnectionPrivate::handleObjectCall(), QDeclarativeEnginePrivate::init(), QGLSignalProxy::instance(), QMetaMethod::invoke(), QRawFontPrivate::isValid(), QBBScreen::newWindowCreated(), operator<<(), QScriptDebuggerBackendPrivate::postEvent(), QNetworkAccessHttpBackend::postRequest(), QStateMachinePrivate::processEvents(), qDBusAddTimeout(), qDBusAddWatch(), QDBusDefaultConnection::QDBusDefaultConnection(), qDBusIntrospectObject(), qDBusPropertyGet(), qDBusPropertyGetAll(), qDBusPropertySet(), qDBusRemoveTimeout(), qDBusRemoveWatch(), qDBusToggleWatch(), QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(), QObject(), QSocks5BindStore::QSocks5BindStore(), QWaylandScreen::QWaylandScreen(), QEventDispatcherWin32::registerEventNotifier(), QEventDispatcherGlib::registerSocketNotifier(), QEventDispatcherWin32::registerSocketNotifier(), QEventDispatcherMac::registerSocketNotifier(), QEventDispatcherUNIX::registerSocketNotifier(), QEventDispatcherGlib::registerTimer(), QEventDispatcherWin32::registerTimer(), QEventDispatcherMac::registerTimer(), QEventDispatcherUNIX::registerTimer(), QDBusAdaptorConnector::relaySlot(), QWindowsFileSystemWatcherEngine::removePaths(), QSocks5BindStore::retrieve(), QDBusConnectionPrivate::sendWithReplyAsync(), QNetworkAccessManager::setCookieJar(), QEventDispatcherUNIX::setSocketNotifierPending(), QWindowsFileSystemWatcherEngine::stop(), thread(), QEventDispatcherWin32::unregisterEventNotifier(), QEventDispatcherGlib::unregisterSocketNotifier(), QEventDispatcherWin32::unregisterSocketNotifier(), QEventDispatcherMac::unregisterSocketNotifier(), QEventDispatcherUNIX::unregisterSocketNotifier(), QEventDispatcherGlib::unregisterTimer(), QEventDispatcherWin32::unregisterTimer(), QEventDispatcherUNIX::unregisterTimer(), QEventDispatcherGlib::unregisterTimers(), QEventDispatcherWin32::unregisterTimers(), QEventDispatcherMac::unregisterTimers(), QEventDispatcherUNIX::unregisterTimers(), QBBScreen::windowClosed(), QDBusConnectionPrivate::~QDBusConnectionPrivate(), and QWindowsFileSystemWatcherEngine::~QWindowsFileSystemWatcherEngine().
|
protectedvirtual |
This event handler can be reimplemented in a subclass to receive timer events for the object.
QTimer provides a higher-level interface to the timer functionality, and also more general information about timers. The timer event is passed in the event parameter.
Reimplemented in QUnixSocketPrivate, QWSSoundServerPrivate, QDeclarativePixmapStore, QLineControl, QAbstractItemView, QSocks5BindStore, QWSServer, QGLBlurTextureCache, QSingleShotTimer, QTextEdit, QFontCache, QTextControl, QDBusConnectionPrivate, QComboBoxPrivateContainer, QPlainTextEdit, QDragManager, QMacStylePrivate, QDeclarativeMouseArea, QUnifiedTimer, QPMCache, QDeclarativeFlickable, QTreeView, QScriptDebugger, QMenu, QMainWindowLayout, QComboBoxPrivateScroller, QCoreFuriCuri, QListView, QMdiArea, QTableView, QAbstractSpinBox, QFileSystemModel, QAbstractSlider, QTreeModel, QTipLabel, QAbstractButton, QMenuBar, QTimeLine, QCoeFepInputContext, QDefaultAnimationDriver, QMdiSubWindow, QToolButton, QBalloonTip, QMotifStyle, QTextDocumentLayout, QNetworkAccessCache, QDeclarativeView, QPlastiqueStyle, QWindowsStyle, QTimer, QMacAnimateCursor, QTestEventLoop, and QCalendarTextNavigator.
Definition at line 1294 of file qobject.cpp.
Referenced by event(), QTextDocumentLayout::timerEvent(), QBalloonTip::timerEvent(), QMenuBar::timerEvent(), QTreeModel::timerEvent(), QAbstractSpinBox::timerEvent(), QMainWindowLayout::timerEvent(), QScriptDebugger::timerEvent(), QWSServer::timerEvent(), QTextControl::toHtml(), and QPlainTextEdit::toPlainText().
|
static |
Returns a translated version of sourceText, optionally based on a disambiguation string and value of n for strings containing plurals; otherwise returns sourceText itself if no appropriate translated string is available.
Example:
...
If the same sourceText is used in different roles within the same context, an additional identifying string may be passed in disambiguation (0 by default). In Qt 4.4 and earlier, this was the preferred way to pass comments to translators.
Example:
...
See Writing Source Code for Translation for a detailed description of Qt's translation mechanisms in general, and the Writing Source Code for Translation::Disambiguation{Disambiguation} section for information on disambiguation.
Referenced by QAbstractSocketPrivate::_q_abortConnectionAttempt(), QUnixPrintWidgetPrivate::_q_btnBrowseClicked(), QProcessPrivate::_q_canReadStandardError(), QProcessPrivate::_q_canReadStandardOutput(), QProcessPrivate::_q_canWrite(), QPrintDialogPrivate::_q_collapseOrExpandDialog(), QAbstractSocketPrivate::_q_connectToNextAddress(), QFileDialogPrivate::_q_createDirectory(), QFileDialogPrivate::_q_deleteCurrent(), QFileDialogPrivate::_q_goToDirectory(), QScriptDebuggerPrivate::_q_goToLine(), QPrintDialogPrivate::_q_okClicked(), QUnixPrintWidgetPrivate::_q_printerChanged(), QProcessPrivate::_q_processDied(), QDeclarativeLoaderPrivate::_q_sourceLoaded(), QAbstractSocketPrivate::_q_startConnecting(), QWorkspacePrivate::_q_updateActions(), QFileDialogPrivate::_q_updateOkButton(), QNetworkReplyImpl::abort(), QHttp::abort(), QMessageBox::aboutQt(), QAccessibleButton::actionText(), QAccessibleMenu::actionText(), QAccessibleMenuBar::actionText(), QAccessibleToolButton::actionText(), QAccessibleMenuItem::actionText(), QAccessibleApplication::actionText(), QAccessibleTabBar::actionText(), QAccessibleComboBox::actionText(), QAccessibleTitleBar::actionText(), QPrintPropertiesDialog::addItemToOptions(), addKey(), QDeclarativeListModel::append(), QDeclarativeXmlListModelPrivate::append_role(), QSharedMemoryPrivate::attach(), QSQLiteDriver::beginTransaction(), QSQLite2Driver::beginTransaction(), QMYSQLDriver::beginTransaction(), QPSQLDriver::beginTransaction(), QODBCDriver::beginTransaction(), buttonDefaultText(), QMessageBox::buttonText(), QDeclarativeAnchorsPrivate::centerInChanged(), QUnixPrintWidgetPrivate::checkFields(), QDeclarativeAnchorsPrivate::checkHAnchorValid(), QDeclarativeAnchorsPrivate::checkHValid(), AVMediaObject::checkPlayer(), QDeclarativeAnchorsPrivate::checkVAnchorValid(), QDeclarativeAnchorsPrivate::checkVValid(), QScriptDebugger::clearConsoleAction(), QScriptDebugger::clearDebugOutputAction(), QScriptDebugger::clearErrorLogAction(), QNetworkReplyImpl::close(), QSQLiteDriver::close(), CloseButton::CloseButton(), QDB2Driver::commitTransaction(), QSQLiteDriver::commitTransaction(), QSQLite2Driver::commitTransaction(), QMYSQLDriver::commitTransaction(), QPSQLDriver::commitTransaction(), QODBCDriver::commitTransaction(), QDeclarativeGestureAreaParser::compile(), QDeclarativeConnectionsParser::compile(), QDeclarativeListModelParser::compile(), QDeclarativePropertyChangesParser::compileList(), QDeclarativeListModelParser::compileProperty(), QDeclarativeConnections::connectSignals(), QAbstractSocket::connectToHostImplementation(), QScrollBar::contextMenuEvent(), QDialog::contextMenuEvent(), QAbstractSpinBox::contextMenuEvent(), QScriptDebugger::continueAction(), QFile::copy(), QSharedMemory::create(), QSharedMemoryPrivate::create(), QDialogButtonBoxPrivate::createButton(), QProcessPrivate::createChannel(), QmlJSDebugger::LiveSelectionTool::createContextMenu(), QDeclarativeTextInput::createCursor(), QDeclarativeComponent::createObject(), QDeclarativeAbstractAnimationPrivate::createProperty(), QUndoGroup::createRedoAction(), QUndoStack::createRedoAction(), QTextControl::createStandardContextMenu(), QLineEdit::createStandardContextMenu(), QScriptDebugger::createStandardMenu(), QMdiSubWindowPrivate::createSystemMenu(), QUndoGroup::createUndoAction(), QUndoStack::createUndoAction(), QMessageBox::critical(), QKeySequencePrivate::decodeString(), QDeclarativeItemModule::defineModule(), QDeclarativeUtilModule::defineModule(), QDeclarativeItemModule::defineModuleCompat(), QDeclarativeUtilModule::defineModuleCompat(), QMultiInputContextPlugin::description(), QInputContextFactory::description(), QLocalSocketPrivate::destroyPipeHandles(), QSharedMemoryPrivate::detach(), QMultiInputContextPlugin::displayName(), QInputContextFactory::displayName(), QDeclarativeParentChangePrivate::doChange(), QUdpSocketPrivate::doEnsureInitialized(), QDeclarativeTypeData::done(), QMotifStyle::drawComplexControl(), QCommonStyle::drawControl(), QMotifStyle::drawControl(), QFtpPI::dtpConnectState(), QKeySequencePrivate::encodeString(), QODBCDriver::endTrans(), QInputDialogPrivate::ensureLayout(), QFtpPI::error(), QPluginLoader::errorString(), QLibrary::errorString(), QNetworkSession::errorString(), QSslError::errorString(), QIODevice::errorString(), QNetworkSessionPrivateImpl::errorString(), QMDIControl::event(), QWorkspace::eventFilter(), QDialog::exec(), QScriptEdit::extraAreaMouseEvent(), QDeclarativeAnchorsPrivate::fillChanged(), QScriptDebugger::findInScriptAction(), QScriptDebugger::findNextInScriptAction(), QScriptDebugger::findPreviousInScriptAction(), QNetworkReplyImplPrivate::finished(), QNetworkSessionManagerPrivate::forceSessionClose(), QHostInfoAgent::fromName(), QNetworkAccessFtpBackend::ftpDone(), QDateTimeEditPrivate::getAmPmText(), getFullPath(), QScriptDebugger::goToLineAction(), QSystemSemaphorePrivate::handle(), QSharedMemoryPrivate::handle(), QDirModel::headerData(), QFileSystemModel::headerData(), QBBInputContext::identifierName(), QColorDialogPrivate::init(), QFontDialogPrivate::init(), QLocalSocketPrivate::init(), QPrintPreviewDialogPrivate::init(), QWorkspacePrivate::init(), QSharedMemoryPrivate::initKey(), QAbstractSocketPrivate::initSocketLayer(), QSslSocketBackendPrivate::initSslContext(), QDeclarativeListModel::insert(), QScriptDebugger::interruptAction(), QLibraryPrivate::isPlugin(), QDeclarativeVisualDataModel::item(), jump(), DetailButton::label(), QTcpServer::listen(), QLocalServer::listen(), QLibraryPrivate::load_sys(), QDeclarativeComponent::loadUrl(), QAccessibleGroupBox::localizedName(), QSharedMemory::lock(), QGraphicsView::mapFromScene(), QGraphicsView::mapToScene(), QGraphicsViewPrivate::mapToScene(), QDeclarativeListModel::move(), QFileSystemModelPrivate::myComputer(), QNetworkAccessFtpBackend::open(), QSQLite2Driver::open(), QSQLiteDriver::open(), QOCIDriver::open(), QTDSDriver::open(), QDB2Driver::open(), QMYSQLDriver::open(), QPSQLDriver::open(), QODBCDriver::open(), QPrintDialogPrivate::openWindowsPrintDialogModally(), QProcessPrivate::pipeWriterBytesToWrite(), AVMediaObject::play(), populatePaperSizes(), QNetworkAccessHttpBackend::postRequest(), QFtpPI::processReply(), QDeclarativePropertyChangesPrivate::property(), QBooleanComboBox::QBooleanComboBox(), QDeclarativeLayoutMirroringAttached::QDeclarativeLayoutMirroringAttached(), qExtractSecurityPolicyFromString(), QFtp::QFtp(), qmlsqldatabase_change_version(), qmlsqldatabase_executeSql_outsidetransaction(), qmlsqldatabase_executeSql_readonly(), qmlsqldatabase_open_sync(), qmlsqldatabase_transaction_shared(), QmlJSDebugger::QmlToolBar::QmlToolBar(), QMultiInputContext::QMultiInputContext(), QOCIDriver::QOCIDriver(), QPageSetupWidget::QPageSetupWidget(), QScriptBreakpointsWidget::QScriptBreakpointsWidget(), QScriptDebuggerCodeFinderWidget::QScriptDebuggerCodeFinderWidget(), QScriptNewBreakpointWidget::QScriptNewBreakpointWidget(), qt_create_commandline(), qt_create_pipe(), qt_detectRTLLanguage(), qt_getLprPrinters(), qt_mac_make_filters_list(), qt_mac_menu_merge_action(), qt_mac_menu_merge_text(), qt_parse_pattern(), qt_parseEtcLpMember(), qt_parsePrinterDesc(), qt_parsePrintersConf(), qt_perhapsAddPrinter(), qt_setWindowTitle_helperHelper(), qt_terminateApp(), qt_win_make_filters_list(), QTgaFile::QTgaFile(), QDeclarativeXmlListModel::queryError(), QUndoModel::QUndoModel(), QUnicodeControlCharacterMenu::QUnicodeControlCharacterMenu(), QDeclarativeListModel::remove(), QFile::rename(), QLibraryPrivate::resolve_sys(), QDeclarativeTypeData::resolveTypes(), QColorDialogPrivate::retranslateStrings(), QProgressDialogPrivate::retranslateStrings(), QErrorMessagePrivate::retranslateStrings(), QFontDialogPrivate::retranslateStrings(), QFileDialogPrivate::retranslateStrings(), QDialogButtonBoxPrivate::retranslateStrings(), QColorShower::retranslateStrings(), QFileDialogPrivate::retranslateWindowTitle(), QDB2Driver::rollbackTransaction(), QSQLiteDriver::rollbackTransaction(), QSQLite2Driver::rollbackTransaction(), QMYSQLDriver::rollbackTransaction(), QPSQLDriver::rollbackTransaction(), QODBCDriver::rollbackTransaction(), QScriptDebugger::runToCursorAction(), QScriptDebugger::runToNewScriptAction(), QFtpPI::sendCommands(), QDeclarativeListModel::set(), QDeclarativeBehavior::setAnimation(), QDB2Driver::setAutoCommit(), QDeclarativeFlipable::setBack(), QDeclarativeAnchors::setCenterIn(), QFileSystemModel::setData(), QDeclarativePauseAnimation::setDuration(), QDeclarativePropertyAnimation::setDuration(), QDeclarativeAnchorAnimation::setDuration(), QLocalServerPrivate::setError(), QStateMachinePrivate::setError(), QNativeSocketEnginePrivate::setError(), QSocks5SocketEnginePrivate::setErrorState(), QLocalSocketPrivate::setErrorString(), QSharedMemoryPrivate::setErrorString(), QPluginLoader::setFileName(), QDeclarativeAnchors::setFill(), QDeclarativeFlipable::setFront(), QFileDialog::setNameFilters(), QMdiSubWindowPrivate::setNewWindowTitle(), QDeclarativeListModel::setProperty(), QTcpServer::setSocketDescriptor(), QAbstractSocket::setSocketDescriptor(), AVMediaObject::setSource(), QPrintDialogPrivate::setupOptions(), QPrintDialogPrivate::setupPaper(), QSidebar::showContextMenu(), QWorkspacePrivate::showMaximizeControls(), QMessageBoxPrivate::showOldMessageBox(), QFileDialogComboBox::showPopup(), showToolTip(), QDirModelPrivate::size(), QFileSystemModelPrivate::size(), QHttpSocketEngine::slotSocketError(), QHttpSocketEngine::slotSocketReadNotification(), QSoftKeyManager::standardSoftKeyText(), QScriptEngineDebugger::standardWindow(), QProcess::start(), QDeclarativeTextInputPrivate::startCreatingCursor(), QSslSocketBackendPrivate::startHandshake(), QProcessPrivate::startProcess(), QScriptDebugger::stepIntoAction(), QScriptDebugger::stepOutAction(), QScriptDebugger::stepOverAction(), QCommonStyle::subElementRect(), QMotifStyle::subElementRect(), QPSQLDriver::subscribeToNotificationImplementation(), QCommonStylePrivate::tabLayout(), tabTextFor(), QAccessibleAbstractSpinBox::text(), QAccessibleDoubleSpinBox::text(), QAccessibleScrollBar::text(), QAccessibleSlider::text(), QAccessibleDial::text(), QAccessibleTabBar::text(), QAccessibleComboBox::text(), QScriptDebugger::toggleBreakpointAction(), QmlJSDebugger::ToolBarColorBox::ToolBarColorBox(), QDeclarativeParentAnimation::transition(), translateWSAError(), QSslSocketBackendPrivate::transmit(), QSharedMemoryPrivate::tryLocker(), QPluginLoader::unload(), QLibraryPrivate::unload_sys(), QSharedMemory::unlock(), QFile::unmap(), QPSQLDriver::unsubscribeFromNotificationImplementation(), QDeclarativeBinding::update(), QDeclarativeAnchorsPrivate::updateHorizontalAnchors(), QDeclarativeAnchorsPrivate::updateVerticalAnchors(), QUnixPrintWidgetPrivate::updateWidget(), QProcessPrivate::waitForBytesWritten(), QAbstractSocket::waitForConnected(), QProcessPrivate::waitForFinished(), QProcessPrivate::waitForReadyRead(), QProcessPrivate::waitForStarted(), QAbstractSocket::writeData(), QProcess::writeData(), and QmlJSDebugger::ZoomTool::ZoomTool().
|
static |
Returns a translated version of sourceText, or QString::fromUtf8(sourceText) if there is no appropriate version. It is otherwise identical to tr(sourceText, disambiguation, n).
Note that using the Utf8 variants of the translation functions is not required if CODECFORTR
is already set to UTF-8 in the qmake project file and QTextCodec::setCodecForTr("UTF-8") is used.
QObjectUserData * QObject::userData | ( | uint | id | ) | const |
Definition at line 4016 of file qobject.cpp.
Referenced by hb_canRender(), hb_getAdvances(), hb_getFontMetric(), hb_getGlyphMetrics(), hb_getPointInOutline(), hb_stringToGlyphs(), QScriptSyntaxHighlighter::highlightBlock(), and QTextBlock::operator<().
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 328 of file qobject.h.
Referenced by QCoreApplication::QCoreApplication().
|
related |
This function is equivalent to {obj}->findChild<T>(name).
|
related |
This function is equivalent to {obj}->findChildren<T>(name).
|
related |
This function is equivalent to {obj}->findChildren<T>(regExp).
|
friend |
|
related |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns 0. If object is 0 then it will also return 0.
The class T must inherit (directly or indirectly) QObject and be declared with the Q_OBJECT macro.
A class is considered to inherit itself.
Example:
The qobject_cast() function behaves similarly to the standard C++ dynamic_cast()
, with the advantages that it doesn't require RTTI support and it works across dynamic library boundaries.
qobject_cast() can also be used in conjunction with interfaces; see the Plug & Paint example for details.
Definition at line 375 of file qobject.h.
Referenced by QMenuPrivate::_q_actionTriggered(), QToolBoxPrivate::_q_buttonClicked(), QWSServerPrivate::_q_doClient(), _q_paintItem(), QNetworkAccessManagerPrivate::_q_replyFinished(), QNetworkAccessManagerPrivate::_q_replySslErrors(), QHttpPrivate::_q_slotSendRequest(), QDeclarativeLoaderPrivate::_q_sourceLoaded(), QParallelAnimationGroupPrivate::_q_uncontrolledAnimationFinished(), QFontComboBoxPrivate::_q_updateModel(), QToolBar::actionEvent(), QWidgetPrivate::activateChildLayoutsRecursively(), QMdiArea::addSubWindow(), QMacStylePrivate::addWidget(), QPushButtonPrivate::adjustedMenuPosition(), QDeclarativeParticleMotionWander::advance(), QAbstractTextDocumentLayout::anchorAt(), QWidgetAnimator::animationFinished(), QMainWindowLayout::animationFinished(), QPlainTextEditPrivate::append(), QDeclarativeAnimationGroupPrivate::append_animation(), QDeclarativeXmlListModelPrivate::append_role(), ShaderEffectSource::attachSourceItem(), QScriptEngine::availableExtensions(), axc_FilterProc(), QPlainTextEditControl::blockBoundingRect(), QPlainTextEdit::blockBoundingRect(), QScriptBreakpointsWidget::breakpointsModel(), buddyString(), QDeclarativeContents::calcHeight(), QDeclarativeContents::calcWidth(), QPlainTextEditControl::canInsertFromMimeData(), QTextEditControl::canInsertFromMimeData(), QDeclarativeBoundSignal::cast(), QmlJSDebugger::QmlToolBar::changeAnimationSpeed(), QDockWidget::changeEvent(), QWorkspaceChild::changeEvent(), QX11EmbedWidgetPrivate::checkActivateWindow(), QToolBarLayout::checkUsePopupMenu(), QWidgetPrivate::childAt_helper(), QWidgetPrivate::childAtRecursiveHelper(), QStatePrivate::childStates(), childWidgets(), QDeclarativeAnimationGroupPrivate::clear_animation(), QDeclarativeContents::complete(), AVBackend::connectNodes(), AccessibleFactory::create(), QDeclarativeListViewPrivate::createComponentItem(), QDeclarativeTextInput::createCursor(), QScriptDebuggerLocalsItemDelegate::createEditor(), QScriptBreakpointsItemDelegate::createEditor(), QDeclarativePathViewPrivate::createHighlight(), QToolBarLayout::createItem(), QPlainTextEditControl::createMimeDataFromSelection(), QTextEditControl::createMimeDataFromSelection(), QWidgetPrivate::createRecursively(), QDeclarativeListViewPrivate::createSection(), QWidgetPrivate::createWinId(), QScriptDebuggerCodeWidget::currentView(), QDeclarativeFlickablePrivate::data_append(), defaultWidgetAction(), QGLWindowSurface::deleted(), ShaderEffectSource::detachSourceItem(), QAudioInputPrivate::deviceReady(), AVBackend::disconnectNodes(), do_dbus_call(), QWindowsVistaStyle::drawComplexControl(), QCommonStyle::drawComplexControl(), QWindowsCEStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), QMacStyle::drawControl(), QTextDocumentLayout::drawInlineObject(), QGraphicsScenePrivate::drawItemHelper(), QGraphicsScene::drawItems(), QWindowsVistaStyle::drawPrimitive(), QMacStyle::drawPrimitive(), QListModel::dropMimeData(), QTableModel::dropMimeData(), QScriptEditExtraArea::editor(), QAbstractItemView::editorDestroyed(), QHttpNetworkConnectionChannel::ensureConnection(), QIODevice::errorString(), QFontComboBox::event(), QDockWidget::event(), QLabel::event(), QToolBar::event(), QDialogButtonBox::event(), QWidget::event(), QX11EmbedWidget::eventFilter(), QStyledItemDelegate::eventFilter(), QPlastiqueStyle::eventFilter(), QItemDelegate::eventFilter(), QAxHostWidget::eventFilter(), QCompleter::eventFilter(), QMdiArea::eventFilter(), QScriptDebuggerLocalsItemDelegate::eventFilter(), QToolBarLayout::expandedSize(), QToolBarLayout::expandingDirections(), QAudioInputPrivate::feedback(), QCompletionEngine::filterHistory(), find_child(), findMenuBar(), fixToolBarOrientation(), QPushButton::focusInEvent(), QPushButton::focusOutEvent(), QAbstractTextDocumentLayout::format(), QAbstractTextDocumentLayout::formatIndex(), QAudioOutputPrivate::freeBlocks(), QGraphicsScenePrivate::gestureEventHandler(), getEngineFromId(), getImage(), QWidgetPrivate::getOpaqueChildren(), getPixmap(), QMacInputContext::globalEventProcessor(), QApplicationPrivate::globalEventProcessor(), QCalendarView::handleMouseEvent(), QWidgetPrivate::hideChildren(), QStatePrivate::historyStates(), QPlainTextEditControl::hitTest(), if(), QHttp::ignoreSslErrors(), QScriptEngine::importExtension(), QWidgetPrivate::inheritStyle(), QHttpNetworkConnectionChannel::init(), QToolBar::initStyleOption(), InputPrivate::InputPrivate(), QListModel::insert(), QPlainTextEditControl::insertFromMimeData(), QTextEditControl::insertFromMimeData(), QListModel::insertRows(), QDeclarativeFlickablePrivate::isOutermostPressDelay(), QWidgetPrivate::isOverlapped(), isTreeView(), QDeclarativeVisualDataModel::item(), QListWidget::items(), QTableWidget::items(), QToolBarLayout::layoutActions(), QGraphicsScenePrivate::leaveScene(), QDeclarativeTextEdit::loadCursorDelegate(), QDeclarativeInspectorService::loadInspectorPlugin(), QTextDocument::loadResource(), QScriptDebuggerLocalsWidget::localsModel(), QDeclarativeItem::mapFromItem(), QDeclarativeItem::mapToItem(), ShaderEffectSource::markSourceItemDirty(), QUnicodeControlCharacterMenu::menuActionTriggered(), QMainWindow::menuBar(), QDeclarativeEngineDebugService::messageReceived(), QListModel::mimeData(), QTableModel::mimeData(), QListModel::mimeTypes(), QTableModel::mimeTypes(), QDockWidgetLayout::minimumSize(), QDockWidgetLayout::minimumTitleWidth(), QCalendarView::mouseDoubleClickEvent(), QCalendarView::mouseMoveEvent(), QSizeGrip::mousePressEvent(), QCalendarPopup::mousePressEvent(), QCalendarView::mousePressEvent(), QCalendarView::mouseReleaseEvent(), QToolBarLayout::movable(), QCalendarView::moveCursor(), QAbstractButtonPrivate::moveFocus(), QNetworkManagerEngine::newConnection(), QApplication::notify(), QTextFrame::iterator::operator++(), QTextFrame::iterator::operator--(), OutputPrivate::OutputPrivate(), QTextEditPrivate::paint(), QScriptDebuggerLocalsItemDelegate::paint(), QGraphicsTextItem::paint(), QWidgetPrivate::paintBackground(), QDockWidget::paintEvent(), QWidgetPrivate::paintSiblingsRecursive(), QGraphicsWidget::paintWindowFrame(), QDeclarativeItem::parentItem(), QAbstractState::parentState(), QFSCompleter::pathFromIndex(), QCompleter::pathFromIndex(), QMacStyle::pixelMetric(), QStyleSheetStyle::pixelMetric(), QMainWindowLayout::plug(), QPlastiqueStyle::polish(), QStyleSheetStyle::polish(), QGtkStyle::polish(), QDBusAdaptorConnector::polish(), QMenu::popup(), QToolButtonPrivate::popupTimerDone(), QTextDocumentLayout::positionInlineObject(), QHttpPrivate::postMoreData(), QWidgetPrivate::propagatePaletteChange(), q_createNativeChildrenAndSetParent(), QAction::QAction(), qDBusFindAdaptorConnector(), QDeclarativeKeysAttached::QDeclarativeKeysAttached(), QFontComboBox::QFontComboBox(), qgraphicsobject_autoParent(), QIODevice::QIODevice(), qmlxmlhttprequest_abort(), qmlxmlhttprequest_getAllResponseHeaders(), qmlxmlhttprequest_getResponseHeader(), qmlxmlhttprequest_onreadystatechange(), qmlxmlhttprequest_open(), qmlxmlhttprequest_readyState(), qmlxmlhttprequest_responseText(), qmlxmlhttprequest_responseXML(), qmlxmlhttprequest_send(), qmlxmlhttprequest_setRequestHeader(), qmlxmlhttprequest_status(), qmlxmlhttprequest_statusText(), QScriptDBusInterfaceConstructor::qscript_call(), qt_aqua_get_known_size(), qt_guiPlatformPlugin(), qt_mac_buttonIsRenderedFlat(), QSignalEventGenerator::qt_metacall(), QToolBarLayout::QToolBarLayout(), QtWndProc(), QWidgetResizeHandler::QWidgetResizeHandler(), QWinEventNotifier::QWinEventNotifier(), QAbstractTextDocumentLayout::registerHandler(), QTextEditPrivate::relayoutDocument(), QPlainTextEditPrivate::relayoutDocument(), QNetworkManagerEngine::removeConnection(), QMacStylePrivate::removeWidget(), QmlJSDebugger::QDeclarativeViewInspector::reparentQmlObject(), QTextDocumentLayout::resizeInlineObject(), QDeclarativeParentChange::saveCurrentValues(), QAxScriptManager::scriptError(), QScriptDebuggerScriptsWidget::scriptsModel(), QDeclarativeWorkerScriptEnginePrivate::scriptValueToVariant(), QInputContext::sendEvent(), QSoftKeyManager::sendKeyEvent(), QDeclarativePathView::sendMouseEvent(), QDeclarativeMouseArea::sendMouseEvent(), QDeclarativeFlickable::sendMouseEvent(), QDeclarativePinchArea::sendMouseEvent(), QDeclarativeTextInputPrivate::sendMouseEventToInputContext(), QHttpNetworkConnectionChannel::sendRequest(), QWidget::setAttribute(), QGraphicsScene::setBspTreeDepth(), QCalendarPopup::setCalendarWidget(), QTableModel::setData(), QMessageBox::setDetailedText(), QWidget::setDisabled(), QPlainTextEdit::setDocument(), QWinEventNotifier::setEnabled(), QWidgetPrivate::setEnabled_helper(), QToolBarLayout::setExpanded(), QDockWidget::setFeatures(), QAction::setFont(), QToolBarLayout::setGeometry(), QDockWidgetLayout::setGeometry(), QTableModel::setHorizontalHeaderItem(), QToolBar::setIconSize(), QTableModel::setItem(), QTableModel::setItemData(), QGraphicsScene::setItemIndexMethod(), QComboBoxPrivateContainer::setItemView(), QWidgetPrivate::setLayoutDirection_helper(), QWidgetPrivate::setLocale_helper(), QMainWindow::setMenuBar(), QCompleter::setModel(), QComboBox::setModelColumn(), QScriptDebuggerLocalsItemDelegate::setModelData(), QScriptBreakpointsItemDelegate::setModelData(), ShaderEffectItem::setSource(), QWidgetPrivate::setStyle_helper(), QApplication::setStyleSheet(), QWidget::setStyleSheet(), QDockWidget::setTitleBarWidget(), QWidgetPrivate::setUpdatesEnabled_helper(), QTableModel::setVerticalHeaderItem(), QDialog::setVisible(), QDockWidget::setWidget(), QWidgetPrivate::setWindowIcon_helper(), QFontComboBox::setWritingSystem(), QGLShaderProgram::shaderDestroyed(), QMdi::ControlContainer::showButtonsInMenuBar(), QWidgetPrivate::showChildren(), QWidget::showFullScreen(), QWidget::showMaximized(), QWidget::showNormal(), QComboBox::showPopup(), QDockWidgetLayout::sizeFromContent(), QMacStyle::sizeFromContents(), QPushButton::sizeHint(), QDockWidgetLayout::sizeHint(), QComboBoxPrivateContainer::spacing(), QFSCompleter::splitPath(), QCompleter::splitPath(), QMainWindowLayout::statusBar(), QWindowsXPStyle::styleHint(), QWindowsStyle::styleHint(), QCommonStyle::subElementRect(), QMacStyle::subElementRect(), QWidgetPrivate::subtractOpaqueSiblings(), QListModel::supportedDropActions(), QTableModel::supportedDropActions(), QScriptDebuggerLocalsModel::sync(), QMainWindowLayout::tabChanged(), QTableWidgetPrivate::tableModel(), QToolBarLayout::takeAt(), QTextBlock::textList(), QDeclarativeFlickable::timerEvent(), QDockWidget::titleBarWidget(), QmlJSDebugger::AbstractLiveEditTool::titleForItem(), QDockWidgetLayout::titleHeight(), toolbarInUnifiedToolBar(), QmlJSDebugger::AbstractLiveEditTool::toQDeclarativeItem(), QDeclarativeItemPrivate::transform_append(), QDeclarativeItemPrivate::transform_at(), QDeclarativeItemPrivate::transform_clear(), QDeclarativeItemPrivate::transform_count(), QStatePrivate::transitions(), QTreeWidgetPrivate::treeModel(), QPlastiqueStyle::unpolish(), QNetworkManagerEngine::updateAccessPoint(), QNetworkConfigurationManagerPrivate::updateConfigurations(), QNetworkManagerEngine::updateConnection(), QMenuBarPrivate::updateCornerWidgetToolBar(), QFactoryLoader::updateDir(), QWidgetPrivate::updateFont(), QToolBarLayout::updateGeomArray(), QToolBarLayout::updateMarginAndSpacing(), QWorkspaceChild::updateMask(), QMessageBoxPrivate::updateSize(), QStyleSheetStyle::updateStyleSheetFont(), QComboBoxPrivateContainer::updateTopBottomMargin(), QScriptBreakpointsItemDelegate::validateInput(), QPlainTextEditPrivate::verticalOffset(), QTreeModel::view(), QMdiArea::viewportEvent(), QHeaderView::viewportEvent(), QWizardHeader::vistaDisabled(), waitForPopup(), QDockWidget::widget(), QWorkspace::windowList(), QDeclarativeContents::~QDeclarativeContents(), QToolBar::~QToolBar(), and QWorkspaceChild::~QWorkspaceChild().
|
related |
Synonym for QList<QObject *>.
Returns a pointer to the object named name that inherits type and with a given parent.
Returns 0 if there is no such child.
Definition at line 700 of file qobject.cpp.
|
friend |
Definition at line 330 of file qobject.h.
Referenced by moveToThread().
Definition at line 329 of file qobject.h.
Referenced by QX11Data::clipboardReadIncrementalProperty(), QClipboardData::QClipboardData(), qt_tablet_init(), setupOwner(), and QScriptEngineDebugger::standardWindow().
|
protected |
Definition at line 320 of file qobject.h.
Referenced by QDirectFBScreen::createDFBSurface(), QVFbScreen::depth(), QDirectFBScreen::dfb(), QDirectFBScreen::dfbDisplayLayer(), QDirectFBScreen::directFBFlags(), QVFbScreenPrivate::disconnect(), QVFbScreen::format(), QVFbScreen::geometry(), QMetaObject::metacall(), QWidgetPrivate::paintBackground(), QVFbScreen::physicalSize(), QDeclarativeBoundSignalParameters::QDeclarativeBoundSignalParameters(), QObject(), QSettings::QSettings(), QSignalEventGenerator::qt_metacall(), QSettings::registerFormat(), QDBusAdaptorConnector::relaySlot(), QDirectFBScreen::releaseDFBSurface(), QGraphicsScene::render(), QGraphicsView::render(), QVFbScreen::screenImage(), QDeclarativeGraphics_DerivedObject::setParent_noEvent(), QTreeModel::sortItems(), QtFriendlyLayoutWidget::wasDeleted(), QIODevice::write(), QGraphicsItem::~QGraphicsItem(), and QScriptEngine::~QScriptEngine().
|
private |
the name of this object
You can find an object by name (and type) using findChild(). You can find a set of objects with findChildren().
By default, this property contains an empty string.
Definition at line 114 of file qobject.h.
Referenced by QAxScriptManager::addObject(), QAccessibleCalendarWidget::calendarView(), QCoreApplicationPrivate::checkReceiverThread(), QMetaObject::connectSlotsByName(), err_info_about_objects(), QScript::QObjectDelegate::getOwnPropertyDescriptor(), QScript::QObjectDelegate::getOwnPropertySlot(), QDBusConnectionPrivate::handleObjectCall(), killTimer(), QAccessibleCalendarWidget::navigationBar(), QAxScriptManager::objectDestroyed(), QDeclarativeDebugService::objectToString(), operator<<(), qax_create_object_wrapper(), QScript::qobjectProtoFuncFindChildren(), QScript::qobjectProtoFuncToString(), QTest::qSignalDumperCallback(), QTest::qSignalDumperCallbackSlot(), qt_find_obj_child(), qt_qFindChild_helper(), qt_qFindChildren_helper(), QCoreApplicationPrivate::removePostedEvent(), setObjectName(), QDBusPendingCallPrivate::setReplyCallback(), QDeclarativeObjectScriptClass::tostring(), and QDeclarativeEngineDebugService::valueContents().
|
static |
This variable stores the meta-object for the class.
A meta-object contains information about a class that inherits QObject, e.g. class name, superclass name, properties, signals and slots. Every class that contains the Q_OBJECT macro will also have a meta-object.
The meta-object information is required by the signal/slot connection mechanism and the property system. The inherits() function also makes use of the meta-object.
If you have a pointer to an object, you can use metaObject() to retrieve the meta-object associated with that object.
Example:
Definition at line 128 of file qobject.h.
Referenced by QDeclarativeCompiler::buildObject(), QDeclarativeCompiler::buildPropertyObjectAssignment(), QDBusAbstractInterface::callWithArgumentList(), QFontDialogPrivate::canBeNativeDialog(), QFileDialogPrivate::canBeNativeDialog(), QDeclarativePropertyPrivate::canConvert(), classIDL(), QDeclarativeListModelParser::compileProperty(), QDBusConnectionPrivate::connectRelay(), QDeclarativePathView::createdItem(), QDeclarativeItemPrivate::data_append(), QMetaObjectBuilder::deserialize(), QDBusConnectionPrivate::disconnectRelay(), findSlot(), QDeclarativeCompiler::genObject(), QDeclarativePathViewPrivate::getItem(), QDeclarativeRectanglePrivate::getPen(), QDeclarativeBorderImagePrivate::getScaleGrid(), QDeclarativeFlickablePrivate::init(), QDeclarativePathViewPrivate::init(), QtDBusScriptPlugin::initialize(), QAxServerBase::isPropertyExposed(), QDeclarativeKeysAttached::keyPressed(), QDeclarativeBorderImage::load(), QDeclarativeImageBase::load(), QSignalEventGenerator::metaObject(), QDBusInterface::metaObject(), QAxObject::parentMetaObject(), QAxWidget::parentMetaObject(), QStyleSheetStyle::polish(), QBBButtonEventNotifier::QBBButtonEventNotifier(), qDBusInterfaceInObject(), qDBusIntrospectObject(), qDBusUpdateDispatchStatus(), QDeclarativeBoundSignalParameters::QDeclarativeBoundSignalParameters(), QDeclarativeCompiledBindings::QDeclarativeCompiledBindings(), QDeclarativeExpression::QDeclarativeExpression(), QDeclarativeFastProperties::QDeclarativeFastProperties(), QDeclarativePixmapReply::QDeclarativePixmapReply(), QDeclarativeWatchProxy::QDeclarativeWatchProxy(), QMetaObjectBuilderPrivate::QMetaObjectBuilderPrivate(), QScript::qobjectProtoFuncToString(), QSignalSpy::QSignalSpy(), QtWndProc(), readAllProperties(), QDBusAdaptorConnector::relay(), QDBusAdaptorConnector::relaySignal(), QDBusConnectionPrivate::relaySignal(), resolveClassName(), QDeclarativePixmapReader::run(), QDBusAbstractAdaptor::setAutoRelaySignals(), QDBusConnectionPrivate::setConnection(), QTextControlPrivate::setContent(), QDeclarativeRectangle::setGradient(), QDeclarativeBorderImage::setGridScaledImage(), QDeclarativeVisualDataModel::setModel(), QmlJSDebugger::InspectorProtocol::toString(), QPropertyAnimation::updateState(), QGraphicsView::viewportEvent(), and QDBusMetaObjectGenerator::write().
|
staticprotected |
Definition at line 322 of file qobject.h.
Referenced by StaticQtMetaObject::get(), QMetaObject::property(), and QDeclarativeBoundSignalParameters::QDeclarativeBoundSignalParameters().