Results 1 to 4 of 4

Thread: QWidget visibility

  1. #1
    Join Date
    Sep 2011
    Posts
    45
    Thanks
    17
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default QWidget visibility

    Hello!

    Could you, please, tell me, how can be changed the widget opacity SMOOTHLY(using a QTimer, for example), when it has a parent(e.g. QMainWindow instance)?
    I tried use setWindowOpacity-method for the widget, but this trick didn't work.

    Thank you for answers beforehand.

  2. #2
    Join Date
    Sep 2011
    Posts
    45
    Thanks
    17
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: QWidget visibility

    Playing with QPalette didn't work. And that is strange. I created my own property(opacity) and just tried to mess with alpha via QPalette-class and QPropertyAnimation.

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QWidget visibility

    Are you painting the widget yourself? Fade-Effects: a Blast from the Past
    Last edited by ChrisW67; 31st October 2011 at 06:12. Reason: wrong bbcode tag usage

  4. The following user says thank you to ChrisW67 for this useful post:

    DmitryNik (31st October 2011)

  5. #4
    Join Date
    Sep 2011
    Posts
    45
    Thanks
    17
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: QWidget visibility

    Thank you for your answer.
    Yes, kind of.

    You see, when the widget has a parent, it will appear on this parent with no chance to change the widget opacity, e.g. to 0.5f. And my guess was: I need to paint it by myself and change the alpha parametr of a qbrush.

    By the way, why doesn't work dragMode for QGraphicsView, if eventFilter is installed? For instance I need to trace the mouse pointer position and in the same way I need to move items in the scene and use a rubberBandDrag. If I installed an eventFilter or reimplement the mouse events for QGraphicsView, then dragMode will not work at all. So what I need to do in this case?


    ____________________________
    About the last part: solved. Inheriting and QGraphicsView::mouseMoveEvent(event).
    Last edited by DmitryNik; 31st October 2011 at 10:08.

Similar Threads

  1. [Qt4] QTextEdit & cursor visibility
    By Ti_Thom in forum Qt Programming
    Replies: 5
    Last Post: 27th September 2012, 06:04
  2. Visibility with styleSheets
    By jano_alex_es in forum Newbie
    Replies: 2
    Last Post: 21st January 2010, 11:14
  3. Visibility of QDialog
    By elizabeth.h1 in forum Qt Programming
    Replies: 7
    Last Post: 15th October 2009, 17:40
  4. QTabWidget tab visibility
    By dcss-design in forum Qt Programming
    Replies: 2
    Last Post: 30th January 2007, 23:24
  5. QDataTable not visibility?
    By Dmitry in forum Newbie
    Replies: 1
    Last Post: 6th April 2006, 20: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
  •  
Qt is a trademark of The Qt Company.