Qt6Core Assert fail on array copy...
-
Hey
Welp this is fun one.
Im trying to copy
void handleData(const QVector<QSharedPointer<myClass>>&myitems)
in to a struct that gets added to a vector, like >vector.append({10,20,myItems}
and I get this error :ASSERT: "dp.freeSpaceAtEnd() >= n" in file C:\Qt\6.2.1\msvc2019_64\include\QtCore/qarraydatapointer.h, line 233
It's save to say I have no idea what to do o.o. I never had anything like that before.
Any1, any hints?
TIA
Update.
I cant even dovector.append({10,20,{}});
o.o -
@ChrisW67 said in Qt6Core Assert fail on array copy...:
How is
vector
declared and what does the code that generates the exception actually look like?You debugger backtrace should tell exactly which line of your source code triggered the error.
Yeh, that what normally happens. This one is odd aff!
H.
class someObject : public QObject{ Q_OBJECT struct helperData{ int s; int d; QVector<QSharedPointer<objectX>> itemList; } QVector<helperData> mHelpers;
then cpp.
mHelpers.append(helperData{0,0,{}});
And here is the error. I'm a bit like O.O
It even happens with std::vector O.O what the heee....
-
Ok I found it.
This is bananas o.o.
Here is a rough example of what is breaking my c++, I even replaced mHelpers with QVector<int> and that was breaking too.
Essentially I havepublic header.h : inherits baseHeader(public) class private headerPrivate.h : inherits baseHeaderPrivate class
and I made
headerPrivate :public QObject, public baseHeaderPrivate {}
& Q_OBJECT macro.
Now for some reason that has broken down my members/other objects. No idea why, maybe because I have Private in name? OR what/why? No clue. I removed QObject/Macro and vectors started to work O.O
Seem that having it only as QObject without macro can cause it to go bananas.I'm working on public/private api of my own app & using QBjects where I need to. I never before used QObject on my private header tho before. So this is new and WEIRD. Any hints/ideas?
Hmmm maybe coz my private header could use similar member/function declaration as to QT ones, I have to dig in to qt macros maybe I'm overriding some members there & causing it all to go bananas o.oTIA
-
Provide a minimal, compilable example where it crashes - everything else is just guessing.