Results 1 to 2 of 2

Thread: Question in QGraphicsView

  1. #1
    Join Date
    Jun 2008
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Question in QGraphicsView

    Hi All,

    i want to set a bachground image to my GraphicsView Control, so i added this line

    Qt Code:
    1. MyViwer->setBackgroundBrush(QImage("C:\\pix.jpg"));
    To copy to clipboard, switch view to plain text mode 

    The Problem is that the pic didn't fit the background on the control after resizing the control.

    for example, if i maximized the form, the pic will appear twice in the control.

    How can i make the Pic fit the background without duplications ??

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Question in QGraphicsView

    Reimplement drawBackground() and draw the image yourself after scaling it.

Similar Threads

  1. QGraphicsView general questions
    By sincnarf in forum Qt Programming
    Replies: 5
    Last Post: 15th October 2007, 23:22
  2. Putting static controls on top of QGraphicsView
    By durbrak in forum Qt Programming
    Replies: 3
    Last Post: 10th September 2007, 12:51
  3. QGraphicsView question
    By sincnarf in forum Qt Programming
    Replies: 4
    Last Post: 4th July 2007, 19:48
  4. Speed, transparency, and drop issues with QGraphicsView
    By jefferai in forum Qt Programming
    Replies: 16
    Last Post: 30th June 2007, 16:14
  5. QGraphicsView scale question.
    By hickscorp in forum Qt Programming
    Replies: 20
    Last Post: 15th April 2007, 02:28

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.