Results 1 to 3 of 3

Thread: Display images and move them

  1. #1
    Join Date
    Feb 2010
    Posts
    10
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Display images and move them

    Hello,
    I am developing a checkers game for Mac and Win.
    I am displaying each piece in a QLabel in the following way
    Qt Code:
    1. QLabel *piece = new QLabel("piece",this);
    2. piece->setPixmap(QPixmap("piece.png"));
    To copy to clipboard, switch view to plain text mode 
    Now I have to display kings and I would like to overlap two images (piece.png) in the same QLabel because I have to move the two pieces (king) together in my animations. How can I do that?

    Tx a lot!!
    Last edited by AL; 11th February 2010 at 11:09.

  2. #2
    Join Date
    Feb 2010
    Posts
    10
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Display images and move them

    sorry this was not the right section. I created the new post in the right area "QT Programming"

  3. #3
    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: Display images and move them

    I don't think you can avoid creating a custom widget, which takes multiple pixmaps.
    Either that, or merge the two images in to one image with a graphics editing application and use that as your pixmap.
    ==========================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.

Similar Threads

  1. Application doesn't display images
    By satoshi in forum Qt Programming
    Replies: 3
    Last Post: 2nd January 2010, 11:33
  2. Move QT Window to different x display
    By jbpvr in forum Qt Programming
    Replies: 1
    Last Post: 5th September 2007, 20:28
  3. Display animated images
    By suresh in forum Qt Programming
    Replies: 1
    Last Post: 27th January 2007, 21:53
  4. How to display images in QTextBrowser ?
    By probine in forum Qt Programming
    Replies: 1
    Last Post: 12th January 2007, 08:58
  5. how to display full tree item name on mouse move ?
    By rajesh in forum Qt Programming
    Replies: 5
    Last Post: 15th November 2006, 08:41

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.