Hi, I'm new to QT but come from C#, I've been writing a application which needs the current mode, GSM or WCDMA. It works, and will quite happily work for 24 hours +. The problem is to simulate network drops / mode changes I was putting my N8 in and out of power saving mode, it's a bit brutal, but a easy way to swap the phone between 2G/3G. Most of the time it swaps over and the app reports the new mode, but occasionally it reports its on GSM even though its on WCDMA, you can then swap as many times as you like and it'll always report 'mode 1' which is GSM.
It's a bog standard networkModeChanged SIGNAL copied from an example.
Once it's locked up, I tried looking at the QSystemNetworkInfo currentMode() and this also reports '1' (GSM) for both 2G and 3G.
I'd be really greatfull if someone would point out something stupid I've done OR if there's a easy way to unlock it. Thanks!!!
I'm using a Nokia N8 and QT 4.7.3 (also tried 4.6.3)
pro
# Allow network access on Symbian
symbian:TARGET.CAPABILITY += NetworkServices
# To access current mode
symbian:TARGET.CAPABILITY = ReadDeviceData
# If your application uses the Qt Mobility libraries, uncomment
# the following lines and add the respective components to the
# MOBILITY variable.
CONFIG += mobility
MOBILITY = systeminfo
# Allow network access on Symbian
symbian:TARGET.CAPABILITY += NetworkServices
# To access current mode
symbian:TARGET.CAPABILITY = ReadDeviceData
# If your application uses the Qt Mobility libraries, uncomment
# the following lines and add the respective components to the
# MOBILITY variable.
CONFIG += mobility
MOBILITY = systeminfo
To copy to clipboard, switch view to plain text mode
Header
#include <qsysteminfo.h>
private:
QSystemNetworkInfo *sysInfo;
#include <qsysteminfo.h>
private:
QSystemNetworkInfo *sysInfo;
To copy to clipboard, switch view to plain text mode
Source
sysInfo = new QSystemNetworkInfo(this);
connect(sysInfo,SIGNAL(networkModeChanged(QSystemNetworkInfo::NetworkMode)),
this,SLOT(networkModeChanged(QSystemNetworkInfo::NetworkMode)));
void MainWindow::networkModeChanged(QSystemNetworkInfo::NetworkMode mode)
{
qDebug() << mode;
}
sysInfo = new QSystemNetworkInfo(this);
connect(sysInfo,SIGNAL(networkModeChanged(QSystemNetworkInfo::NetworkMode)),
this,SLOT(networkModeChanged(QSystemNetworkInfo::NetworkMode)));
void MainWindow::networkModeChanged(QSystemNetworkInfo::NetworkMode mode)
{
qDebug() << mode;
}
To copy to clipboard, switch view to plain text mode
Bookmarks