40 #define BUILDING_QSOCKETNOTIFIER
42 #undef BUILDING_QSOCKETNOTIFIER
44 #include "qplatformdefs.h"
52 #include <private/qthread_p.h>
54 #include <QtCore/QLoggingCategory>
70 bool snenabled =
false;
163 qRegisterMetaType<QSocketDescriptor>();
164 qRegisterMetaType<QSocketNotifier::Type>();
190 auto thisThreadData =
d->threadData.loadRelaxed();
192 if (!
d->sockfd.isValid())
193 qWarning(
"QSocketNotifier: Invalid socket specified");
194 else if (!thisThreadData->hasEventDispatcher())
195 qWarning(
"QSocketNotifier: Can only be used with threads started with QThread");
197 thisThreadData->eventDispatcher.loadRelaxed()->registerSocketNotifier(
this);
289 return d->sockfd.isValid();
321 if (!
d->sockfd.isValid())
328 auto thisThreadData =
d->threadData.loadRelaxed();
330 if (!thisThreadData->hasEventDispatcher())
333 qWarning(
"QSocketNotifier: Socket notifiers cannot be enabled or disabled from another thread");
337 thisThreadData->eventDispatcher.loadRelaxed()->registerSocketNotifier(
this);
339 thisThreadData->eventDispatcher.loadRelaxed()->unregisterSocketNotifier(
this);
354 Q_ARG(
bool,
d->snenabled));
420 #include "moc_qsocketnotifier.cpp"
The QEvent class is the base class of all event classes. Event objects contain event parameters.
The QObject class is the base class of all Qt objects.
virtual bool event(QEvent *event)
The QPointer class is a template class that provides guarded pointers to QObject.
A class which holds a native socket descriptor.
The QSocketNotifier class provides support for monitoring activity on a file descriptor.
void setSocket(qintptr socket)
void activated(QSocketDescriptor socket, QSocketNotifier::Type activationEvent, QPrivateSignal)
QSocketNotifier(Type, QObject *parent=nullptr)
bool event(QEvent *) override
QSocketNotifier::Type sntype
static QThread * currentThread()
#define Q_DECLARE_LOGGING_CATEGORY(name)
QT_BEGIN_NAMESPACE QT_IMPL_METATYPE_EXTERN_TAGGED(QNetworkAccessCache::CacheableObject *, QNetworkAccessCache__CacheableObject_ptr) enum ExpiryTimeEnum
#define Q_ARG(type, data)
QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcSocketNotifierDeprecation, "qt.core.socketnotifier_deprecation")
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent