1

I used QWidget show as a dialog. And put QAxWidget as a subwidget. But if I set the parent widget transparent, the QAxWidget will not display.

QWidget* widget = new QWidget;
widget->setAttribute(Qt::WA_TranslucentBackground);
......;

QAxWidget* axieBrowser= new QAxWidget(widget);
axieBrowser->setControl(QString::fromUtf8("{8856F961-340A-11D0-A96B-00C04FD705A2}"));
axieBrowser->dynamicCall("Navigate(const QString&)", "www.google.com");

I try if you use other widget, that will display, only QAxWidget don’t display! How could I fi xed that?

Maxim Makhun
  • 2,197
  • 1
  • 22
  • 26
lvshuchengyin
  • 235
  • 1
  • 4
  • 19
  • Is it the same with any other widget, like a QLabel within the outter QWidget? – László Papp Jan 06 '14 at 03:31
  • 1
    This may be a limitation of ActiveX widgets - but just to be completely sure, do you need Internet Explorer or ActiveX specifically? If you just need to display vendor-neutral webpages, the QtWebkit library does a good job. – John Chadwick Jan 06 '14 at 03:37
  • @LaszloPapp I use other widget like label, which will display. @ John Chadwick Yes, I have to use Internet Explorer , can't use QWebView instead. – lvshuchengyin Jan 06 '14 at 05:13
  • Does it display if put inside some layout management? If I understand correctly it does display but only if you ommit the setAttribute() part, correct? – Dariusz Scharsig Jan 07 '14 at 15:28
  • Not display. The attribute WA_TranslucentBackground can't be set. – lvshuchengyin Jan 08 '14 at 01:18
  • Could you tell me which operating system you run on and which display style you have in use? – Dariusz Scharsig Jan 08 '14 at 07:36
  • Windows XP. I use widget display as a dialog and it contains a QAxWidget. Now I found a way can let is display which is change the widget's geometry. The funciton is in the reply. – lvshuchengyin Jan 08 '14 at 08:20

1 Answers1

0

@Dariusz Scharsig I use this function to force the QWidget fresh because repaint() is no effect.

void CMyDialog::changeRectToFresh()
{
    this->showNorMal();
    QRect rect = this->geometry();
    this->setGeometry(rect.adjusted(-1,-1,1,1);
    //recover
    this->setCeometry(rect);
}
lvshuchengyin
  • 235
  • 1
  • 4
  • 19