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. Transparent QWebView with Qt5
Qt 6.11 is out! See what's new in the release blog

Transparent QWebView with Qt5

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 863 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.
  • B Offline
    B Offline
    bobber
    wrote on last edited by
    #1

    We used to use trick http://blog.qt.digia.com/blog/2009/06/30/transparent-qwebview-or-qwebpage/ to make QWebView transparent with Qt4 as following, but same code give us blank background with Qt 5.2. Is there any way I can make that work with Qt5?

    @
    setAttribute(Qt::WA_TranslucentBackground, true);
    setWindowFlags(Qt::FramelessWindowHint | Qt::Tool);

    if(m_pWebView)
    {
    QPalette palette = m_pWebView->palette();
    palette.setBrush(QPalette::Base, Qt::transparent);
    m_pWebView->page()->setPalette(palette);
    m_pWebView->setAttribute(Qt::WA_OpaquePaintEvent, false);
    m_pWebView->setContextMenuPolicy(Qt::NoContextMenu);
    }
    @

    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