Results 1 to 5 of 5

Thread: VTK + TranslucentBackground + FramelessWindow = Bug ?

  1. #1
    Join Date
    Jun 2015
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Unhappy VTK + TranslucentBackground + FramelessWindow = Bug ?

    Hello everyone.

    I've made a program with PyQt4 that uses VTK. This bug probably occurs with QT too.

    The base class of the program is a QWidget with :
    Qt Code:
    1. self.setAttribute(QtCore.Qt.WA_TranslucentBackground, True)
    2. self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
    To copy to clipboard, switch view to plain text mode 
    (The window has a customized titlebar and I use the transparency to show a QGraphicsDropShadowEffect)

    I have a QVTKRenderWindowInteractor embed inside my application. Everything works fine without or with one of the two lines above. But with these two lines together, the QVTKRenderWindowInteractor is completly transparent (I see behind the program, like a hole). All other QWidgets such as QPushbuttons are displayed normally.

    I know this may seem quite precise, but it is very frustrating.

    You can probably notice this bug with any example of VTK + pyqt and adding the two lines above.

    Any help is welcome

    Thank you..

  2. #2
    Join Date
    Jun 2015
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: VTK + TranslucentBackground + FramelessWindow = Bug ?


  3. #3
    Join Date
    Jun 2015
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: VTK + TranslucentBackground + FramelessWindow = Bug ?

    OK after many tries, I may have found a lead.

    I subclassed the QVTKRenderWindowInteractor and I implemented a definition for a paintEvent.

    Qt Code:
    1. def paintEvent(self, event):
    2. o.initFrom(self)
    3. p = QPainter(self)
    4. self.style().drawPrimitive(QStyle.PE_Widget, o, p, self)
    To copy to clipboard, switch view to plain text mode 

    With this, there is no more "hole" and the Canvas area in filled with an opaque color instead. However, there is still no 3D.
    I've picked this code from http://stackoverflow.com/questions/1...widget-in-pyqt
    I don't really understand the code and maybe with some modifications it would be possible to fix the issue.

    Is there someone familiar with this code ?
    Last edited by odgygsf; 9th June 2015 at 15:23.

  4. #4
    Join Date
    Jun 2015
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: VTK + TranslucentBackground + FramelessWindow = Bug ?

    up ?
    I'm still stuck on this, it is driving me crazy...
    I hope that someone can help.
    Thanks in advance.

  5. #5
    Join Date
    Jun 2015
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: VTK + TranslucentBackground + FramelessWindow = Bug ?

    up...
    I really don't know how I can deal with this.

Similar Threads

  1. FrameLessWindow Maximise
    By sjaideep93 in forum Newbie
    Replies: 4
    Last Post: 5th August 2011, 16:50

Tags for this Thread

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.