index out of range
-
@mrjj said in index out of range:
well im asking if you hit f5 debug and have break point at the main.cpp first line.
Yes i'm running in DEBUG (F5) and i have break point in first line of my main()
@mrjj said in index out of range:
right click on items and ask where it being used and see if any does
oritems.at(x)items is used exclusively in void preProcessFile(QString filepath) function
@LeLev said in index out of range:
preProcessFile
Then cant you set break point where you call
preProcessFile(xx) and single step withf10F11 into it to see what line that makes it crash ? -
@LeLev said in index out of range:
preProcessFile
Then cant you set break point where you call
preProcessFile(xx) and single step withf10F11 into it to see what line that makes it crash ?@mrjj said in index out of range:
cant you
i want to, but my app crashes as soon i hit f5 or start in debug mod btn
-
@mrjj said in index out of range:
cant you
i want to, but my app crashes as soon i hit f5 or start in debug mod btn
-
@LeLev
Ok, could be something wrong with the visual studio install and the crash is not related to
your code as such. -
@LeLev
for some reason if i change my compiler from msvc to minGW i can now run in DEBUG mod !
For whatever your Qt project is, are you saying you can & do freely switch compilers between MSVC & minGW? So you have Qt, and whatever other libraries you use, available for both and it doesn't matter to you which compiler you use? You shouldn't be switching compilers just to magically get your debugging to work right now.
Surely, you need to decide on one compiler or the other (and being able to debug always reliably is vital) and then do all your development with that?
-
@LeLev
for some reason if i change my compiler from msvc to minGW i can now run in DEBUG mod !
For whatever your Qt project is, are you saying you can & do freely switch compilers between MSVC & minGW? So you have Qt, and whatever other libraries you use, available for both and it doesn't matter to you which compiler you use? You shouldn't be switching compilers just to magically get your debugging to work right now.
Surely, you need to decide on one compiler or the other (and being able to debug always reliably is vital) and then do all your development with that?
@JonB said in index out of range:
For whatever your Qt project is, are you saying you can & do freely switch compilers between MSVC & minGW?
@JonB said in index out of range:
So you have Qt, and whatever other libraries you use, available for both and it doesn't matter to you which compiler you use?
yes I am my own boss and I do what I want, i can recompile my libs with needed compiler
@JonB said in index out of range:
You shouldn't be switching compilers just to magically get your debugging to work right now.
why not ? you have 2 'equivalent tools' one is broken, what you do ?
@JonB said in index out of range:
Surely, you need to decide on one compiler or the other (and being able to debug always reliably is vital) and then do all your development with that?
yes ?
-
@JonB said in index out of range:
For whatever your Qt project is, are you saying you can & do freely switch compilers between MSVC & minGW?
@JonB said in index out of range:
So you have Qt, and whatever other libraries you use, available for both and it doesn't matter to you which compiler you use?
yes I am my own boss and I do what I want, i can recompile my libs with needed compiler
@JonB said in index out of range:
You shouldn't be switching compilers just to magically get your debugging to work right now.
why not ? you have 2 'equivalent tools' one is broken, what you do ?
@JonB said in index out of range:
Surely, you need to decide on one compiler or the other (and being able to debug always reliably is vital) and then do all your development with that?
yes ?
-
@JonB said in index out of range:
For whatever your Qt project is, are you saying you can & do freely switch compilers between MSVC & minGW?
@JonB said in index out of range:
So you have Qt, and whatever other libraries you use, available for both and it doesn't matter to you which compiler you use?
yes I am my own boss and I do what I want, i can recompile my libs with needed compiler
@JonB said in index out of range:
You shouldn't be switching compilers just to magically get your debugging to work right now.
why not ? you have 2 'equivalent tools' one is broken, what you do ?
@JonB said in index out of range:
Surely, you need to decide on one compiler or the other (and being able to debug always reliably is vital) and then do all your development with that?
yes ?
@LeLev said in index out of range:
why not ? you have 2 'equivalent tools' one is broken, what you do ?
I've personally found 2 bugs in MSVC and about that many in gcc (one of which I even reported), however I'm pretty sure neither is "broken". Please provide a stack trace from the crash (and yes the error is in the user code, everything QList is inlined).
-
@JonB said in index out of range:
For whatever your Qt project is, are you saying you can & do freely switch compilers between MSVC & minGW?
@JonB said in index out of range:
So you have Qt, and whatever other libraries you use, available for both and it doesn't matter to you which compiler you use?
yes I am my own boss and I do what I want, i can recompile my libs with needed compiler
@JonB said in index out of range:
You shouldn't be switching compilers just to magically get your debugging to work right now.
why not ? you have 2 'equivalent tools' one is broken, what you do ?
@JonB said in index out of range:
Surely, you need to decide on one compiler or the other (and being able to debug always reliably is vital) and then do all your development with that?
yes ?
@LeLev have you tried start and break on main option ?
F10 on Windows
-
@LeLev
well im asking if you hit f5 debug and have break point at the main.cpp first line.
(in main function)
if it goes there as else its a global var that does it.You can also try on the
QList<PosItem> items;
right click on items and ask where it being used and see if any does
oritems.at(x)hi
@mrjj said in index out of range:oritems.at(x)sorry i said i never do this calls,but in the lib itself there is that call. Just after closing the file writePath() is called:
void RenderItemList::writePath(QPainter& painter, bool updatedFromFile) { QPainterPath path; ItemToBase *item = list.at(0); // << crash here item->setParams(scale, windowSize.height(), offsetx, offsety);
erros
# else RaiseFailFastException(nullptr, nullptr, 0); # endif qt_message_fatal(QtFatalMsg, context, message); { Q_ASSERT_X(i >= 0 && i < p.size(), "QList<T>::at", "index out of range");
i saw ind debug mod that list was empty .. i initialised it after reading the file, now everything works correctly.
thank you for help
-
hi
@mrjj said in index out of range:oritems.at(x)sorry i said i never do this calls,but in the lib itself there is that call. Just after closing the file writePath() is called:
void RenderItemList::writePath(QPainter& painter, bool updatedFromFile) { QPainterPath path; ItemToBase *item = list.at(0); // << crash here item->setParams(scale, windowSize.height(), offsetx, offsety);
erros
# else RaiseFailFastException(nullptr, nullptr, 0); # endif qt_message_fatal(QtFatalMsg, context, message); { Q_ASSERT_X(i >= 0 && i < p.size(), "QList<T>::at", "index out of range");
i saw ind debug mod that list was empty .. i initialised it after reading the file, now everything works correctly.
thank you for help