Results 1 to 2 of 2
Hi all, basically I have a problem with the random selection of variables. Im going to explain fast my code. Basically is a BLackjack, made in QT, and im trying ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-09-2010 #1
- Join Date
- Dec 2010
Random selection of variables
basically I have a problem with the random selection of variables. Im going to explain fast my code. Basically is a BLackjack, made in QT, and im trying to connect one Button with the movement animation of a RANDOM card selected previously.
The connection lines are like these:
QStateMachine *machine = new QStateMachine;
QState *state1 = new QState(machine);
state1->assignProperty(c1, "geometry", (QRect(610,190,102,137)));
there are other lines needed to compile properly, but so far I can explain my problem. The red variable c1, is the card in QT (The A of Spades) but I need to select from all the other cards, so with rand and srand, I can do that with no problems, and lets say I numbered my cards from c1 -> c52 and I got the card c6.
My question is, how do I "copy" that c6, in that space in red??
Thanks in advance.
- 12-10-2010 #2
- Join Date
- Apr 2009
- I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
Please provide the signature for the QState::assignProperty() method you are using. You say you want the value c6 returned where you show c1?Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!