Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Unable to get the qt creator qt components quickstart example working
QtWS25 Last Chance

Unable to get the qt creator qt components quickstart example working

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 3 Posters 2.8k Views
  • 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 Offline
    K Offline
    krishmav
    wrote on last edited by
    #1

    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
    0
    • R Offline
      R Offline
      Rahul Das
      wrote on last edited by
      #2

      The link you have provided is broken :(


      Declaration of (Platform) independence.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        krishmav
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • R Offline
          R Offline
          Rahul Das
          wrote on last edited by
          #4

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


          Declaration of (Platform) independence.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            krishmav
            wrote on last edited by
            #5

            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
            0
            • R Offline
              R Offline
              Rahul Das
              wrote on last edited by
              #6

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


              Declaration of (Platform) independence.

              1 Reply Last reply
              0
              • T Offline
                T Offline
                Tslv
                wrote on last edited by
                #7

                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
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved