Results 1 to 6 of 6

Thread: Can't compile QList<struct>

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: Can't compile QList<struct>

    if i put the QList declaration in a comment, it works.
    Which means you are not referencing that QList<> variable *anywhere else* in your MainWindow code, right? Otherwise, the code wouldn't compile in the first place.

    By any chance did you mistakenly add the line

    Qt Code:
    1. QList<ParameterLevel> TabList;
    To copy to clipboard, switch view to plain text mode 

    somewhere in your MainWindow constructor (thus declaring a variable *local* to the scope of the constructor that hides the member variable of the same name)? If so, then your member variable remains unchanged, and if you try to access something from it, you get a segmentation fault and a crash.

    Please teach yourself the meanings of "compiling", "linking", and "executing" code. If code doesn't compile, you have no compiled objects and nothing to link. If compiled objects don't link, then you have nothing to execute. Only once you get a correctly compiled and linked executable do you have something to run (and possibly crash).
    Last edited by d_stranz; 3rd November 2015 at 21:51.

  2. #2
    Join Date
    Oct 2015
    Posts
    50
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Can't compile QList<struct>

    Okay I don't know how but I solved the problem. Thank You.

Similar Threads

  1. QList<struct>
    By Axsis in forum Newbie
    Replies: 11
    Last Post: 12th October 2015, 07:48
  2. Replies: 2
    Last Post: 8th May 2014, 09:28
  3. remove struct from qlist
    By mero in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2012, 14:58
  4. How to fill a QList<struct> ?
    By falconium in forum Newbie
    Replies: 1
    Last Post: 1st March 2011, 21:59
  5. Qt 3 to Qt 4 port: QList compile errors
    By Amanda in forum Qt Programming
    Replies: 4
    Last Post: 10th November 2006, 05:45

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.