Results 1 to 16 of 16

Thread: QAbstractListModel data to QML TableView why not shown through QQmlApplicationEngine

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: QAbstractListModel data to QML TableView why not shown through QQmlApplicationEng

    In CashRegister::buttonPressed() you are accessing the member "linemodel", which is never initialized.
    An uninitialized pointer can point to anywhere, in most cases any attempt to access it will cause a crash.

    Your problem, as pointed out earlier, is in line 11 of your constructor.
    Instead of using a local variable, it should be initializing the member.

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    kiwimess (14th September 2015)

  3. #2
    Join Date
    Sep 2015
    Posts
    9
    Thanks
    3
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Android

    Default Re: QAbstractListModel data to QML TableView why not shown through QQmlApplicationEng

    Qt Code:
    1. linemodel = new LineModel;
    To copy to clipboard, switch view to plain text mode 
    It works! (I'm dancing here )
    Thank you very much Anda for your help!

Similar Threads

  1. QQuickView or QQmlApplicationEngine or QQuickWidget
    By ustulation in forum Qt Quick
    Replies: 0
    Last Post: 18th January 2015, 13:16
  2. QQmlApplicationEngine crashing (QT5 and VS 2010)
    By leonardo.massei in forum Qt Programming
    Replies: 0
    Last Post: 28th January 2014, 13:09
  3. Replies: 1
    Last Post: 20th October 2011, 10:08
  4. Replies: 4
    Last Post: 5th March 2010, 14:20
  5. getting data from tableView
    By mkarakaplan in forum Newbie
    Replies: 1
    Last Post: 7th November 2007, 09:51

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.