Results 1 to 2 of 2

Thread: QSystemNetworkInfo networkModeChanged freezing

  1. #1
    Join Date
    Jul 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Symbian S60

    Default 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!!!

    I'm using a Nokia N8 and QT 4.7.3 (also tried 4.6.3)

    pro
    Qt Code:
    1. # Allow network access on Symbian
    2. symbian:TARGET.CAPABILITY += NetworkServices
    3.  
    4. # To access current mode
    5. symbian:TARGET.CAPABILITY = ReadDeviceData
    6.  
    7. # If your application uses the Qt Mobility libraries, uncomment
    8. # the following lines and add the respective components to the
    9. # MOBILITY variable.
    10. CONFIG += mobility
    11. MOBILITY = systeminfo
    To copy to clipboard, switch view to plain text mode 

    Header
    Qt Code:
    1. #include <qsysteminfo.h>
    2.  
    3. private:
    4. QSystemNetworkInfo *sysInfo;
    To copy to clipboard, switch view to plain text mode 

    Source
    Qt Code:
    1. sysInfo = new QSystemNetworkInfo(this);
    2.  
    3. connect(sysInfo,SIGNAL(networkModeChanged(QSystemNetworkInfo::NetworkMode)),
    4. this,SLOT(networkModeChanged(QSystemNetworkInfo::NetworkMode)));
    5.  
    6.  
    7.  
    8. void MainWindow::networkModeChanged(QSystemNetworkInfo::NetworkMode mode)
    9. {
    10. qDebug() << mode;
    11. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jul 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Symbian S60

    Default 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
    Qt Code:
    1. // Network Signal Change
    2. connect(sysInfo,SIGNAL(networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode, int)),
    3. this,SLOT(networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode,int)));
    4.  
    5. void MainWindow::networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode mode , int strength)
    6. {
    7. qDebug() << strength;
    8. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. A question about QSystemNetworkInfo
    By Ataul Ghalib in forum Newbie
    Replies: 2
    Last Post: 4th December 2010, 00:17
  2. Reading lots of Data from QProcess without freezing
    By nightghost in forum Qt Programming
    Replies: 12
    Last Post: 27th January 2010, 08:23
  3. Thread freezing GUI
    By TheGrimace in forum Qt Programming
    Replies: 26
    Last Post: 27th June 2007, 15:57

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.