Qt 4.8
Public Types | Static Public Functions | List of all members
QInternal Class Reference

#include <qnamespace.h>

Public Types

enum  Callback {
  ConnectCallback, DisconnectCallback, AdoptCurrentThread, EventNotifyCallback,
  LastCallback
}
 
enum  DockPosition {
  LeftDock, RightDock, TopDock, BottomDock,
  DockCount
}
 
enum  InternalFunction {
  CreateThreadForAdoption, RefAdoptedThread, DerefAdoptedThread, SetCurrentThreadToMainThread,
  SetQObjectSender, GetQObjectSender, ResetQObjectSender, LastInternalFunction
}
 
enum  PaintDeviceFlags {
  UnknownDevice = 0x00, Widget = 0x01, Pixmap = 0x02, Image = 0x03,
  Printer = 0x04, Picture = 0x05, Pbuffer = 0x06, FramebufferObject = 0x07,
  CustomRaster = 0x08, MacQuartz = 0x09, PaintBuffer = 0x0a, OpenGL = 0x0b
}
 
enum  RelayoutType { RelayoutNormal, RelayoutDragging, RelayoutDropped }
 

Static Public Functions

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

Detailed Description

Definition at line 1820 of file qnamespace.h.

Enumerations

◆ Callback

Enumerator
ConnectCallback 
DisconnectCallback 
AdoptCurrentThread 
EventNotifyCallback 
LastCallback 

Definition at line 1843 of file qnamespace.h.

◆ DockPosition

Enumerator
LeftDock 
RightDock 
TopDock 
BottomDock 
DockCount 

Definition at line 1862 of file qnamespace.h.

◆ InternalFunction

Enumerator
CreateThreadForAdoption 
RefAdoptedThread 
DerefAdoptedThread 
SetCurrentThreadToMainThread 
SetQObjectSender 
GetQObjectSender 
ResetQObjectSender 
LastInternalFunction 

Definition at line 1851 of file qnamespace.h.

◆ PaintDeviceFlags

Enumerator
UnknownDevice 
Widget 
Pixmap 
Image 
Printer 
Picture 
Pbuffer 
FramebufferObject 
CustomRaster 
MacQuartz 
PaintBuffer 
OpenGL 

Definition at line 1822 of file qnamespace.h.

1822  {
1823  UnknownDevice = 0x00,
1824  Widget = 0x01,
1825  Pixmap = 0x02,
1826  Image = 0x03,
1827  Printer = 0x04,
1828  Picture = 0x05,
1829  Pbuffer = 0x06, // GL pbuffer
1830  FramebufferObject = 0x07, // GL framebuffer object
1831  CustomRaster = 0x08,
1832  MacQuartz = 0x09,
1833  PaintBuffer = 0x0a,
1834  OpenGL = 0x0b
1835  };
unsigned long Picture
The Image element displays an image in a declarative user interface.

◆ RelayoutType

Enumerator
RelayoutNormal 
RelayoutDragging 
RelayoutDropped 

Definition at line 1836 of file qnamespace.h.

Functions

◆ activateCallbacks()

bool QInternal::activateCallbacks ( Callback  cb,
void **  parameters 
)
static

Definition at line 3653 of file qglobal.cpp.

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

3654 {
3655  Q_ASSERT_X(cb >= 0, "QInternal::activateCallback()", "Callback id must be a valid id");
3656 
3657  QInternal_CallBackTable *cbt = global_callback_table();
3658  if (cbt && cb < cbt->callbacks.size()) {
3659  QList<qInternalCallback> callbacks = cbt->callbacks[cb];
3660  bool ret = false;
3661  for (int i=0; i<callbacks.size(); ++i)
3662  ret |= (callbacks.at(i))(parameters);
3663  return ret;
3664  }
3665  return false;
3666 }
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QVector< QList< qInternalCallback > > callbacks
Definition: qglobal.cpp:3628
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ callFunction()

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

Definition at line 3670 of file qglobal.cpp.

3671 {
3672  Q_ASSERT_X(func >= 0,
3673  "QInternal::callFunction()", "Callback id must be a valid id");
3674 #ifndef QT_NO_QOBJECT
3675  switch (func) {
3676 #ifndef QT_NO_THREAD
3679  return true;
3680 #endif
3682  QThreadData::get2((QThread *) *args)->ref();
3683  return true;
3685  QThreadData::get2((QThread *) *args)->deref();
3686  return true;
3689  return true;
3691  QObject *receiver = (QObject *) args[0];
3693  sender->sender = (QObject *) args[1];
3694  sender->signal = *(int *) args[2];
3695  sender->ref = 1;
3696 
3697  // Store the old sender as "return value"
3698  args[3] = QObjectPrivate::setCurrentSender(receiver, sender);
3699  args[4] = sender;
3700  return true;
3701  }
3703  QObject *receiver = (QObject *) args[0];
3704  QObjectPrivate *d = QObjectPrivate::get(receiver);
3705  args[1] = d->currentSender ? d->currentSender->sender : 0;
3706  return true;
3707  }
3709  QObject *receiver = (QObject *) args[0];
3710  QObjectPrivate::Sender *oldSender = (QObjectPrivate::Sender *) args[1];
3711  QObjectPrivate::Sender *sender = (QObjectPrivate::Sender *) args[2];
3712  QObjectPrivate::resetCurrentSender(receiver, sender, oldSender);
3713  delete sender;
3714  return true;
3715  }
3716 
3717  default:
3718  break;
3719  }
3720 #else
3721  Q_UNUSED(args);
3722  Q_UNUSED(func);
3723 #endif
3724 
3725  return false;
3726 }
double d
Definition: qnumeric_p.h:62
static Sender * setCurrentSender(QObject *receiver, Sender *sender)
Definition: qobject_p.h:269
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
Sender * currentSender
Definition: qobject_p.h:200
static QObjectPrivate * get(QObject *o)
Definition: qobject_p.h:177
void deref()
Definition: qthread.cpp:125
static QThreadData * get2(QThread *thread)
Definition: qthread_p.h:219
static void resetCurrentSender(QObject *receiver, Sender *currentSender, Sender *previousSender)
Definition: qobject_p.h:277
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837
void ref()
Definition: qthread.cpp:117
void qt_set_current_thread_to_main_thread()
static QThread * createThreadForAdoption()
Definition: qthread.cpp:156
The QThread class provides a platform-independent way to manage threads.
Definition: qthread.h:59
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ registerCallback()

bool QInternal::registerCallback ( Callback  cb,
qInternalCallback  callback 
)
static

Definition at line 3633 of file qglobal.cpp.

Referenced by QScriptDebugger::setFrontend().

3634 {
3635  if (cb >= 0 && cb < QInternal::LastCallback) {
3636  QInternal_CallBackTable *cbt = global_callback_table();
3637  cbt->callbacks.resize(cb + 1);
3638  cbt->callbacks[cb].append(callback);
3639  return true;
3640  }
3641  return false;
3642 }
static void callback(AuServer *, AuEventHandlerRec *, AuEvent *e, AuPointer p)
Definition: qsound_x11.cpp:170
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
void append(const T &t)
Inserts value at the end of the vector.
Definition: qvector.h:573
QVector< QList< qInternalCallback > > callbacks
Definition: qglobal.cpp:3628

◆ unregisterCallback()

bool QInternal::unregisterCallback ( Callback  cb,
qInternalCallback  callback 
)
static

Definition at line 3644 of file qglobal.cpp.

Referenced by QScriptDebugger::~QScriptDebugger().

3645 {
3646  if (cb >= 0 && cb < QInternal::LastCallback) {
3647  QInternal_CallBackTable *cbt = global_callback_table();
3648  return (bool) cbt->callbacks[cb].removeAll(callback);
3649  }
3650  return false;
3651 }
static void callback(AuServer *, AuEventHandlerRec *, AuEvent *e, AuPointer p)
Definition: qsound_x11.cpp:170
QVector< QList< qInternalCallback > > callbacks
Definition: qglobal.cpp:3628

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