Results 1 to 11 of 11

Thread: Using ICONs as PushButtons

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2010
    Location
    Bangalore, India
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Using ICONs as PushButtons

    I am developing a simple GUI application using Qt 4.5 (on a windows PC).

    I wanted to make a cute push button using my own icons.

    I tried using the QPushButton class and a simple image as a pixmap. I could always see a rectangular outline around the icon, whenever it was clicked.
    How to do away with that.

    I also created a QIcon object with two icons (*.png files) one for the state: "Normal" and the other for the state: "Selected". (Refer the attachments).
    But couldnt get the clue on how to link the push button states to these icons.

    So, now my questions are:
    1. How to use image files like *.png, to create a custom push button (without getting the rectangular outline)
    2. Is it always a must to use QPushButton class for this, OR do we have an alternative for realizing the above?

    - Sudhakaran
    Attached Images Attached Images

Similar Threads

  1. Three pushButtons in a shape of one
    By Kenji_Takahashi in forum Qt Programming
    Replies: 13
    Last Post: 7th September 2009, 19:25
  2. Where to get Icons from
    By pospiech in forum General Discussion
    Replies: 4
    Last Post: 19th December 2008, 21:14
  3. Pushbuttons with fixed aspect ratios?
    By WinchellChung in forum Newbie
    Replies: 3
    Last Post: 19th December 2007, 18:38
  4. Problems connecting PushButtons
    By Randulf in forum Newbie
    Replies: 3
    Last Post: 23rd August 2006, 14:39
  5. (Qt 4) QTreeview and Icons?
    By pinktroll in forum Qt Programming
    Replies: 4
    Last Post: 17th August 2006, 16:06

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
  •  
Qt is a trademark of The Qt Company.