本文整理汇总了C++中QNetworkConfigurationManagerPrivate类的典型用法代码示例。如果您正苦于以下问题:C++ QNetworkConfigurationManagerPrivate类的具体用法?C++ QNetworkConfigurationManagerPrivate怎么用?C++ QNetworkConfigurationManagerPrivate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QNetworkConfigurationManagerPrivate类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: locker
QNetworkConfigurationManagerPrivate *qNetworkConfigurationManagerPrivate()
{
QNetworkConfigurationManagerPrivate *ptr = connManager_ptr.loadAcquire();
int shutdown = appShutdown.loadAcquire();
if (!ptr && !shutdown) {
static QBasicMutex connManager_mutex;
QMutexLocker locker(&connManager_mutex);
if (!(ptr = connManager_ptr.loadAcquire())) {
ptr = new QNetworkConfigurationManagerPrivate;
if (QCoreApplicationPrivate::mainThread() == QThread::currentThread()) {
// right thread or no main thread yet
ptr->addPreAndPostRoutine();
ptr->initialize();
} else {
// wrong thread, we need to make the main thread do this
QObject *obj = new QObject;
QObject::connect(obj, SIGNAL(destroyed()), ptr, SLOT(addPreAndPostRoutine()), Qt::DirectConnection);
ptr->initialize(); // this moves us to the right thread
obj->moveToThread(QCoreApplicationPrivate::mainThread());
obj->deleteLater();
}
connManager_ptr.storeRelease(ptr);
}
}
return ptr;
}
示例2: qNetworkConfigurationManagerPrivate
/*!
Returns the capabilities supported by the current platform.
*/
QNetworkConfigurationManager::Capabilities QNetworkConfigurationManager::capabilities() const
{
QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate();
if (priv)
return priv->capabilities();
return QNetworkConfigurationManager::Capabilities(0);
}
示例3: onlineStateChanged
/*!
Returns \c true if the system is considered to be connected to another device via an active
network interface; otherwise returns \c false.
This is equivalent to the following code snippet:
\snippet code/src_network_bearer_qnetworkconfigmanager.cpp 0
\sa onlineStateChanged()
*/
bool QNetworkConfigurationManager::isOnline() const
{
QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate();
if (priv)
return priv->isOnline();
return false;
}
示例4: all
/*!
Returns the list of configurations which comply with the given \a filter.
By default this function returns all (defined and undefined) configurations.
A wireless network with a particular SSID may only be accessible in a
certain area despite the fact that the system has a valid configuration
for it. Therefore the filter flag may be used to limit the list to
discovered and possibly connected configurations only.
If \a filter is set to zero this function returns all possible configurations.
Note that this function returns the states for all configurations as they are known at
the time of this function call. If for instance a configuration of type WLAN is defined
the system may have to perform a WLAN scan in order to determine whether it is
actually available. To obtain the most accurate state updateConfigurations() should
be used to update each configuration's state. Note that such an update may require
some time. It's completion is signalled by updateCompleted(). In the absence of a
configuration update this function returns the best estimate at the time of the call.
Therefore, if WLAN configurations are of interest, it is recommended that
updateConfigurations() is called once after QNetworkConfigurationManager
instantiation (WLAN scans are too time consuming to perform in constructor).
After this the data is kept automatically up-to-date as the system reports
any changes.
*/
QList<QNetworkConfiguration> QNetworkConfigurationManager::allConfigurations(QNetworkConfiguration::StateFlags filter) const
{
QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate();
if (priv)
return priv->allConfigurations(filter);
return QList<QNetworkConfiguration>();
}
示例5: updateConfigurations
/*!
Returns the default configuration to be used. This function always returns a discovered
configuration; otherwise an invalid configuration.
In some cases it may be required to call updateConfigurations() and wait for the
updateCompleted() signal before calling this function.
\sa allConfigurations()
*/
QNetworkConfiguration QNetworkConfigurationManager::defaultConfiguration() const
{
QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate();
if (priv)
return priv->defaultConfiguration();
return QNetworkConfiguration();
}
示例6: connManager_cleanup
static void connManager_cleanup()
{
// this is not atomic or thread-safe!
int shutdown = appShutdown.fetchAndStoreAcquire(1);
Q_ASSERT(shutdown == 0);
Q_UNUSED(shutdown);
QNetworkConfigurationManagerPrivate *cmp = connManager_ptr.fetchAndStoreAcquire(0);
if (cmp)
cmp->cleanup();
}
示例7: connManager
QNetworkConfigurationManagerPrivate *qNetworkConfigurationManagerPrivate()
{
static bool initialized = false;
QNetworkConfigurationManagerPrivate *m = connManager();
if (!initialized) {
initialized = true;
m->updateConfigurations();
}
return m;
}
示例8: QObject
/*!
Constructs a QNetworkConfigurationManager with the given \a parent.
*/
QNetworkConfigurationManager::QNetworkConfigurationManager( QObject* parent )
: QObject(parent)
{
QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate();
connect(priv, SIGNAL(configurationAdded(QNetworkConfiguration)),
this, SIGNAL(configurationAdded(QNetworkConfiguration)));
connect(priv, SIGNAL(configurationRemoved(QNetworkConfiguration)),
this, SIGNAL(configurationRemoved(QNetworkConfiguration)));
connect(priv, SIGNAL(configurationUpdateComplete()),
this, SIGNAL(updateCompleted()));
connect(priv, SIGNAL(onlineStateChanged(bool)),
this, SIGNAL(onlineStateChanged(bool)));
connect(priv, SIGNAL(configurationChanged(QNetworkConfiguration)),
this, SIGNAL(configurationChanged(QNetworkConfiguration)));
priv->enablePolling();
}
示例9: updateCompleted
/*!
Initiates an update of all configurations. This may be used to initiate WLAN scans or other
time consuming updates which may be required to obtain the correct state for configurations.
This call is asynchronous. On completion of this update the updateCompleted() signal is
emitted. If new configurations are discovered or old ones were removed or changed the update
process may trigger the emission of one or multiple configurationAdded(),
configurationRemoved() and configurationChanged() signals.
If a configuration state changes as a result of this update all existing QNetworkConfiguration
instances are updated automatically.
\sa allConfigurations()
*/
void QNetworkConfigurationManager::updateConfigurations()
{
QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate();
if (priv)
priv->performAsyncConfigurationUpdate();
}
示例10: iapRemoved
void IapMonitor::iapRemoved(const QString &iap_id)
{
QString id = iap_id;
d->deleteConfiguration(id);
}