QInternal Class Reference

#include <qnamespace.h>

List of all members.


Detailed Description

Definition at line 1381 of file qnamespace.h.

Public Types

enum  PaintDeviceFlags
enum  RelayoutType
enum  Callback
enum  InternalFunction

Static Public Member Functions

static bool registerCallback (Callback, qInternalCallback)
static bool unregisterCallback (Callback, qInternalCallback)
static bool activateCallbacks (Callback, void **)
static bool callFunction (InternalFunction func, void **)


Member Enumeration Documentation

enum QInternal::PaintDeviceFlags

Definition at line 1383 of file qnamespace.h.

01383                           {
01384         UnknownDevice = 0x00,
01385         Widget        = 0x01,
01386         Pixmap        = 0x02,
01387         Image         = 0x03,
01388         Printer       = 0x04,
01389         Picture       = 0x05,
01390         Pbuffer       = 0x06,    // GL pbuffer
01391         FramebufferObject = 0x07, // GL framebuffer object
01392         CustomRaster  = 0x08
01393     };

enum QInternal::RelayoutType

Definition at line 1394 of file qnamespace.h.

01394                       {
01395         RelayoutNormal,
01396         RelayoutDragging,
01397         RelayoutDropped
01398     };

enum QInternal::Callback

Definition at line 1401 of file qnamespace.h.

01401                   {
01402         ConnectCallback,
01403         DisconnectCallback,
01404         AdoptCurrentThread,
01405         LastCallback
01406     };

enum QInternal::InternalFunction

Definition at line 1408 of file qnamespace.h.


Member Function Documentation

bool QInternal::registerCallback ( Callback  ,
qInternalCallback   
) [static]

Definition at line 2631 of file qglobal.cpp.

References QInternal_CallBackTable::callbacks, and LastCallback.

02632 {
02633     if (cb >= 0 && cb < QInternal::LastCallback) {
02634         QInternal_CallBackTable *cbt = global_callback_table();
02635         cbt->callbacks.resize(cb + 1);
02636         cbt->callbacks[cb].append(callback);
02637         return true;
02638     }
02639     return false;
02640 }

bool QInternal::unregisterCallback ( Callback  ,
qInternalCallback   
) [static]

Definition at line 2642 of file qglobal.cpp.

References QInternal_CallBackTable::callbacks, and LastCallback.

02643 {
02644     if (cb >= 0 && cb < QInternal::LastCallback) {
02645         QInternal_CallBackTable *cbt = global_callback_table();
02646         return (bool) cbt->callbacks[cb].removeAll(callback);
02647     }
02648     return false;
02649 }

bool QInternal::activateCallbacks ( Callback  ,
void **   
) [static]

Definition at line 2651 of file qglobal.cpp.

References QInternal_CallBackTable::callbacks, and i.

Referenced by QObject::connect(), QThreadData::current(), and QObject::disconnect().

02652 {
02653     Q_ASSERT_X(cb >= 0, "QInternal::activateCallback()", "Callback id must be a valid id");
02654 
02655     QInternal_CallBackTable *cbt = global_callback_table();
02656     if (cbt && cb < cbt->callbacks.size()) {
02657         QList<qInternalCallback> callbacks = cbt->callbacks[cb];
02658         bool ret = false;
02659         for (int i=0; i<callbacks.size(); ++i)
02660             ret |= (callbacks.at(i))(parameters);
02661         return ret;
02662     }
02663     return false;
02664 }

bool QInternal::callFunction ( InternalFunction  func,
void **   
) [static]

Definition at line 2666 of file qglobal.cpp.

References QAdoptedThread::createThreadForAdoption(), CreateThreadForAdoption, QThreadData::deref(), DerefAdoptedThread, QThreadData::get2(), qt_set_current_thread_to_main_thread(), QThreadData::ref(), RefAdoptedThread, and SetCurrentThreadToMainThread.

02667 {
02668     Q_ASSERT_X(func >= 0,
02669                "QInternal::callFunction()", "Callback id must be a valid id");
02670 #ifndef QT_NO_QOBJECT
02671     switch (func) {
02672 #ifndef QT_NO_THREAD
02673     case QInternal::CreateThreadForAdoption:
02674         *args = QAdoptedThread::createThreadForAdoption();
02675         return true;
02676 #endif
02677     case QInternal::RefAdoptedThread:
02678         QThreadData::get2((QThread *) *args)->ref();
02679         return true;
02680     case QInternal::DerefAdoptedThread:
02681         QThreadData::get2((QThread *) *args)->deref();
02682         return true;
02683     case QInternal::SetCurrentThreadToMainThread:
02684         extern void qt_set_current_thread_to_main_thread();
02685         qt_set_current_thread_to_main_thread();
02686         return true;
02687     default:
02688         break;
02689     }
02690 #else
02691     Q_UNUSED(args);
02692     Q_UNUSED(func);
02693 #endif
02694 
02695     return false;
02696 }

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 18:04:14 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1