Results 1 to 14 of 14

Thread: QML ChartView updates

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2011
    Posts
    81
    Thanks
    6
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default QML ChartView updates

    I am developing a smartphone app (Android & iOS). I have successfully implemented a Chartview and added a lineseries... no problems there...

    However, I would like to update the lineseries on-the-fly... as in, I want to remove the first item and append a new item as data comes in (usually every 2 seconds or so).

    Any ideas or thoughts on doing that? I've reviewed the docs, but don't readily see a way to handle this.
    Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QML ChartView updates

    It seems to have a removeSeries() method: http://doc.qt.io/qt-5/qml-qtcharts-c...eSeries-method

    Cheers,
    _

  3. #3
    Join Date
    May 2011
    Posts
    81
    Thanks
    6
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: QML ChartView updates

    Good Point.
    I'll try using that with adding a new series and see how that will work, although there is no "addSeires"... Maybe 'createSeries' will work.

    Will post back with an update...

  4. #4
    Join Date
    May 2011
    Posts
    81
    Thanks
    6
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: QML ChartView updates

    Using removeSeries and createSeries works for Android.
    For iOS, I get an error about AbstractSeries being undefined... same source code for both.

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QML ChartView updates

    You probably don't have the include paths set up properly for iOS and it can't find the QML where AbstractSeries is defined.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  6. #6
    Join Date
    May 2011
    Posts
    81
    Thanks
    6
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: QML ChartView updates

    QT and Xcode both compile this project without any issues...and run on my testbed iPhone. Everything works except the Qt Charts on iOS.

  7. #7
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QML ChartView updates

    Compiling is probably not the issue. AFAIK, the QML is loaded at runtime, and your error implies that it can't find the base QML where AbstractSeries is defined. Look at how and where you are deploying the QML files and where your app is expecting them to be.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  8. #8
    Join Date
    May 2011
    Posts
    81
    Thanks
    6
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: QML ChartView updates

    My code:

    var wseries = windChart.createSeries(ChartView.SeriesTypeLine, "",axisXw, axisYw);

    ios Error:

    Error: Unknown method return type: QAbstractSeries*

    Thoughts?

  9. #9
    Join Date
    May 2011
    Posts
    81
    Thanks
    6
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: QML ChartView updates

    Anyone have any thoughts?

    D_Stranz, can you elaborate on your idea? I've checked everything I can think of, and it appears to be OK... QT Creator and XCode both compile and seem to 'see' all libraries and headers ok...

  10. #10
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QML ChartView updates

    I don't know what to tell you. When you build and run something under Qt Creator, you are running in a different environment than on the actual device (or in a test bed or on your desktop). Paths are different, the "current directory" is different, and so forth. "QAbstractSeries" is probably defined in a QML file associated with the Qt Charts package, and either you aren't deploying that file on iOS or you aren't deploying it in a search path that QML is using on iOS.

    On my 5.4.1 distribution, "QAbstractSeries" is defined in the qabstractseries.h file down in the Charts source tree, and is referenced as a Component in the plugins.qmltypes file in the chartsqml2 directory.

    Have you followed the instructions on Deploying QML Applications?
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  11. #11
    Join Date
    May 2011
    Posts
    81
    Thanks
    6
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: QML ChartView updates

    Seems that the overall issue was running in Debug mode. Once I switched to a Release mode on iOS, the QAbstractSeries error went away... and the charts worked.

Similar Threads

  1. installing updates
    By uj in forum Installation and Deployment
    Replies: 3
    Last Post: 13th July 2012, 08:15
  2. multithreaded gui updates
    By ugluk in forum Qt Programming
    Replies: 5
    Last Post: 30th September 2011, 17:10
  3. QMenuBar Updates
    By johnmauer in forum Qt Programming
    Replies: 5
    Last Post: 20th January 2010, 13:35
  4. Painting updates
    By QbelcorT in forum Qt for Embedded and Mobile
    Replies: 6
    Last Post: 29th September 2008, 00:48
  5. QDataTable Inserts and Updates
    By ederbs in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2006, 23:23

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.