Results 1 to 3 of 3

Thread: Qt Picture change

  1. #1
    Join Date
    Sep 2009
    Location
    china
    Posts
    13
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qt Picture change

    I would like to achieve the picture as button, when the mouse moves to the location of the picture, the picture switches into another picture. Please help me, is there any example lend me refer to the following? Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Qt Picture change

    Set a image to QPushButton and use css :hover to change the image by qproperty-icon. Or subclass QLabel/QWidget/QPushButton, and reimp QWidget::enterEvent() and QWidget::leaveEvent() to change the image.

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

    Raymond (22nd February 2010)

  4. #3
    Join Date
    Sep 2009
    Location
    china
    Posts
    13
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Picture change

    Quote Originally Posted by Lykurg View Post
    Set a image to QPushButton and use css :hover to change the image by qproperty-icon. Or subclass QLabel/QWidget/QPushButton, and reimp QWidget::enterEvent() and QWidget::leaveEvent() to change the image.
    Thank you very much!

Similar Threads

  1. Getting Chart as picture
    By codeman in forum Qt Programming
    Replies: 4
    Last Post: 24th November 2009, 12:39
  2. can't load picture
    By aoo7wangyan in forum Qt Programming
    Replies: 9
    Last Post: 13th July 2009, 14:59
  3. Picture on a button
    By zgulser in forum Qt Tools
    Replies: 4
    Last Post: 13th January 2009, 04:03
  4. resize a picture
    By omega36 in forum Qt Programming
    Replies: 2
    Last Post: 9th January 2009, 14:34
  5. change picture size
    By raphaelf in forum Newbie
    Replies: 1
    Last Post: 27th November 2006, 18:15

Tags for this Thread

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.