1

I want to write something like a taskbar/dock/panel(like tint2,...) with pyQt5.

I know how to write regular GUI applications with it, but my tiling window manager(herbstluftwm) maximizes my panels and openbox makes them resizable etc. My question : How can I make pyQt show my application as a panel instead of a window? I haven't found anything about that in the documentation.

Thank you.

  • Can you clarify how you differentiate between "panel" and "window"? Do you need to prevent the automatic resizing of windows *from* the window manager? – musicamante Sep 27 '20 at 14:02
  • I want my application to be not resizable, not movable, popping up at a specific location(with a specific size) on the screen, not showing close/maximize/minimize-buttons and not hidden below other windows. – BS_scripter Sep 27 '20 at 16:38
  • I don't have a tiling window manager right now to test it, but, have you already tried to use `setFixedSize()`? – musicamante Sep 27 '20 at 16:59
  • It doesn't work. Seems like tiling window managers ignore these commands. But Other panel apps, for example tint2, work. – BS_scripter Sep 27 '20 at 17:48
  • But the size is set correctly in floating mode. – BS_scripter Sep 27 '20 at 17:50
  • What do you mean? Have you tried to use `self.setWindowFlags(QtCore.Qt.ToolTip)`? – musicamante Sep 27 '20 at 17:51
  • Thanks. setWindowFlags() is the function I've been searching for. – BS_scripter Sep 27 '20 at 18:06
  • Then I suggest you to answer your own question by providing the explanation and a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) showing how you solved the issue. – musicamante Sep 27 '20 at 18:22

1 Answers1

1

Thanks to musicamente's help, i could find that the function setWindowFlags() is what I need. It allows to change the behavior of a window.

A website explaining this function is https://pythonprogramminglanguage.com/pyqt5-window-flags/