Results 1 to 3 of 3

Thread: How to insert an image in background of a Form?

  1. #1
    Join Date
    Jul 2008
    Posts
    6
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default How to insert an image in background of a Form?

    hi frnds...
    plz help me
    How to insert an image in background of a Form ? i'm using Qt 3...

    thanks...

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to insert an image in background of a Form?

    You can set a QBrush with a pixmap as the background color in QPalette and then assign the palette to the form.

  3. #3
    Join Date
    Apr 2008
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to insert an image in background of a Form?

    I paintevent funtion
    Qt Code:
    1. paintEvent()
    2. {
    3. QPainter painter(this);
    4. painter.setBackgroundMode (Qt::TransparentMode);//set transparency
    5. painter.drawPixmap(QPointF(0,0), bgpix );//draw the background pixmap
    6. }
    To copy to clipboard, switch view to plain text mode 
    "A fool can ask More questions that a wise man cannot answer"
    /home/nithyanair/Pics/image.jpg

Similar Threads

  1. Replies: 3
    Last Post: 18th May 2012, 10:12
  2. [Qt4.1] How to insert an image inside a Form?
    By Gonzalez in forum Qt Tools
    Replies: 5
    Last Post: 23rd September 2008, 11:20
  3. Finding marks on scanned image for alignment
    By caduel in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2007, 02:10
  4. Setting background image of QFrame
    By Claymore in forum Qt Programming
    Replies: 2
    Last Post: 12th February 2007, 19:50
  5. background image in QTreeView
    By momesana in forum Qt Programming
    Replies: 2
    Last Post: 11th January 2007, 06:25

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.