Results 1 to 3 of 3

Thread: QWidget from Designer--Paint or set foreground

  1. #1
    Join Date
    Jun 2009
    Location
    India
    Posts
    143
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QWidget from Designer--Paint or set foreground

    Hi all,

    I have added a QWidget from the designer, to my .ui (MainWindows)

    My class is derived from Qmainwindows , didn't subclass Qwidget

    I can able to set the background image :

    Qt Code:
    1. PPI_Window->setStyleSheet(" background-image: url(/airport-4975m.jpg);");
    To copy to clipboard, switch view to plain text mode 

    I need to set/draw the foreground image and set the opacity to it...

    How can i achieve this.

  2. #2
    Join Date
    Jun 2011
    Location
    Finland
    Posts
    164
    Thanks
    1
    Thanked 26 Times in 26 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: QWidget from Designer--Paint or set foreground

    Set another widget on top of your PPI_Windowand and set semi-transparent background.

  3. #3
    Join Date
    Jun 2009
    Location
    India
    Posts
    143
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QWidget from Designer--Paint or set foreground

    Hi Rachol,

    Please refer the image attachment on how my application works..

    As you said i put another widget (on the extreme right with blue map ) on top of my lower widget , where i am displaying my graphics from third party i pass window id of the lower widget ....But still the graphics is drawn on the top widget too.....

    hope you remember we have discussed the same...

    how this can be resolved ......The same kind of application i had in X Code....By using "xsetforeground" call they set the transparency so the object is visible on top of graphics ....Couldn't able to get, how it can be achieved in Qt
    Attached Images Attached Images

Similar Threads

  1. Replies: 4
    Last Post: 27th October 2010, 16:43
  2. Very strange behavior of QWidget in Qt Designer
    By THRESHE in forum Qt Programming
    Replies: 10
    Last Post: 13th August 2008, 16:19
  3. How to keep window in foreground
    By szicsi in forum Qt Programming
    Replies: 5
    Last Post: 17th January 2008, 14:40
  4. Painting: How to control what's in the foreground?
    By Mister_Crac in forum Qt Programming
    Replies: 16
    Last Post: 8th May 2007, 13:00
  5. Updating Foreground for QGraphicsView
    By tts80 in forum Qt Programming
    Replies: 5
    Last Post: 4th January 2007, 15: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.