0

Working with widgets, c++ and Linux need something kind of: this

but no borders and custom title.

Search for a few days, but nothing. For now, there is a widget with setWindowFlags(Qt::FramelessWindowHint); and a peace of qss for semitransparent background. How can I blur it? Is is possible at all?

1 Answers1

0

I do not think this can be done with Qt. Blurring can be done using https://doc.qt.io/qt-5/qgraphicsblureffect.html but it is only limited to the widgets painted by Qt. Which the underlying background is not, even if you manage to make your widgets transparent or semitransparent. Painting the background is always the business of the operating system (or window manager) and not the business of your application Qt.

You can certainly try to do some extreme hacking like grabbing the active screen before your window is displayed (see How to capture the current screen image using Qt?) then getting certain rectangle content of the image, which corresponds to the background of your window, then paint it blurred to the background of your application and then update it everytime you move or resize your window... But anyway, even if you manage this, this background will be static and not dynamic.

I recommend that you abandon the idea of blurry background and leave this function to the window manager and the operating system.

  • And what about window manager and the operating system? Are there any ways at all to make blurred semitransparent background on Linux with c++ (I founded some PyQt ways thow) – ff00000000x00 Apr 15 '22 at 13:16
  • That is a topic which far exceeds my knowledge. – HiFile.app - best file manager Apr 15 '22 at 13:25
  • @ff00000000x00 You state `"I founded some PyQt ways..."`. Why can't you translate the `PyQt` code to `C++`? Or have I misunderstood your comment? – G.M. Apr 15 '22 at 18:08
  • @G.M. No, you understood rigth, it's because in PyQt code that i have found using windows funcs, and I need Linux; https://ru.stackoverflow.com/questions/857796/%D0%9A%D0%B0%D0%BA-%D1%80%D0%B0%D0%B7%D0%BC%D1%8B%D1%82%D1%8C-%D0%B7%D0%B0%D0%B4%D0%BD%D0%B8%D0%B9-%D1%84%D0%BE%D0%BD-%D0%B7%D0%B0-%D0%BE%D0%BA%D0%BD%D0%BE%D0%BC – ff00000000x00 Apr 15 '22 at 19:49