Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unable to get the qt creator qt components quickstart example working

    QML and Qt Quick
    3
    7
    2554
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      krishmav last edited by

      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 value 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-snapshot/creator-qml-components-example.html
      Can anyone help me solve the problem.

      1 Reply Last reply Reply Quote 0
      • R
        Rahul Das last edited by

        The link you have provided is broken :(


          Rahul Das
        

        1 Reply Last reply Reply Quote 0
        • K
          krishmav last edited by

          my apologies. but i think admin has corrected the link now.

          1 Reply Last reply Reply Quote 0
          • R
            Rahul Das last edited by

            You tried with the script : runOutOfBattery.qs, right ?


              Rahul Das
            

            1 Reply Last reply Reply Quote 0
            • K
              krishmav last edited by

              yep, i tried both runOutofBattery.qs and changing it manually in simulator. for both of them, changes are not reflected in progressbar value. I also tested it on symbian device. same problem. so i am guessing somehow i am not able to connect the signal. btw were u able to get it right on your machine.

              1 Reply Last reply Reply Quote 0
              • R
                Rahul Das last edited by

                No, i haven't tried on the device yet.


                  Rahul Das
                

                1 Reply Last reply Reply Quote 0
                • T
                  Tslv last edited by

                  I am having problem with this too. I am using Qt SDK 1.1.4 that comes with Qt 4.7.4
                  Progress bar is showing the correct percentage of the battery on startup. I guess that is because of this part of the code
                  @ProgressBar {
                  ...
                  value: deviceinfo.batteryLevel
                  }@

                  And it is not changing on battery level change. I guess it is because of this code:
                  @
                  DeviceInfo {
                  id: deviceinfo

                       Component.onCompleted: {
                           deviceinfo.startBatteryLevelChanged();
                       }
                       onBatteryLevelChanged: {
                            progressbar1.value = batteryLevel
                        }@
                  

                  I have managed to google out that deviceinfo.startBatteryLevelChanged() should be replaced with the property in QtMobility 1.2
                  http://doc.qt.nokia.com/qtmobility/qml-deviceinfo.html#details
                  So I have changed the code to
                  @DeviceInfo {
                  id:deviceinfo
                  Component.onCompleted:{
                  monitorBatteryLevelChanges: true
                  }
                  onBatteryLevelChanged: {
                  progressbar1.value= batteryLevel
                  }
                  }
                  @
                  It still doesn't work.

                  My question is:
                  When does onBatteryLevelChanged function gets called? When I press F1 on it there is no help (No documentation available).
                  How can I make my progress bar refresh?

                  Qt Video Tutorials
                  http://www.youtube.com/user/MobileDevVT/videos
                  More learning materials
                  http://mobiledevvt.blogspot.com/

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post