[solved] deal cards and add to the scene
-
Just allocate your Cards on the heap and not on the stack
-
I tried that, although I still can't remove copy and assignment operator constructors without getting the same error..
-
Because somewhere in your code you are doing a copy. Are you using a QList<Card> or something similar ?
-
I saw your reply in my other post and I indeed did do copies by using vector. I'm changing my code around now.
Check this line @ vector<Card*> * player = new vector<Card*>; @ Is it correct? And if so, how do I iterate through player? I'm getting a little confused with all these pointers.
-
Just use vector<Card *> player, there's no need of a pointer for the vector
-
@
for (vector<Card*>::iterator iter = player.begin();
iter != player.end(); ++iter)
{
qDebug() << iter->GetSuit()
}
@How do I call GetSuit() function? This is obviously incorrect
-
With
@(*iter)->GetSuit();@
You should be good
-
Tried it before I asked :) But I get an error: "expression must have pointer-to-class type"
-
Sorry, there was a mistake in my code example
-
Ah, simple as that. Works like a charm :)
-
Yes, sometimes it's a simple thing :) But can be hard to track down :-D