Results 1 to 4 of 4

Thread: Qt3 Memory game

  1. #1
    Join Date
    Dec 2007
    Posts
    2
    Thanks
    1

    Default Qt3 Memory game

    Can anyone help how to code a memory game in qt using c++.
    Game is, there are 30 pics closed. when you click one of them it open(shows the pic) then another one is clicked to open. if they are the same they left open. otherwise closed.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt3 Memory game

    Have you already tried anything? Is using Qt3 a requirement or can you use Qt4? Is it a school assignment?

  3. #3
    Join Date
    Dec 2007
    Posts
    2
    Thanks
    1

    Default Re: Qt3 Memory game

    I tried to put a pushbutton with the image and hide the image. then show it when it is clicked. it does not work.
    actually it is a school assigment.
    i am using qt3, not allowed to use qt4

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt3 Memory game

    If it is a school assignment, we can't help you too much with it or else you will not learn anything. I can advise you to consider using QCanvas to visualize your game board or create a custom widget that will handle the board. If you override proper events, you'll be able to react on mouse clicks, changing the images the way you want.

    You can also use a minimalistic approach and have 30 buttons inside a layout and change pixmaps associated with those buttons when the user clicks one of them.

  5. The following user says thank you to wysota for this useful post:

    rjk (6th December 2007)

Similar Threads

  1. Memory leak?
    By Enygma in forum Qt Programming
    Replies: 10
    Last Post: 4th September 2007, 16:24
  2. Memory Leak in my Application :-(
    By Svaths in forum Qt Programming
    Replies: 4
    Last Post: 27th July 2007, 19:42
  3. Memory Problem with SIGNALS and SLOTS
    By ^NyAw^ in forum Qt Programming
    Replies: 1
    Last Post: 19th March 2007, 20:39
  4. saving a c string of variable length in a shared memory?
    By nass in forum General Programming
    Replies: 4
    Last Post: 3rd January 2007, 14:40

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.