Qt 4.8
Public Functions | Public Variables | List of all members
QEventDispatcherGlibPrivate Class Reference

#include <qeventdispatcher_glib_p.h>

Inheritance diagram for QEventDispatcherGlibPrivate:
QAbstractEventDispatcherPrivate QObjectPrivate QObjectData QGuiEventDispatcherGlibPrivate QPAEventDispatcherGlibPrivate QWSEventDispatcherGlibPrivate

Public Functions

 QEventDispatcherGlibPrivate (GMainContext *context=0)
 
void runTimersOnceWithNormalPriority ()
 
- Public Functions inherited from QAbstractEventDispatcherPrivate
void init ()
 
 QAbstractEventDispatcherPrivate ()
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 

Public Variables

GIdleTimerSourceidleTimerSource
 
GMainContextmainContext
 
GPostEventSourcepostEventSource
 
GSocketNotifierSourcesocketNotifierSource
 
GTimerSourcetimerSource
 
- Public Variables inherited from QAbstractEventDispatcherPrivate
QAbstractEventDispatcher::EventFilter event_filter
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Additional Inherited Members

- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
- Static Public Functions inherited from QAbstractEventDispatcherPrivate
static int allocateTimerId ()
 
static void releaseTimerId (int id)
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 

Detailed Description

Definition at line 103 of file qeventdispatcher_glib_p.h.

Constructors and Destructors

◆ QEventDispatcherGlibPrivate()

QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate ( GMainContext context = 0)

Definition at line 295 of file qeventdispatcher_glib.cpp.

296  : mainContext(context)
297 {
298  if (qgetenv("QT_NO_THREADED_GLIB").isEmpty()) {
299  static int dummyValue = 0; // only used for its address
300  QMutexLocker locker(QMutexPool::instance()->get(&dummyValue));
301  if (!g_thread_supported())
302  g_thread_init(NULL);
303  }
304 
305  if (mainContext) {
306  g_main_context_ref(mainContext);
307  } else {
309  if (app && QThread::currentThread() == app->thread()) {
310  mainContext = g_main_context_default();
311  g_main_context_ref(mainContext);
312  } else {
313  mainContext = g_main_context_new();
314  }
315  }
316 
317 #if GLIB_CHECK_VERSION (2, 22, 0)
318  g_main_context_push_thread_default (mainContext);
319 #endif
320 
321  // setup post event source
322  postEventSource = reinterpret_cast<GPostEventSource *>(g_source_new(&postEventSourceFuncs,
323  sizeof(GPostEventSource)));
325  postEventSource->d = this;
326  g_source_set_can_recurse(&postEventSource->source, true);
327  g_source_attach(&postEventSource->source, mainContext);
328 
329  // setup socketNotifierSource
331  reinterpret_cast<GSocketNotifierSource *>(g_source_new(&socketNotifierSourceFuncs,
332  sizeof(GSocketNotifierSource)));
334  g_source_set_can_recurse(&socketNotifierSource->source, true);
335  g_source_attach(&socketNotifierSource->source, mainContext);
336 
337  // setup normal and idle timer sources
338  timerSource = reinterpret_cast<GTimerSource *>(g_source_new(&timerSourceFuncs,
339  sizeof(GTimerSource)));
340  (void) new (&timerSource->timerList) QTimerInfoList();
343  g_source_set_can_recurse(&timerSource->source, true);
344  g_source_attach(&timerSource->source, mainContext);
345 
346  idleTimerSource = reinterpret_cast<GIdleTimerSource *>(g_source_new(&idleTimerSourceFuncs,
347  sizeof(GIdleTimerSource)));
349  g_source_set_can_recurse(&idleTimerSource->source, true);
350  g_source_set_priority(&idleTimerSource->source, G_PRIORITY_DEFAULT_IDLE);
351  g_source_attach(&idleTimerSource->source, mainContext);
352 }
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
QEventLoop::ProcessEventsFlags processEventsFlags
static GSourceFuncs postEventSourceFuncs
QEventDispatcherGlibPrivate * d
static GSourceFuncs socketNotifierSourceFuncs
static QThread * currentThread()
Returns a pointer to a QThread which manages the currently executing thread.
Definition: qthread.cpp:419
static bool isEmpty(const char *str)
static GSourceFuncs timerSourceFuncs
static QMutexPool * instance()
Returns the global QMutexPool instance.
Definition: qmutexpool.cpp:124
static GSourceFuncs idleTimerSourceFuncs
QList< GPollFDWithQSocketNotifier * > pollfds
The QCoreApplication class provides an event loop for console Qt applications.
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
Definition: qmutex.h:101
QTimerInfoList timerList
static QCoreApplication * instance()
Returns a pointer to the application&#39;s QCoreApplication (or QApplication) instance.
QThread * thread() const
Returns the thread in which the object lives.
Definition: qobject.cpp:1419
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
GSocketNotifierSource * socketNotifierSource

Functions

◆ runTimersOnceWithNormalPriority()

void QEventDispatcherGlibPrivate::runTimersOnceWithNormalPriority ( )

Definition at line 354 of file qeventdispatcher_glib.cpp.

Referenced by postEventSourceDispatch(), and x11EventSourceDispatch().

355 {
357 }

Properties

◆ idleTimerSource

GIdleTimerSource* QEventDispatcherGlibPrivate::idleTimerSource

Definition at line 112 of file qeventdispatcher_glib_p.h.

◆ mainContext

GMainContext* QEventDispatcherGlibPrivate::mainContext

◆ postEventSource

GPostEventSource* QEventDispatcherGlibPrivate::postEventSource

Definition at line 109 of file qeventdispatcher_glib_p.h.

Referenced by QEventDispatcherGlibPrivate().

◆ socketNotifierSource

GSocketNotifierSource* QEventDispatcherGlibPrivate::socketNotifierSource

Definition at line 110 of file qeventdispatcher_glib_p.h.

Referenced by QEventDispatcherGlibPrivate().

◆ timerSource

GTimerSource* QEventDispatcherGlibPrivate::timerSource

Definition at line 111 of file qeventdispatcher_glib_p.h.

Referenced by runTimersOnceWithNormalPriority().


The documentation for this class was generated from the following files: