44 #include "qplatformdefs.h" 50 #include <private/qthread_p.h> 186 qWarning(
"QSocketNotifier: Invalid socket specified");
187 else if (!
d->threadData->eventDispatcher)
188 qWarning(
"QSocketNotifier: Can only be used with threads started with QThread");
190 d->threadData->eventDispatcher->registerSocketNotifier(
this);
214 qWarning(
"QSocketNotifier: Invalid socket specified");
220 if (!
d->threadData->eventDispatcher) {
221 qWarning(
"QSocketNotifier: Can only be used with threads started with QThread");
223 d->threadData->eventDispatcher->registerSocketNotifier(
this);
310 if (!
d->threadData->eventDispatcher)
313 d->threadData->eventDispatcher->registerSocketNotifier(
this);
315 d->threadData->eventDispatcher->unregisterSocketNotifier(
this);
~QSocketNotifier()
Destroys this socket notifier.
#define QT_END_NAMESPACE
This macro expands to.
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
Type
This enum describes the various types of events that a socket notifier can recognize.
#define Q_ARG(type, data)
void activated(int socket)
This signal is emitted whenever the socket notifier is enabled and a socket event corresponding to it...
The QObject class is the base class of all Qt objects.
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
Type type() const
Returns the socket event type specified to the constructor.
void setObjectName(const QString &name)
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
QSocketNotifier(int socket, Type, QObject *parent=0)
Constructs a socket notifier with the given parent.
Q_CORE_EXPORT void qWarning(const char *,...)
Q_INVOKABLE QObject(QObject *parent=0)
Constructs an object with parent object parent.
QObject * parent() const
Returns a pointer to the parent object.
void setEnabled(bool)
If enable is true, the notifier is enabled; otherwise the notifier is disabled.
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
int socket() const
Returns the socket identifier specified to the constructor.