Logo Search packages:      
Sourcecode: qt4-x11 version File versions

void QSocketNotifier::setEnabled ( bool  enable  )  [slot]

If enable is true, the notifier is enabled; otherwise the notifier is disabled.

The notifier is enabled by default, i.e. it emits the activated() signal whenever a socket event corresponding to its {type()}{type} occurs. If it is disabled, it ignores socket events (the same effect as not creating the socket notifier).

Write notifiers should normally be disabled immediately after the activated() signal has been emitted

See also:
isEnabled(), activated()

Definition at line 271 of file qsocketnotifier.cpp.

Referenced by event(), and ~QSocketNotifier().

{
    if (sockfd < 0)
        return;
    if (snenabled == enable)                        // no change
        return;
    snenabled = enable;

    Q_D(QObject);
    if (!d->threadData->eventDispatcher) // perhaps application/thread is shutting down
        return;
    if (snenabled)
        d->threadData->eventDispatcher->registerSocketNotifier(this);
    else
        d->threadData->eventDispatcher->unregisterSocketNotifier(this);
}


Generated by  Doxygen 1.6.0   Back to index