QGraphicsItem->type() crush
hi,
I'm trying to go over all the Graphics Scene's items, I'm printing out their x and y. and it's all working well... but when I call the type() function it's crushing...
I'm not the one who implemented the graphics item, I don't even have the code...
I just have a scene and I want to understand its structure...
I know about at least one item that the type() call is working without crushing...
and it returns different number each run... last time it was 2425260... that's quite huge... isn't it?
The UserType is 65536. so 2425260 isn't realy a number I can consider true... even more when this numbers change each run...
THANKS for any clue
Gil.
Re: QGraphicsItem->type() crush
2425260 is a perfectly good type() value, so that in itself is not the problem. If the program is crashing when you access a QGraphicsItem then how are you getting the type() value? You are probably using a null or otherwise invalid pointer that you think points to a QGraphicsItem.
Re: QGraphicsItem->type() crush
The list of QGraphicsItems is taken from QGraphicsScene.items().
The list contains about 200 items. all of them have a valid x and y...
When I try to access the first item's type() function. I crush.
When I try to access some other item's type() function I get different number each run.
Now getting different number each run points to the fact that something in wrong. isn't it hard-coded into the class?
What can I do?
Gil.
Re: QGraphicsItem->type() crush
Provide a working, compilable and minimal example demonstrating the problem.
Does this happen with a custom graphics item?
The problem might be in your graphics item subclass if you're trying to call a parent or other object that is not a valid pointer.
The type of a specific item should always be the same. Since the numbers jump randomly, that too is a sign of "corrupted" memory (as in, accessing memory you shouldn't access which happens with incorrect use of pointers).
Re: QGraphicsItem->type() crush
It could be that the type() method is incorrectly reimplemented in a custom subclass of QGraphicsItem and returns some bogus value. One needs to take a look at the source code of custom items used in the scene.
Re: QGraphicsItem->type() crush
My code is a dll that I inject into a running QT application.
Currently everything works (Like getting the QWidgets, QGraphicView, Item's x and y etc) except for that type() that's crushing the main QT application.
Any idea? say anything you think might cause the problem, I'll check it.
Re: QGraphicsItem->type() crush
Are you another person trying to hack into the poker software?
Re: QGraphicsItem->type() crush
hack sounds bad... I'm writing a software that will help users with their poker game.
Yeap me too... anyone else?
Re: QGraphicsItem->type() crush
Quote:
Originally Posted by
gilamran
Yeap me too... anyone else?
Yes, every script kiddy that thinks he can get rich by doing so.
Re: QGraphicsItem->type() crush
hoo what a lovely person.
I'm a software developer for 15 years now, poker is one of my biggest hobbies, and I know all the software for poker out there, and I'm missing many things...
Thought that it would be great to write something that will help me improve my game.
Thanks anyways
Re: QGraphicsItem->type() crush
Quote:
Originally Posted by
gilamran
hoo what a lovely person.
I'm a software developer for 15 years now, poker is one of my biggest hobbies, and I know all the software for poker out there, and I'm missing many things...
Thought that it would be great to write something that will help me improve my game.
Did you check if you are not in violation with the software licence before trying to hack into the system?