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. How to let Qt Application stay on desktop and translucent?
Qt 6.11 is out! See what's new in the release blog

How to let Qt Application stay on desktop and translucent?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 924 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.
  • M Offline
    M Offline
    mikumiku
    wrote on last edited by
    #1

    I want the application will remain on desktop when win+d pressed,and it is translucent.
    SetParent(w.winId(),desktopHwnd) can make Widget stay on desktop but if I use this function setWindowOpacity() won't work.
    How can i do it?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vezprog
      wrote on last edited by
      #2

      Have a look at this (don't worry about the frameless window part):
      http://qt-project.org/forums/viewthread/1107

      Also, what do you mean remain on desktop? Do you mean, you don't want it to be able to minimize?

      If so, you can override the changeEvent(QEvent *event) in your window class and check if the window is being minimized, then show how ever which way you want it.

      For example:
      @
      // change event (protected)
      void MainWindow::changeEvent(QEvent *event){
      if (event->type() == QEvent::WindowStateChange){
      if (isMinimized()) // check if the window is minimized
      show();
      }
      }
      @

      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