Results 1 to 3 of 3

Thread: connecting image to a pushbutton

  1. #1
    Join Date
    Nov 2007
    Posts
    42
    Thanks
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Post connecting image to a pushbutton

    Hello all, i wanted to put a image on a pushbutton(i mean pushbutton is hide under a image)
    so when i click on the image, hided pushbutton should be activated and perform some task

    for this process i had made a design in Qt Designer like this
    1)selected a pushbutton and enlarge that size
    2)selected a label widget and kept it on the pushbutton and in properties editor specify the image file in pixmap property

    so now i confusing about, how to link image (on label) to the hided pushbutton?????????

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: connecting image to a pushbutton

    You're not doing it correctly.
    You can create a push button that is flat and with an image. There's no need to put a label with an image on top of it.

    Or, subclass QLabel and create a clicked() signal that you emit in its mousePressEvent(). You can then create a QLabel in designer and promote it to your custom class.

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

    sudheer (4th December 2007)

  4. #3
    Join Date
    Nov 2007
    Posts
    42
    Thanks
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Post Re: connecting image to a pushbutton

    i solved my problem, it is simple

    i just put the pushbutton on a form and in property editor,select 'icon' property and chandged it to my favourite image file and in 'iconsize' property changed the size

    importantly disable the 'text' property on pushbutton

Similar Threads

  1. Finding marks on scanned image for alignment
    By caduel in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2007, 02:10
  2. Explanation to Image Formats
    By sincnarf in forum Qt Programming
    Replies: 13
    Last Post: 6th July 2007, 17:02
  3. Help needed handling image data
    By toratora in forum General Programming
    Replies: 2
    Last Post: 11th May 2007, 09:24
  4. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 16:36
  5. Question about updating an image on screen
    By SkripT in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2006, 19:01

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.