Results 1 to 5 of 5

Thread: Insert an image with transparent background on base background

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    29
    Thanked 50 Times in 47 Posts

    Default Re: Insert an image with transparent background on base background

    Try This:

    Qt Code:
    1. setStyleSheet("background-image: url(:/bg.jpg)");
    2. QLabel *image = new QLabel(this);
    3. image->setPixmap(QPixmap(":/icon-home.png"));
    To copy to clipboard, switch view to plain text mode 

    Make sure your images are available in the resource file with prefix "/".
    Heavy Metal Rules. For those about to rock, we salute you.
    HIT THANKS IF I HELPED.

  2. The following user says thank you to sonulohani for this useful post:

    mrphunghuy (31st October 2013)

Similar Threads

  1. Transparent Push button over background image
    By KumarKandasamy in forum Newbie
    Replies: 2
    Last Post: 15th May 2014, 08:22
  2. Replies: 0
    Last Post: 5th April 2011, 14:36
  3. Replies: 1
    Last Post: 25th June 2010, 19:31
  4. How to insert an image in background of a Form?
    By awanish_jmi in forum Qt Tools
    Replies: 2
    Last Post: 8th August 2008, 11:52
  5. Transparent background on QLabel on transparent QWidget
    By codeslicer in forum Qt Programming
    Replies: 1
    Last Post: 13th February 2008, 03:10

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.