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

bool QCoreApplication::compressEvent ( QEvent event,
QObject receiver,
QPostEventList *  postedEvents 
) [protected, virtual]

For internal use only.

Returns true if event was compressed away (possibly deleted) and should not be added to the list.

Reimplemented in QApplication.

Definition at line 1068 of file qcoreapplication.cpp.

References QSqlQuery::at(), QObject::event(), and QEvent::type().

Referenced by QApplication::compressEvent().

{
#ifdef Q_WS_WIN
    Q_ASSERT(event);
    Q_ASSERT(receiver);
    Q_ASSERT(postedEvents);

    // compress posted timers to this object.
    if (event->type() == QEvent::Timer && receiver->d_func()->postedEvents > 0) {
        int timerId = ((QTimerEvent *) event)->timerId();
        for (int i=0; i<postedEvents->size(); ++i) {
            const QPostEvent &e = postedEvents->at(i);
            if (e.receiver == receiver && e.event && e.event->type() == QEvent::Timer
                && ((QTimerEvent *) e.event)->timerId() == timerId) {
                delete event;
                return true;
            }
        }
    } else
#endif
        if ((event->type() == QEvent::DeferredDelete
             || event->type() == QEvent::Quit)
            && receiver->d_func()->postedEvents > 0) {
            for (int i = 0; i < postedEvents->size(); ++i) {
                const QPostEvent &cur = postedEvents->at(i);
                if (cur.receiver != receiver
                    || cur.event == 0
                    || cur.event->type() != event->type())
                    continue;
                // found an event for this receiver
                delete event;
                return true;
            }
        }
    return false;
}


Generated by  Doxygen 1.6.0   Back to index