Results 1 to 3 of 3

Thread: Asap!!!! Qt duck shoot

  1. #1

    Default Asap!!!! Qt duck shoot

    Hello.

    I am trying to create a duck hunt game via QT creator.

    So i need some help.

    I have user interface (background some picture) and now i need to create object ( animated GIF duck flying) <- i dunno how to do this , then to make it show on user interface ( background ) <- also this | and the most important thing i have to make that object move via X axis. ( from 0 to 700 ) and the most important part is that, that i have to make the movement visible -> i want to see moving object via X axis. Also the duck must appear somewhere in Y axis ( from 0 to 100 ) it has to be random appearing and hard thing that the more time pass, the more ducks have to appear in different places on Y axis ant move via X axis.
    Any help is appreciated . Very many thanks. Reply someone as soon as possible.
    I have tried with this. This means to create duck object.
    Qt Code:
    1. void CFrameWnd::SukurtiAnti()
    2. {
    3. // QMovie *movie = new QMovie(":/Antis/paveiksl/duck.gif");
    4. // QLabel *processLabel = new QLabel(this);
    5. // processLabel->setMovie(movie);
    6. // movie->start();
    7. QWidget *antis = new QWidget(this);
    8. // antis->setStyleSheet("background-image: url(:/Antis/paveiksl/duck.gif)");
    9. ui->gridLayout->addWidget(antis);
    10. QPushButton *button = new QPushButton("one");
    11. ui->gridLayout->addWidget(button);
    12. button->setGeometry(20,20,20,20);
    13. button->setStyleSheet("background-image: url(:/Antis/paveiksl/duck.gif)");
    14. antis->show();
    15. }
    To copy to clipboard, switch view to plain text mode 
    First of all i try to create new widget antis then new layout is created to make duck visible on background ( but there isn't and i don't know why) . i tried to make animated gif with movie, but the picture is not shown ... i also tried to create pushbutton but there is no results at all.. So help me with any replies.
    Regards Audrius
    Last edited by high_flyer; 27th April 2011 at 08:14. Reason: code tags

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Asap!!!! Qt duck shoot

    Sounds like a classic case for Qt Quick.
    Have a look at Qt Quick docs for more details.
    http://doc.trolltech.com/4.7/qtquick.html
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Asap!!!! Qt duck shoot

    Or maybe just Graphics View ? You could check out the 'Ported Asteroids' example.

    Why is this so urgent ? Do you have to deliver your homework by the end of the week or so ?

    Regards,
    Marc

Similar Threads

  1. Replies: 1
    Last Post: 20th January 2014, 03:02
  2. Please help ASAP::QColorDialog
    By LiCodeX in forum Newbie
    Replies: 2
    Last Post: 2nd October 2007, 12:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.