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