Find the answer to your Linux question:
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.
  1. #1
    Just Joined!
    Join Date
    Dec 2010
    Posts
    1

    Random selection of variables


    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 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)));
    machine->setInitialState(state1);

    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.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,665
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •