Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Overlay semi-transparent widget on top of QAxWidget
Qt 6.11 is out! See what's new in the release blog

Overlay semi-transparent widget on top of QAxWidget

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi All,
    I'm trying to overlay a semi transparent widget on top of a QAxWidget.
    Here is the code that I'm using :

    @ QAxWidget *qt_activex_widget = new QAxWidget();
    qt_activex_widget->setGeometry(100,100,500,500);
    qt_activex_widget->setControl("MyControl");
    CComPtr<IMyControl> disp_ctrl;
    QUuid uuid(__uuidof(disp_ctrl));
    HRESULT hr = qt_activex_widget->queryInterface(uuid, (void **)&disp_ctrl);
    if ( FAILED( hr ) ){
    return E_FAIL;
    }
    if (FAILED(disp_ctrl->Initialise(e_dci_directx, view, m_input_modes_proxy, nullptr))) {
    return E_FAIL;
    }

    QWidget *test = new QWidget(qt_activex_widget);
    test->setGeometry(200,200,80,80);
    test->setStyleSheet("background-color: rgba(255, 0, 0,50)");
    //test->setAttribute(Qt::WA_TranslucentBackground);
    //test->setWindowFlags(Qt::FramelessWindowHint);

    qt_activex_widget->show();@

    The control is shown properly but the "test" widget that is supposed to be red and semi-transparent is completely opaque.

    Setting on the test widget the FramelessWindowHint window flag and the WA_TranslucentBackgroung property will show a completely opaque white widget.

    Any ideas?
    Is it even possible to do what I'm trying to do ?

    Thanks a lot for your help,

    Kind regards

    Ben

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved