Results 1 to 4 of 4

Thread: setBackgroundBrush Question

  1. #1
    Join Date
    Jul 2009
    Posts
    20
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default setBackgroundBrush Question

    Hi

    I am loading an image into an application and using setBackgroundBrush to achieve this.However, the image appears tiled.Is there any other method to load the image, without having the tiled appearance ?

    Thanks

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: setBackgroundBrush Question

    Can you tell, how you are loading.

  3. #3
    Join Date
    Jul 2009
    Posts
    20
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: setBackgroundBrush Question

    Qt Code:
    1. curpixmap.load(fileName);
    2. scene->setBackgroundBrush(QBrush(curpixmap));
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: setBackgroundBrush Question

    Quote Originally Posted by qtuser20 View Post
    Qt Code:
    1. curpixmap.load(fileName);
    2. scene->setBackgroundBrush(QBrush(curpixmap));
    To copy to clipboard, switch view to plain text mode 
    Ok, this is clear, your scene is fixed size and bigger than the size of pixmap. So pixmap has to adjust like that.
    Either change your scene size according to pixmap size or, use bigger image.

Similar Threads

  1. licensing question
    By tommy in forum Installation and Deployment
    Replies: 4
    Last Post: 14th April 2010, 11:54
  2. Plugin implementation question
    By JPNaude in forum Qt Programming
    Replies: 12
    Last Post: 27th August 2008, 20:24
  3. Useless but curious compiler warning question
    By Raccoon29 in forum General Programming
    Replies: 4
    Last Post: 30th July 2008, 20:46
  4. Replies: 1
    Last Post: 15th March 2007, 20:45

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.