×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Nokia Developer Expert
    Join Date
    Jan 2009
    Posts
    15

    Question networkSignalStrengthChanged explanation, please ;)

    Hello!
    I'm a newbie with QT. Also my C++ is a bit rusty. I've been looking the API's of Mobility but I've a doubt in one:

    void QSystemNetworkInfo::networkSignalStrengthChanged ( QSystemNetworkInfo::NetworkMode mode, int strength ) [signal]
    This signal is emitted whenever the network mode signal strength changes, specified by strength.

    I've tryied to use this signal but I'm not pretty sure how to use it. I don't know what should I write in "int strength".

    For example:
    Code:
      QSystemNetworkInfo red2;
      bool Changed = red2.networkSignalStrengthChanged(QSystemNetworkInfo::WlanMode, int);
    to receive a boolean of if is changed or not?

    Thanks in advance!

    PS: A quick explanation of the signals will be very helpful also

  2. #2
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Brisbane, Australia
    Posts
    18

    Re: networkSignalStrengthChanged explanation, please ;)

    networkSignalStrengthChanged is a signal. You need to create a slot function to connect it to, in order to receive the notifications.

    in your header:

    Code:
    private slots:
        void receivedSignalStrength(QSystemnetworkInfo:NetworkMode, int);
    in your implementation:

    Code:
    void receivedSignalStrength(QSystemnetworkInfo:NetworkMode whichMode, int strength)
    {
        switch whichMode {  
        case WlanMode:  
            qDebug() << "wifi strength changed" << strength;
        break;
        };
    }
    then somewhere else connect it up:

    Code:
    connect(&red2, SIGNAL(networkSignalStrengthChanged(QSystemnetworkInfo:NetworkMode, int)),
        this,SLOT(receivedSignalStrength(QSystemnetworkInfo:NetworkMode, int)));

    More on signals and slots:
    http://doc.trolltech.com/4.6/signalsandslots.html

    If you just want the current signal strength of the connected wifi network you can do:

    Code:
    int strength = red2.networkSignalStrength(QSystemNetworkInfo::WlanMode);
    Code Monkey, QtMobility, Nokia

  3. #3
    Nokia Developer Expert
    Join Date
    Jan 2009
    Posts
    15

    Re: networkSignalStrengthChanged explanation, please ;)

    Thanks for the reply Ipotter. Good explanation. I will try this asap
    Cheers,
    H

  4. #4
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Wink Re: networkSignalStrengthChanged explanation, please ;)

    Or just ask the iPhone guys -- I gather they're experts on the network signal strength thing.

Similar Threads

  1. Signal Strength Explanation
    By Rama1962 in forum Symbian User Interface
    Replies: 0
    Last Post: 2007-12-22, 04:19
  2. I need explanation (Urgent)
    By waelali in forum Symbian
    Replies: 1
    Last Post: 2006-02-03, 19:20
  3. I need an explanation about CBase Panics
    By Marw_Work in forum Symbian
    Replies: 0
    Last Post: 2003-04-22, 10:01
  4. Replies: 1
    Last Post: 2002-11-07, 19:18
  5. Nokia Phones - Need Explanation
    By Nokia_Archive in forum Mobile Java General
    Replies: 1
    Last Post: 2002-05-27, 12:56

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×