Qt 4.8
qnlaengine.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "qnlaengine.h"
43 #include "../qnetworksession_impl.h"
44 
45 #include <QtNetwork/private/qnetworkconfiguration_p.h>
46 
47 #include <QtCore/qthread.h>
48 #include <QtCore/qmutex.h>
49 #include <QtCore/qcoreapplication.h>
50 #include <QtCore/qstringlist.h>
51 
52 #include <QtCore/qdebug.h>
53 
54 #include "../platformdefs_win.h"
55 
57 
59 : version(0)
60 {
61  //### should we try for 2.2 on all platforms ??
62  WSAData wsadata;
63 
64  // IPv6 requires Winsock v2.0 or better.
65  if (WSAStartup(MAKEWORD(2,0), &wsadata) != 0) {
66  qWarning("QBearerManagementAPI: WinSock v2.0 initialization failed.");
67  } else {
68  version = 0x20;
69  }
70 }
71 
73 {
74  WSACleanup();
75 }
76 
77 #ifdef BEARER_MANAGEMENT_DEBUG
78 static void printBlob(NLA_BLOB *blob)
79 {
80  qDebug() << "==== BEGIN NLA_BLOB ====";
81 
82  qDebug() << "type:" << blob->header.type;
83  qDebug() << "size:" << blob->header.dwSize;
84  qDebug() << "next offset:" << blob->header.nextOffset;
85 
86  switch (blob->header.type) {
87  case NLA_RAW_DATA:
88  qDebug() << "Raw Data";
89  qDebug() << '\t' << blob->data.rawData;
90  break;
91  case NLA_INTERFACE:
92  qDebug() << "Interface";
93  qDebug() << "\ttype:" << blob->data.interfaceData.dwType;
94  qDebug() << "\tspeed:" << blob->data.interfaceData.dwSpeed;
95  qDebug() << "\tadapter:" << blob->data.interfaceData.adapterName;
96  break;
98  qDebug() << "802.1x Location";
99  qDebug() << '\t' << blob->data.locationData.information;
100  break;
101  case NLA_CONNECTIVITY:
102  qDebug() << "Connectivity";
103  qDebug() << "\ttype:" << blob->data.connectivity.type;
104  qDebug() << "\tinternet:" << blob->data.connectivity.internet;
105  break;
106  case NLA_ICS:
107  qDebug() << "ICS";
108  qDebug() << "\tspeed:" << blob->data.ICS.remote.speed;
109  qDebug() << "\ttype:" << blob->data.ICS.remote.type;
110  qDebug() << "\tstate:" << blob->data.ICS.remote.state;
111  qDebug() << "\tmachine name:" << blob->data.ICS.remote.machineName;
112  qDebug() << "\tshared adapter name:" << blob->data.ICS.remote.sharedAdapterName;
113  break;
114  default:
115  qDebug() << "UNKNOWN BLOB TYPE";
116  }
117 
118  qDebug() << "===== END NLA_BLOB =====";
119 }
120 #endif
121 
123 {
124 #ifdef Q_OS_WINCE
125  Q_UNUSED(interface)
126 #else
127  unsigned long oid;
128  DWORD bytesWritten;
129 
130  NDIS_MEDIUM medium;
131  NDIS_PHYSICAL_MEDIUM physicalMedium;
132 
133  HANDLE handle = CreateFile((TCHAR *)QString::fromLatin1("\\\\.\\%1").arg(interface).utf16(), 0,
134  FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
135  if (handle == INVALID_HANDLE_VALUE)
137 
139  bytesWritten = 0;
140  bool result = DeviceIoControl(handle, IOCTL_NDIS_QUERY_GLOBAL_STATS, &oid, sizeof(oid),
141  &medium, sizeof(medium), &bytesWritten, 0);
142  if (!result) {
143  CloseHandle(handle);
145  }
146 
148  bytesWritten = 0;
149  result = DeviceIoControl(handle, IOCTL_NDIS_QUERY_GLOBAL_STATS, &oid, sizeof(oid),
150  &physicalMedium, sizeof(physicalMedium), &bytesWritten, 0);
151  if (!result) {
152  CloseHandle(handle);
153 
154  if (medium == NdisMedium802_3)
156  else
158  }
159 
160  CloseHandle(handle);
161 
162  if (medium == NdisMedium802_3) {
163  switch (physicalMedium) {
170  default:
171 #ifdef BEARER_MANAGEMENT_DEBUG
172  qDebug() << "Physical Medium" << physicalMedium;
173 #endif
175  }
176  }
177 
178 #ifdef BEARER_MANAGEMENT_DEBUG
179  qDebug() << medium << physicalMedium;
180 #endif
181 
182 #endif
183 
185 }
186 
187 class QNlaThread : public QThread
188 {
189  Q_OBJECT
190 
191 public:
192  QNlaThread(QNlaEngine *parent = 0);
193  ~QNlaThread();
194 
195  QList<QNetworkConfigurationPrivate *> getConfigurations();
196 
197  void forceUpdate();
198 
199 protected:
200  virtual void run();
201 
202 private:
203  void updateConfigurations(QList<QNetworkConfigurationPrivate *> &configs);
204  DWORD parseBlob(NLA_BLOB *blob, QNetworkConfigurationPrivate *cpPriv) const;
205  QNetworkConfigurationPrivate *parseQuerySet(const WSAQUERYSET *querySet) const;
206  void fetchConfigurations();
207 
208 signals:
209  void networksChanged();
210 
211 private:
214  bool done;
216 };
217 
219 : QThread(parent), handle(0), done(false)
220 {
221 }
222 
224 {
225  mutex.lock();
226 
227  done = true;
228 
229  if (handle) {
230  /* cancel completion event */
231  if (WSALookupServiceEnd(handle) == SOCKET_ERROR) {
232 #ifdef BEARER_MANAGEMENT_DEBUG
233  qDebug("WSALookupServiceEnd error %d", WSAGetLastError());
234 #endif
235  }
236  }
237  mutex.unlock();
238 
239  wait();
240 }
241 
243 {
244  QMutexLocker locker(&mutex);
245 
248 
249  return foundConfigurations;
250 }
251 
253 {
254  mutex.lock();
255 
256  if (handle) {
257  /* cancel completion event */
258  if (WSALookupServiceEnd(handle) == SOCKET_ERROR) {
259 #ifdef BEARER_MANAGEMENT_DEBUG
260  qDebug("WSALookupServiceEnd error %d", WSAGetLastError());
261 #endif
262  }
263  handle = 0;
264  }
265  mutex.unlock();
266 }
267 
269 {
270  WSAEVENT changeEvent = WSACreateEvent();
271  if (changeEvent == WSA_INVALID_EVENT)
272  return;
273 
274  while (true) {
276 
277  WSAQUERYSET qsRestrictions;
278 
279  memset(&qsRestrictions, 0, sizeof(qsRestrictions));
280  qsRestrictions.dwSize = sizeof(qsRestrictions);
281  qsRestrictions.dwNameSpace = NS_NLA;
282 
283  mutex.lock();
284  if (done) {
285  mutex.unlock();
286  break;
287  }
288  int result = WSALookupServiceBegin(&qsRestrictions, LUP_RETURN_ALL, &handle);
289  mutex.unlock();
290 
291  if (result == SOCKET_ERROR)
292  break;
293 
294  WSACOMPLETION completion;
295  WSAOVERLAPPED overlapped;
296 
297  memset(&overlapped, 0, sizeof(overlapped));
298  overlapped.hEvent = changeEvent;
299 
300  memset(&completion, 0, sizeof(completion));
301  completion.Type = NSP_NOTIFY_EVENT;
302  completion.Parameters.Event.lpOverlapped = &overlapped;
303 
304  DWORD bytesReturned = 0;
305  result = WSANSPIoctl(handle, SIO_NSP_NOTIFY_CHANGE, 0, 0, 0, 0,
306  &bytesReturned, &completion);
307  if (result == SOCKET_ERROR) {
308  if (WSAGetLastError() != WSA_IO_PENDING)
309  break;
310  }
311 
312 #ifndef Q_OS_WINCE
313  // Not interested in unrelated IO completion events
314  // although we also don't want to block them
315  while (WaitForSingleObjectEx(changeEvent, WSA_INFINITE, true) != WAIT_IO_COMPLETION &&
316  handle)
317  {
318  }
319 #else
320  WaitForSingleObject(changeEvent, WSA_INFINITE);
321 #endif
322 
323  mutex.lock();
324  if (handle) {
325  result = WSALookupServiceEnd(handle);
326  if (result == SOCKET_ERROR) {
327  mutex.unlock();
328  break;
329  }
330  handle = 0;
331  }
332  mutex.unlock();
333  }
334 
335  WSACloseEvent(changeEvent);
336 }
337 
339 {
340  mutex.lock();
341 
342  while (!fetchedConfigurations.isEmpty())
344 
345  fetchedConfigurations = configs;
346 
347  mutex.unlock();
348 
350 }
351 
353 {
354 #ifdef BEARER_MANAGEMENT_DEBUG
355  printBlob(blob);
356 #endif
357 
358  switch (blob->header.type) {
359  case NLA_RAW_DATA:
360 #ifdef BEARER_MANAGEMENT_DEBUG
361  qDebug("%s: unhandled header type NLA_RAW_DATA", __FUNCTION__);
362 #endif
363  break;
364  case NLA_INTERFACE:
366  if (QNlaEngine *engine = qobject_cast<QNlaEngine *>(parent())) {
367  engine->configurationInterface[cpPriv->id.toUInt()] =
368  QString::fromLatin1(blob->data.interfaceData.adapterName);
369  }
370  break;
371  case NLA_802_1X_LOCATION:
372 #ifdef BEARER_MANAGEMENT_DEBUG
373  qDebug("%s: unhandled header type NLA_802_1X_LOCATION", __FUNCTION__);
374 #endif
375  break;
376  case NLA_CONNECTIVITY:
377 #ifdef BEARER_MANAGEMENT_DEBUG
378  qDebug("%s: unhandled header type NLA_CONNECTIVITY", __FUNCTION__);
379 #endif
380  break;
381  case NLA_ICS:
382 #ifdef BEARER_MANAGEMENT_DEBUG
383  qDebug("%s: unhandled header type NLA_ICS", __FUNCTION__);
384 #endif
385  break;
386  default:
387 #ifdef BEARER_MANAGEMENT_DEBUG
388  qDebug("%s: unhandled header type %d", __FUNCTION__, blob->header.type);
389 #endif
390  ;
391  }
392 
393  return blob->header.nextOffset;
394 }
395 
396 QNetworkConfigurationPrivate *QNlaThread::parseQuerySet(const WSAQUERYSET *querySet) const
397 {
399 
400  cpPriv->name = QString::fromWCharArray(querySet->lpszServiceInstanceName);
401  cpPriv->isValid = true;
402  cpPriv->id = QString::number(qHash(QLatin1String("NLA:") + cpPriv->name));
405 
406 #ifdef BEARER_MANAGEMENT_DEBUG
407  qDebug() << "size:" << querySet->dwSize;
408  qDebug() << "service instance name:" << QString::fromUtf16(querySet->lpszServiceInstanceName);
409  qDebug() << "service class id:" << querySet->lpServiceClassId;
410  qDebug() << "version:" << querySet->lpVersion;
411  qDebug() << "comment:" << QString::fromUtf16(querySet->lpszComment);
412  qDebug() << "namespace:" << querySet->dwNameSpace;
413  qDebug() << "namespace provider id:" << querySet->lpNSProviderId;
414  qDebug() << "context:" << QString::fromUtf16(querySet->lpszContext);
415  qDebug() << "number of protocols:" << querySet->dwNumberOfProtocols;
416  qDebug() << "protocols:" << querySet->lpafpProtocols;
417  qDebug() << "query string:" << QString::fromUtf16(querySet->lpszQueryString);
418  qDebug() << "number of cs addresses:" << querySet->dwNumberOfCsAddrs;
419  qDebug() << "cs addresses:" << querySet->lpcsaBuffer;
420  qDebug() << "output flags:" << querySet->dwOutputFlags;
421 #endif
422 
423  if (querySet->lpBlob) {
424 #ifdef BEARER_MANAGEMENT_DEBUG
425  qDebug() << "blob size:" << querySet->lpBlob->cbSize;
426  qDebug() << "blob data:" << querySet->lpBlob->pBlobData;
427 #endif
428 
429  DWORD offset = 0;
430  do {
431  NLA_BLOB *blob = reinterpret_cast<NLA_BLOB *>(querySet->lpBlob->pBlobData + offset);
432  DWORD nextOffset = parseBlob(blob, cpPriv);
433  if (nextOffset == offset)
434  break;
435  else
436  offset = nextOffset;
437  } while (offset != 0 && offset < querySet->lpBlob->cbSize);
438  }
439 
440  if (QNlaEngine *engine = qobject_cast<QNlaEngine *>(parent())) {
441  const QString interface = engine->getInterfaceFromId(cpPriv->id);
442  cpPriv->bearerType = qGetInterfaceType(interface);
443  }
444 
445  return cpPriv;
446 }
447 
449 {
450  QList<QNetworkConfigurationPrivate *> foundConfigurations;
451 
452  WSAQUERYSET qsRestrictions;
453  HANDLE hLookup = 0;
454 
455  memset(&qsRestrictions, 0, sizeof(qsRestrictions));
456  qsRestrictions.dwSize = sizeof(qsRestrictions);
457  qsRestrictions.dwNameSpace = NS_NLA;
458 
459  int result = WSALookupServiceBegin(&qsRestrictions, LUP_RETURN_ALL | LUP_DEEP, &hLookup);
460  if (result == SOCKET_ERROR) {
461  mutex.lock();
463  mutex.unlock();
464  }
465 
466  char buffer[0x10000];
467  while (result == 0) {
468  DWORD bufferLength = sizeof(buffer);
469  result = WSALookupServiceNext(hLookup, LUP_RETURN_ALL,
470  &bufferLength, reinterpret_cast<WSAQUERYSET *>(buffer));
471 
472  if (result == SOCKET_ERROR)
473  break;
474 
476  parseQuerySet(reinterpret_cast<WSAQUERYSET *>(buffer));
477 
478  foundConfigurations.append(cpPriv);
479  }
480 
481  if (hLookup) {
482  result = WSALookupServiceEnd(hLookup);
483  if (result == SOCKET_ERROR) {
484 #ifdef BEARER_MANAGEMENT_DEBUG
485  qDebug("WSALookupServiceEnd error %d", WSAGetLastError());
486 #endif
487  }
488  }
489 
490  updateConfigurations(foundConfigurations);
491 }
492 
494 : QBearerEngineImpl(parent), nlaThread(0)
495 {
496  nlaThread = new QNlaThread(this);
498  this, SLOT(networksChanged()));
499  nlaThread->start();
500 
502 }
503 
505 {
506  delete nlaThread;
507 }
508 
510 {
511  QMutexLocker locker(&mutex);
512 
513  QStringList previous = accessPointConfigurations.keys();
514 
516  while (!foundConfigurations.isEmpty()) {
517  QNetworkConfigurationPrivate *cpPriv = foundConfigurations.takeFirst();
518 
519  previous.removeAll(cpPriv->id);
520 
521  if (accessPointConfigurations.contains(cpPriv->id)) {
523 
524  bool changed = false;
525 
526  ptr->mutex.lock();
527 
528  if (ptr->isValid != cpPriv->isValid) {
529  ptr->isValid = cpPriv->isValid;
530  changed = true;
531  }
532 
533  if (ptr->name != cpPriv->name) {
534  ptr->name = cpPriv->name;
535  changed = true;
536  }
537 
538  if (ptr->state != cpPriv->state) {
539  ptr->state = cpPriv->state;
540  changed = true;
541  }
542 
543  ptr->mutex.unlock();
544 
545  if (changed) {
546  locker.unlock();
548  locker.relock();
549  }
550 
551  delete cpPriv;
552  } else {
554 
555  accessPointConfigurations.insert(ptr->id, ptr);
556 
557  locker.unlock();
559  locker.relock();
560  }
561  }
562 
563  while (!previous.isEmpty()) {
565  accessPointConfigurations.take(previous.takeFirst());
566 
567  locker.unlock();
569  locker.relock();
570  }
571 
572  locker.unlock();
574 }
575 
577 {
578  QMutexLocker locker(&mutex);
579 
580  return configurationInterface.value(id.toUInt());
581 }
582 
584 {
585  QMutexLocker locker(&mutex);
586 
587  return configurationInterface.contains(id.toUInt());
588 }
589 
591 {
593 }
594 
596 {
598 }
599 
601 {
602  QMutexLocker locker(&mutex);
603 
605 }
606 
608 {
609  QMutexLocker locker(&mutex);
610 
612 
613  if (!ptr)
615 
616  if (!ptr->isValid) {
620  } else if ((ptr->state & QNetworkConfiguration::Discovered) ==
625  } else if ((ptr->state & QNetworkConfiguration::Undefined) ==
628  }
629 
631 }
632 
633 QNetworkConfigurationManager::Capabilities QNlaEngine::capabilities() const
634 {
636 }
637 
639 {
640  return new QNetworkSessionPrivateImpl;
641 }
642 
644 {
646 }
647 
648 #include "qnlaengine.moc"
650 
BearerType
Specifies the type of bearer used by a configuration.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qstring.cpp:6448
static QString fromWCharArray(const wchar_t *, int size=-1)
Returns a copy of the string, where the encoding of string depends on the size of wchar...
Definition: qstring.cpp:1019
uint qHash(const QProcEnvKey &key)
Definition: qprocess_p.h:96
QMap< uint, QString > configurationInterface
Definition: qnlaengine.h:107
void connectToId(const QString &id)
Definition: qnlaengine.cpp:590
void updateConfigurations(QList< QNetworkConfigurationPrivate *> &configs)
Definition: qnlaengine.cpp:338
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
void lock()
Locks the mutex.
Definition: qmutex.cpp:151
The QMutex class provides access serialization between threads.
Definition: qmutex.h:60
#define IOCTL_NDIS_QUERY_GLOBAL_STATS
friend class QNlaThread
Definition: qnlaengine.h:79
QNetworkConfiguration::StateFlags state
void configurationChanged(QNetworkConfigurationPrivatePointer config)
void disconnectFromId(const QString &id)
Definition: qnlaengine.cpp:595
QList< QNetworkConfigurationPrivate * > getConfigurations()
Definition: qnlaengine.cpp:242
DWORD parseBlob(NLA_BLOB *blob, QNetworkConfigurationPrivate *cpPriv) const
Definition: qnlaengine.cpp:352
#define SLOT(a)
Definition: qobjectdefs.h:226
QNetworkConfigurationPrivate * parseQuerySet(const WSAQUERYSET *querySet) const
Definition: qnlaengine.cpp:396
void unlock()
Unlocks this mutex locker.
Definition: qmutex.h:117
void updateCompleted()
State
This enum describes the connectivity state of the session.
QNlaThread * nlaThread
Definition: qnlaengine.h:106
bool hasIdentifier(const QString &id)
Definition: qnlaengine.cpp:583
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
void networksChanged()
Definition: qnlaengine.cpp:509
DWORD nextOffset
struct NLA_BLOB::@336::@340 ICS
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
NDIS_PHYSICAL_MEDIUM
static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interface)
Definition: qnlaengine.cpp:122
#define OID_GEN_PHYSICAL_MEDIUM
QNetworkConfigurationManager::Capabilities capabilities() const
Definition: qnlaengine.cpp:633
NLA_BLOB_DATA_TYPE type
QNetworkSession::State sessionStateForId(const QString &id)
Definition: qnlaengine.cpp:607
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QList< QNetworkConfigurationPrivate * > fetchedConfigurations
Definition: qnlaengine.cpp:215
void relock()
Relocks an unlocked mutex locker.
Definition: qmutex.h:125
Q_CORE_EXPORT void qDebug(const char *,...)
#define SIGNAL(a)
Definition: qobjectdefs.h:227
CHAR rawData[1]
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
struct NLA_BLOB::@336::@337 interfaceData
void forceUpdate()
Definition: qnlaengine.cpp:252
QHash< QString, QNetworkConfigurationPrivatePointer > accessPointConfigurations
union NLA_BLOB::@336 data
T takeFirst()
Removes the first item in the list and returns it.
Definition: qlist.h:489
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
#define qApp
const T value(const Key &key) const
Returns the value associated with the key key.
Definition: qmap.h:499
#define emit
Definition: qobjectdefs.h:76
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
void configurationAdded(QNetworkConfigurationPrivatePointer config)
Q_CORE_EXPORT void qWarning(const char *,...)
QNlaThread(QNlaEngine *parent=0)
Definition: qnlaengine.cpp:218
QNetworkConfigurationPrivatePointer defaultConfiguration()
Definition: qnlaengine.cpp:643
const T * ptr(const T &t)
void clear()
Removes all items from the list.
Definition: qlist.h:764
void * HANDLE
Definition: qnamespace.h:1671
QNetworkSessionPrivate * createSessionBackend()
Definition: qnlaengine.cpp:638
HANDLE handle
Definition: qnlaengine.cpp:213
void unlock()
Unlocks the mutex.
Definition: qmutex.cpp:296
NDIS_MEDIUM
#define Q_OBJECT
Definition: qobjectdefs.h:157
struct NLA_BLOB::@335 header
virtual void run()
The starting point for the thread.
Definition: qnlaengine.cpp:268
QString getInterfaceFromId(const QString &id)
Definition: qnlaengine.cpp:576
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
Definition: qmutex.h:101
QExplicitlySharedDataPointer< QNetworkConfigurationPrivate > QNetworkConfigurationPrivatePointer
struct NLA_BLOB::@336::@338 locationData
QNetworkConfiguration::Type type
void fetchConfigurations()
Definition: qnlaengine.cpp:448
void start(Priority=InheritPriority)
Begins execution of the thread by calling run().
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
QObject * parent() const
Returns a pointer to the parent object.
Definition: qobject.h:273
bool wait(unsigned long time=ULONG_MAX)
Blocks the thread until either of these conditions is met:
void configurationRemoved(QNetworkConfigurationPrivatePointer config)
uint toUInt(bool *ok=0, int base=10) const
Returns the string converted to an unsigned int using base base, which is 10 by default and must be b...
Definition: qstring.cpp:6120
bool contains(const Key &key) const
Returns true if the map contains an item with key key; otherwise returns false.
Definition: qmap.h:553
Q_INVOKABLE void requestUpdate()
Definition: qnlaengine.cpp:600
QFuture< T > run(Function function,...)
#define OID_GEN_MEDIA_SUPPORTED
void connectionError(const QString &id, QBearerEngineImpl::ConnectionError error)
void networksChanged()
#define signals
Definition: qobjectdefs.h:69
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
#define NS_NLA
struct NLA_BLOB::@336::@339 connectivity
static QString fromUtf16(const ushort *, int size=-1)
Returns a QString initialized with the first size characters of the Unicode string unicode (ISO-10646...
Definition: qstring.cpp:4329
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
QNlaEngine(QObject *parent=0)
Definition: qnlaengine.cpp:493
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770
QMutex mutex
Definition: qnlaengine.cpp:212