QSystemNetworkInfo networkModeChanged freezing
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!!! :D
I'm using a Nokia N8 and QT 4.7.3 (also tried 4.6.3)
pro
Code:
# 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
Header
Code:
#include <qsysteminfo.h>
private:
QSystemNetworkInfo *sysInfo;
Source
Code:
sysInfo = new QSystemNetworkInfo(this);
connect(sysInfo,SIGNAL(networkModeChanged(QSystemNetworkInfo::NetworkMode)),
this,SLOT(networkModeChanged(QSystemNetworkInfo::NetworkMode)));
void MainWindow::networkModeChanged(QSystemNetworkInfo::NetworkMode mode)
{
qDebug() << mode;
}
Re: QSystemNetworkInfo networkModeChanged freezing
I left it running all night, the mode hadn't locked by the morning, that only seems to happen randomly when switching between 2G and 3G, but I noticed the networkSignalStrength had frozen at 100 (%), as with the networkModeChanged signal, I lifted it straight from the examples. I've tested it on two of friends N8s and they too get the occasional freezing modes / Signal Strength.
Anyone got any ideas? :)
I can detect frozen mode in the code, then I thought I'd write a seperate bit of code to delete the object and rebuild it which should bring it back to life, but I can't figure out a way of detecting the frozen Signal Strength. :(
Source
Code:
// Network Signal Change
connect(sysInfo,SIGNAL(networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode, int)),
this,SLOT(networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode,int)));
void MainWindow::networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode mode , int strength)
{
qDebug() << strength;
}