QAxWidget don’t display

1.4k views Asked by At

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?

1

There are 1 answers

0
lvshuchengyin On

@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);
}