Results 1 to 2 of 2

Thread: how to resize an image from URL according to the size of the widget on which it lies

  1. #1
    Join Date
    Jul 2010
    Posts
    50
    Thanks
    7
    Platforms
    Windows

    Default how to resize an image from URL according to the size of the widget on which it lies

    I have set an image on a widget('this' here) by the function......

    this->setStyleSheet( "QFrame {background-color: black; background-image: url(:/images/background.png); background-repeat: no-repeat; border-color: gray;}");
    I want this image to resize when the widget is resized.......... is it possible....if yes, how?

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to resize an image from URL according to the size of the widget on which it l

    Play around with the QWidget::resizeEvent() and the size of the image.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

Similar Threads

  1. Replies: 1
    Last Post: 1st May 2010, 23:03
  2. Replies: 0
    Last Post: 28th May 2009, 22:38
  3. Replies: 2
    Last Post: 23rd March 2009, 17:26
  4. Resize Widget To Desktop Size
    By fruzzo in forum Qt Programming
    Replies: 6
    Last Post: 2nd October 2008, 15:29
  5. Replies: 0
    Last Post: 14th February 2008, 12:14

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.