Qt 4.8
Public Functions | Public Variables | Private Functions | Static Private Functions | List of all members
QDeclarativeDebugServerPrivate Class Reference
Inheritance diagram for QDeclarativeDebugServerPrivate:
QObjectPrivate QObjectData

Public Functions

void advertisePlugins ()
 
 QDeclarativeDebugServerPrivate ()
 
- 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

QStringList clientPlugins
 
QDeclarativeDebugServerConnectionconnection
 
bool gotHello
 
QHash< QString, QDeclarativeDebugService * > plugins
 
QString waitingForMsgFromService
 
bool waitingForMsgSucceeded
 
- 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
 

Private Functions

void _q_deliverMessage (const QString &serviceName, const QByteArray &message)
 

Static Private Functions

static QDeclarativeDebugServerConnectionloadConnectionPlugin (QPluginLoader *loader, const QString &pluginName)
 

Additional Inherited Members

- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
- 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 81 of file qdeclarativedebugserver.cpp.

Constructors and Destructors

◆ QDeclarativeDebugServerPrivate()

QDeclarativeDebugServerPrivate::QDeclarativeDebugServerPrivate ( )

Definition at line 102 of file qdeclarativedebugserver.cpp.

102  :
103  connection(0),
104  gotHello(false),
106 {
107 }
QDeclarativeDebugServerConnection * connection

Functions

◆ _q_deliverMessage()

void QDeclarativeDebugServerPrivate::_q_deliverMessage ( const QString serviceName,
const QByteArray message 
)
private

Definition at line 338 of file qdeclarativedebugserver.cpp.

339 {
341  if (iter == plugins.end()) {
342  qWarning() << "QDeclarativeDebugServer: Message received for missing plugin" << serviceName;
343  } else {
344  (*iter)->messageReceived(message);
345  }
346 }
QHash< QString, QDeclarativeDebugService * > plugins
Q_CORE_EXPORT void qWarning(const char *,...)
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:467
The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash.
Definition: qhash.h:330
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
Definition: qhash.h:865

◆ advertisePlugins()

void QDeclarativeDebugServerPrivate::advertisePlugins ( )

Definition at line 109 of file qdeclarativedebugserver.cpp.

110 {
111  if (!gotHello)
112  return;
113 
114  QByteArray message;
115  {
116  QDataStream out(&message, QIODevice::WriteOnly);
117  out << QString(QLatin1String("QDeclarativeDebugClient")) << 1 << plugins.keys();
118  }
119  connection->send(message);
120 }
virtual void send(const QByteArray &message)=0
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QHash< QString, QDeclarativeDebugService * > plugins
The QString class provides a Unicode character string.
Definition: qstring.h:83
QDeclarativeDebugServerConnection * connection
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71
QList< Key > keys() const
Returns a list containing all the keys in the hash, in an arbitrary order.
Definition: qhash.h:648

◆ loadConnectionPlugin()

QDeclarativeDebugServerConnection * QDeclarativeDebugServerPrivate::loadConnectionPlugin ( QPluginLoader loader,
const QString pluginName 
)
staticprivate

Definition at line 122 of file qdeclarativedebugserver.cpp.

Referenced by QDeclarativeDebugServer::instance().

124 {
125 #ifndef QT_NO_LIBRARY
126  QStringList pluginCandidates;
128  foreach (const QString &libPath, paths) {
129  const QDir dir(libPath + QLatin1String("/qmltooling"));
130  if (dir.exists()) {
131  QStringList plugins(dir.entryList(QDir::Files));
132  foreach (const QString &pluginPath, plugins) {
133  if (QFileInfo(pluginPath).fileName().contains(pluginName))
134  pluginCandidates << dir.absoluteFilePath(pluginPath);
135  }
136  }
137  }
138 
139  foreach (const QString &pluginPath, pluginCandidates) {
140  loader->setFileName(pluginPath);
141  if (!loader->load()) {
142  continue;
143  }
145  if (QObject *instance = loader->instance())
146  connection = qobject_cast<QDeclarativeDebugServerConnection*>(instance);
147 
148  if (connection)
149  return connection;
150  loader->unload();
151  }
152 #endif
153  return 0;
154 }
The QDir class provides access to directory structures and their contents.
Definition: qdir.h:58
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.h:904
bool load()
Loads the plugin and returns true if the plugin was loaded successfully; otherwise returns false...
QString fileName() const
Returns the name of the file, excluding the path.
Definition: qfileinfo.cpp:726
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QHash< QString, QDeclarativeDebugService * > plugins
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
void setFileName(const QString &fileName)
static QStringList libraryPaths()
Returns a list of paths that the application will search when dynamically loading libraries...
QDeclarativeDebugServerConnection * connection
QObject * instance()
Returns the root component object of the plugin.
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:60
bool unload()
Unloads the plugin and returns true if the plugin could be unloaded; otherwise returns false...

Properties

◆ clientPlugins

QStringList QDeclarativeDebugServerPrivate::clientPlugins

Definition at line 91 of file qdeclarativedebugserver.cpp.

◆ connection

QDeclarativeDebugServerConnection* QDeclarativeDebugServerPrivate::connection

◆ gotHello

bool QDeclarativeDebugServerPrivate::gotHello

Definition at line 92 of file qdeclarativedebugserver.cpp.

Referenced by advertisePlugins().

◆ plugins

QHash<QString, QDeclarativeDebugService *> QDeclarativeDebugServerPrivate::plugins

Definition at line 90 of file qdeclarativedebugserver.cpp.

Referenced by advertisePlugins(), and loadConnectionPlugin().

◆ waitingForMsgFromService

QString QDeclarativeDebugServerPrivate::waitingForMsgFromService

Definition at line 93 of file qdeclarativedebugserver.cpp.

◆ waitingForMsgSucceeded

bool QDeclarativeDebugServerPrivate::waitingForMsgSucceeded

Definition at line 94 of file qdeclarativedebugserver.cpp.


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