Application crashes while accessing Pointers and while Hovering over custom QGraphicsItems
-
@mrjj Hey, if i put the breakpoint where you implied it does not even get to the breakpoint and I only get the segfault (see above in screenshot) again.
Even after commenting // ellipse1->checkPointers(); out it still behaves the same way while debugging.
However when starting the application it starts now without crashing immediately (after taking out / ellipse1->checkPointers();), it only crashes once I hover over the objects.
But I'll try to find the position where it crashes and I'll update this message or post another reply once I know.
-
Hi,
The stack trace you posted seems to be from a release build. Can you share the stack trace from your debug build ?
-
Hi! Thanks again for your replies and your interest in my current problem.
I'm not quite sure if I did this the correct way, but I think I figured out how to get what you asked and I hope that this information is what you've been looking for.This should be the call stack from my debug build (at least I hope it is :'D):
1 ntdll!RtlGetCurrentServiceSessionId 0x77ae4cd9 2 ?? 0xb80afd3f 3 ?? 0x1ef069b0 4 ntdll!RtlFreeHeap 0x77ae3812 5 ntdll!RtlpNtSetValueKey 0x77b82ea1 6 ntdll!RtlGetCurrentServiceSessionId 0x77ae3c45 7 ?? 0x1ef069b8 8 ntdll!RtlFreeHeap 0x77ae3812 9 msvcrt!free 0x76a070b5 10 ?? 0x1f0000 11 QWindowsFontDatabase::releaseHandle qwindowsfontdatabase.cpp 1601 0x62a928b6 12 QtFontStyle::~QtFontStyle qfontdatabase.cpp 234 0x1372329 13 QtFontFoundry::~QtFontFoundry qfontdatabase.cpp 303 0x138530c 14 QtFontFamily::~QtFontFamily qfontdatabase.cpp 365 0x1375138 15 QFontDatabasePrivate::free qfontdatabase.cpp 482 0x13a8915 16 QFontDatabasePrivate::~QFontDatabasePrivate qfontdatabase.cpp 470 0x13a89af 17 (anonymous namespace)::Q_QGS_privateDb::Holder::~Holder qfontdatabase.cpp 720 0x1121bed 18 __tcf_0 qfontdatabase.cpp 720 0x1121c0a 19 _CRT_INIT *12 0x10511b4 20 __DllMainCRTStartup 0x1051325 21 DllMainCRTStartup *12 0x1051433 22 ntdll!RtlCheckTokenCapability 0x77b0a896 23 ntdll!RtlHashUnicodeString 0x77ae01a6 24 ntdll!LdrShutdownProcess 0x77ad458d 25 ??
I hope this helps. Enjoy your weekend and thanks again!
-
@Lanparty said in Application crashes while accessing Pointers and while Hovering over custom QGraphicsItems:
void Slice::hoverEnterEvent(QGraphicsSceneHoverEvent *) { if (text.isNull()) return; QString percentageAsString = QString::number(int(this->getPercentage())); text.data()->setPlainText(this->category + " " + percentageAsString + "% "); int xOffset = int(rect().x() + rect().width()/2); int yOffset = int(rect().y() + rect().height()/2); QPointF newCenterPoint = QPointF(this->pos().x()+ xOffset, this->pos().y() + yOffset); QPointF textPoint = newCenterPoint; textPoint.setX(this->x() + 100); text.data()->setPos(textPoint); text.data()->setVisible(true); }
so, I actually managed to find out where my application crashed. The problem was this line:
text.data()->setPlainText(this->category + " " + percentageAsString + "% ");
once I checked the expected parameters it kind of made sense. I'll try to find another way to achieve the string I originally wanted to be displayed.
-
Do you mean you were missing the
text.isNull()
check ? -
@SGaist No, that's the first thing I did inside the method. However, I simply assumed that I could use the method setPlainText() as I pleased, but it was expecting other arguments and crashed instead (I guess because the QString text would've been longer than the original one.
btw: how do I change the status of my post to "solved"?
-
@Lanparty said in Application crashes while accessing Pointers and while Hovering over custom QGraphicsItems:
btw: how do I change the status of my post to "solved"?
First post, Topic Tools button to the side.