Results 1 to 3 of 3

Thread: Widget Overlapping picture

  1. #1
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Widget Overlapping picture

    Hey guys,

    I want to achieve the following.

    - Create a QWidget, say a QPushButton.
    - Create another QWidget.
    - Subclass its paintEvent method and paint a gradient.
    - Overlap my QPushButton with the QWidget gradient.
    - Still get mouse events on my QPushButton.

    What's the best way for doing that ?

    Thanks.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Widget Overlapping picture

    Do you mean having a gradient for pushbutton ? Why cant u set background color of the push button as gradient ?

    If you want button on top, use semi transparent color for the button. You will see background gradient as well as receive the events

  3. #3
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Re: Widget Overlapping picture

    I mean having a widget on top of another that redirects every mouse interaction to the background widget.

Similar Threads

  1. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 07:06
  2. Copy full widget as a picture to clipboard
    By lasher in forum Newbie
    Replies: 1
    Last Post: 26th September 2009, 08:25
  3. Replies: 33
    Last Post: 8th July 2008, 07:23
  4. Overlapping Widgets and the Application
    By csvivek in forum Qt Programming
    Replies: 1
    Last Post: 2nd May 2008, 16:32
  5. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35

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.