Yes it should. I tried it in a complete new project now and it works fine. But in my it doesn't work. There is no error, no warning. The program crashes before start and if i put the QList declaration in a comment, it works.![]()
Yes it should. I tried it in a complete new project now and it works fine. But in my it doesn't work. There is no error, no warning. The program crashes before start and if i put the QList declaration in a comment, it works.![]()
Ah, you said "I can't compile the code" which usually means there is an error.
Cheers,
_
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.if i put the QList declaration in a comment, it works.
By any chance did you mistakenly add the line
Qt Code:
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.
Okay I don't know how but I solved the problem.Thank You.
Bookmarks