Results 1 to 5 of 5

Thread: Using QList data from other .cpp file

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Using QList data from other .cpp file

    Are you referring to the same QList from both processingfile.cpp and mainwindow.cpp?

    Also you should declare as "QList<FinalData> finaldata" in processingfile.cpp
    and
    declare as "extern QList<FinalData> finaldata" in mainwindow.cpp, note the extern keyword.

    I'm sure the QList is populated as i've tried to print out the data in the QList using qDebug in the cpp file which i've processed the data.
    You need to check/print the QList just before the painting/plotting in the mainwidow.cpp
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

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

    kango (13th February 2013)

Similar Threads

  1. QList of variable data type?
    By Phlucious in forum Qt Programming
    Replies: 13
    Last Post: 2nd December 2011, 00:25
  2. Replies: 3
    Last Post: 8th June 2011, 06:36
  3. How to view data stored in Qmap or QList
    By sankar in forum Newbie
    Replies: 6
    Last Post: 17th February 2011, 09:30
  4. QList custom data format
    By sureshkvl in forum Qt Programming
    Replies: 1
    Last Post: 13th October 2010, 13:26
  5. Replies: 4
    Last Post: 20th August 2010, 13:54

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.