Results 1 to 2 of 2

Thread: qt creator qt components quickstart example doest work for me

  1. #1
    Join Date
    Sep 2011
    Posts
    2
    Qt products
    Qt3
    Platforms
    Windows Symbian S60

    Default qt creator qt components quickstart example doest work for me

    Hi,

    I am new to QML. I was testing the quickstart example in Qt creator 2.3 titled "Creating a Qt Quick Application Using Qt Quick Components", but the progressbar doesnt change when battery level changes in Qt Simulator. Progressbar shows correct value initially, but doesnt reflect the changes according to battery level. I think i am not able to set up the signal properly. Here is the online link to the example : http://doc.qt.nokia.com/qtcreator-sn...s-example.html.
    Can anyone help me solve the problem.

    krish

  2. #2
    Join Date
    Aug 2010
    Location
    Romania
    Posts
    1
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: qt creator qt components quickstart example doest work for me

    Yes... This is not a good example to start with...

    I decided too to switch from "classic" widgets to Qt Quick (so kindda newbie here). But as Qt Quick is in big/rapid development there are changes/breaks into code/documentation between QtMobility 1.1 and QtMobility 1.2 (at least in documentation and it seems in libraries as code doesn't work)...

    QtMobility 1.2 example:
    http://doc.qt.nokia.com/qtmobility-1...o.html#details

    QtMobility 1.1 example:
    http://doc.qt.nokia.com/qtmobility-1...o.html#details

    So in 1.1 to tell system to send signals to your app you should use start* methods:
    Detailed Description

    This element is part of the QtMobility.systeminfo 1.1 module. It is a convience class to make QML usage easier.

    Note: To use notification signals, you need to use the start* slots.

    Component.onCompleted: {
    deviceinfo.startPowerStateChanged();
    deviceinfo.startBatteryLevelChanged();
    }
    But in 1.2, you should use monitor* methods:

    Detailed Description

    This element is part of the QtMobility.systeminfo 1.1 module. It is a convience class to make QML usage easier.

    Note: To use notification signals, you need to set the monitor* properties to true.
    Even if it's said in docs that:

    monitorBatteryLevelChanges : bool read-only

    Use the monitorBatteryLevelChanges signal.
    monitorBatteryLevelChanges is a read-only property it can really be assigned a bool value. So in order to fix the example you should change:


    Component.onCompleted: {
    //deviceinfo.startBatteryLevelChanged();
    deviceinfo.monitorBatteryLevelChanges = true;
    }

Similar Threads

  1. qt creator - breakpoints don't work
    By pmitas in forum Newbie
    Replies: 16
    Last Post: 8th September 2010, 11:53
  2. Replies: 2
    Last Post: 16th May 2010, 17:15
  3. New to Qt. Qt components in different licenses
    By charlywrx in forum Newbie
    Replies: 1
    Last Post: 6th January 2010, 10:54
  4. ui components
    By addu in forum Qt Programming
    Replies: 0
    Last Post: 17th September 2009, 15:49

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.