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. [SOLVED] Widet and menu transparency on windows 7

[SOLVED] Widet and menu transparency on windows 7

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.2k Views
  • 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.
  • S Offline
    S Offline
    sol_aries
    wrote on last edited by
    #1

    Menu transparency doesn't seem to work on windows.
    @
    QApplication a(argc, argv);
    QMenu menu;
    menu.addAction("about", &a, SLOT(aboutQt()));
    menu.addAction("exit", &a, SLOT(quit()));
    menu.setWindowFlags(Qt::FramelessWindowHint);
    menu.setAttribute(Qt::WA_TranslucentBackground);

    // this
    menu.setStyleSheet("QMenu{background:rgba(255, 0, 0, 20%);}");
    // or this
    menu.setWindowOpacity(0.2);
    // doesn't work

    menu.popup(QCursor::pos());
    

    @
    Brings up a solid black box. When I move the cursor through it, it becomes what is expected (some alpha), but quickly becomes opaque when I run the cursor through it a few times.

    To put this in perspective, I'm trying to display an openGl window in my Qt app. I'd like menus (and perhaps other widgets) drawn over the openGl window to be see-through so that the openGl scene doesn't get fully obscured.

    Any ideas?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sol_aries
      wrote on last edited by
      #2

      In case anyone runs into this, it got fixed when I uninstalled and installed it again from source configuring to use nmake rather than MinGW.

      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