Results 1 to 2 of 2

Thread: Non quadrangular PushBotton Icon

  1. #1
    Join Date
    Apr 2014
    Posts
    3

    Default Non quadrangular PushBotton Icon

    I wanted to use a jpg as a pushbutton. However, the picture is always quadrangular.
    Is it possible to customize the size and make it rectengular?

    Qt Code:
    1. ui.pushButton->setIcon(QIcon(QPixmap("pic.jpg")));
    To copy to clipboard, switch view to plain text mode 

    This only makes the icon smaller:
    Qt Code:
    1. ui.pushButton->setIconSize(QSize(100, 250));
    To copy to clipboard, switch view to plain text mode 

    Thanks for help.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Non quadrangular PushBotton Icon

    A rectangle is a quadrangle

    I think you want a button where the entire face is an image. Have a look at QToolButton.

Similar Threads

  1. QTabWidget Place icon with no text and stretch icon over tab
    By alenn.masic in forum Qt Programming
    Replies: 2
    Last Post: 11th April 2013, 12:25
  2. Creating a list with icon and text in the center of icon
    By prophet0 in forum Qt Programming
    Replies: 2
    Last Post: 15th December 2011, 03:03
  3. Replies: 0
    Last Post: 17th March 2010, 13:25
  4. Replies: 2
    Last Post: 12th October 2008, 14:42
  5. Couple of questions: main window icon + toolbar icon
    By bpackard in forum Qt Programming
    Replies: 0
    Last Post: 20th March 2008, 19:03

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.