×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Oct 2011
    Location
    Petrozavodsk
    Posts
    6

    Problem with QSystemBatteryInfo

    Hello developers.
    I have a problem with usage QSystemBatteryInfo library. Functions of this library return -1 everytime (error). Below is a sample of my code:

    Code:
       QSystemBatteryInfo *binfo = new QSystemBatteryInfo();
        int cur = binfo->currentFlow();
        // cur everytime is -1
    Where are my errors?

  2. #2
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: Problem with QSystemBatteryInfo

    Check the Note and Warning in the detailed Description here : http://doc.qt.nokia.com/qtmobility-1...tteryinfo.html

    regards,
    rahul

  3. #3
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Problem with QSystemBatteryInfo

    I am not sure, but may be because of you connected your device with laptop/desktop and it is currently charging. The API documentation says "a negative flow means charging".

    currentFlow : const int
    This property holds the battery current flow.
    Returns the amount of current flowing out from the battery, in milliapmeres (mA). A positive flow means discharging, a negative flow means charging, and 0 is returned if on error or information is not available.

  4. #4
    Registered User
    Join Date
    Oct 2011
    Location
    Petrozavodsk
    Posts
    6

    Re: Problem with QSystemBatteryInfo

    Quote Originally Posted by savaj View Post
    I am not sure, but may be because of you connected your device with laptop/desktop and it is currently charging. The API documentation says "a negative flow means charging".
    I have compared values. Despite charging this function returns -1.
    May be you know code samples which use QSystemBatteryInfo functions?

  5. #5
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Problem with QSystemBatteryInfo

    Disconnect device with charger/data cable and then test application.
    Last edited by savaj; 2011-11-15 at 13:34.

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: Problem with QSystemBatteryInfo

    Looks there is a bug.
    I just create one for Qt team
    https://bugreports.qt.nokia.com/browse/QTMOBILITY-1954
    Let's follow this one

  7. #7
    Registered User
    Join Date
    Oct 2011
    Location
    Petrozavodsk
    Posts
    6

    Re: Problem with QSystemBatteryInfo

    OK.
    I look forward news.

Posting Permissions

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