Results 1 to 3 of 3

Thread: ActiveX widgets in transparent dialogs are also transparent

  1. #1
    Join Date
    May 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default ActiveX widgets in transparent dialogs are also transparent

    Hello,

    I want to show an ActiveX widget in a frameless dialog which attribute is set to transparent. The problem is that the ActiveX widget is not shown, so I get a "hole" in my dialog. This behaviour occurs with completely different types of ActiveX components. But if I don't make the dialog transparent the ActiveX widget is shown.

    I have already tested adding a non-transparent QWidget that contains the ActiveX widget, but the ActiveX is not visible, only the "hole" is fixed. But if I make the dialog non-transparent, the ActiveX is shown. It seems that the parent window (not widget) of the ActiveX widget may not be transparent.

    Anyone an idea how to fix this? I am using Qt 4.6.2, WinXP, VC++ 2008.

    Thanks for your help,

    Dennis

    Qt Code:
    1. #include <QApplication>
    2. #include <QDialog>
    3. #include <QHBoxLayout>
    4. #include "acropdflib.h" //created by "Qt\bin\dumpcpp.exe AcroPDF.PDF"
    5.  
    6. int main(int argc, char *argv[])
    7. {
    8. QApplication a(argc, argv);
    9.  
    10. QDialog d(0, Qt::Dialog | Qt::FramelessWindowHint);
    11. AcroPDFLib::AcroPDF* pdf = new AcroPDFLib::AcroPDF(&d);
    12. pdf->LoadFile("test.pdf");
    13. d.setLayout(new QHBoxLayout());
    14. d.layout()->addWidget(pdf);
    15. d.setAttribute(Qt::WA_TranslucentBackground); //without this the PDF is shown
    16. d.show();
    17.  
    18. return a.exec();
    19. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: ActiveX widgets in transparent dialogs are also transparent

    Why the translucent background?

  3. #3
    Join Date
    May 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: ActiveX widgets in transparent dialogs are also transparent

    In my application I don't use the windows style but my own. Part of it are dialog windows with a self-painted titlebar and window frame (therefor Qt::FramelessWindowHint). The transparent background is for the self-painted shadow of the dialog window (alpha colors). It's working fine with all dialogs but not with ActiveX components inside.

Similar Threads

  1. Mac OS X Top-Level Transparent Widgets
    By tinsuke in forum Qt Programming
    Replies: 0
    Last Post: 17th October 2008, 17:01
  2. Non-transparent QWidget on semi-transparent parent
    By EuroElessar in forum Qt Programming
    Replies: 0
    Last Post: 29th August 2008, 17:20
  3. Transparent background on QLabel on transparent QWidget
    By codeslicer in forum Qt Programming
    Replies: 1
    Last Post: 13th February 2008, 03:10
  4. Transparent widgets on top of QGLWidget
    By tseval in forum Qt Programming
    Replies: 1
    Last Post: 12th May 2007, 22:03
  5. Transparent widgets
    By incapacitant in forum Newbie
    Replies: 10
    Last Post: 21st March 2006, 19:01

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.