Results 1 to 4 of 4

Thread: A simple chess GUI

  1. #1
    Join Date
    Oct 2006
    Posts
    13
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default A simple chess GUI

    Hi.

    I am just starting out learning QT, and really loving it! I have a few very basic questions about using QImage to create a simple chess GUI.

    Say I have a picture of a chess board, and of all the pieces. I now need to somehow define the board as a kind of "background" so that when I move the images of the pieces around on the board, it does not destroy the board-picture. What is the "best" way of doing this in QT? (thinking of semi-fast way of showing, moving and taking away the images of the pieces on top of the board).

    I have looked at QImage and Qpixmap, and have learned that QImage is best suited to load the images of the pieces (and transform them to fit the board's squares), and that Qpixmap probably is my choice for displaying them, but I am a bit stuck on what way is best to add, take away and move them on top of the board?

    Thank you!

    Havard

  2. #2
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: A simple chess GUI

    This sounds like a job for QGraphicsView. This is new in Qt 4.2.0. Check it out.

  3. The following user says thank you to Brandybuck for this useful post:

    Havard (15th October 2006)

  4. #3
    Join Date
    Oct 2006
    Posts
    13
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: A simple chess GUI

    Thank you Brandybuck, I will.

    Any suggestions as how to do it with 4.1.4 as well?

    Havard

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: A simple chess GUI

    Quote Originally Posted by Havard View Post
    Any suggestions as how to do it with 4.1.4 as well?
    Maybe QTableView with custom delegate and model?

  6. The following user says thank you to jacek for this useful post:

    Havard (15th October 2006)

Similar Threads

  1. Simple way to expand all nodes on a QTreeView?
    By cboles in forum Qt Programming
    Replies: 10
    Last Post: 12th April 2014, 16:54
  2. Replies: 4
    Last Post: 10th October 2009, 17:59
  3. QTextEdit simple question
    By Marcopolo in forum Qt Tools
    Replies: 4
    Last Post: 11th October 2007, 00:01
  4. Release my simple program to other users ?
    By probine in forum Qt Programming
    Replies: 9
    Last Post: 9th July 2006, 23:42
  5. can't get a simple dialog working
    By pthomas in forum Newbie
    Replies: 8
    Last Post: 13th January 2006, 14:52

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.