Results 1 to 4 of 4

Thread: Accessing C++ Model via QML throws error: ListElement: cannot use script for property

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2021
    Posts
    6
    Qt products
    Qt5

    Default Re: Accessing C++ Model via QML throws error: ListElement: cannot use script for prop

    Quote Originally Posted by peppermg View Post
    QML doesn't know what std::string* is. https://doc.qt.io/qt-5/qtqml-cppinte...-qt-data-types
    Thanks, but same error with QString*. I think there is no way to use the static ListElement in QML. Maybe it is not allowed to change the values inside ListModel: https://www.ics.com/webinar/vbhdsgjashgd at Minute 3:35. Or is it possible somehow anyway?

  2. #2
    Join Date
    Dec 2008
    Posts
    18
    Thanks
    4
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Accessing C++ Model via QML throws error: ListElement: cannot use script for prop

    It also won't know what a QString * is, don't use pointers here. I am not sure what your end goal is with this, but look at sub-classing QAbstractListModel. https://doc.qt.io/qt-5/qtquick-model...model-subclass

Similar Threads

  1. Accessing model's QQmlListProperty property in QML
    By ElDiabloComputatore in forum Qt Quick
    Replies: 3
    Last Post: 12th December 2014, 07:20
  2. Qt 5 QSystemTrayIcon throws error message on Mac OS X
    By janusz in forum Qt Programming
    Replies: 1
    Last Post: 24th March 2013, 14:55
  3. Replies: 1
    Last Post: 8th February 2012, 02:13
  4. Replies: 0
    Last Post: 22nd April 2011, 10:20
  5. qt script property
    By wookoon in forum Qt Programming
    Replies: 2
    Last Post: 28th September 2010, 10:41

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
  •  
Qt is a trademark of The Qt Company.