-3

I have removed the title of the main window.

Created a button that should hide the window, but not close it. How can I implement a similar function for her?

Parisa.H.R
  • 3,303
  • 3
  • 19
  • 38
Bitchdragon
  • 105
  • 5
  • all widgets has `show and hide` [function](https://doc.qt.io/qt-5/qwidget.html#hide). – Parisa.H.R Nov 05 '21 at 18:41
  • I tried to use hide(), but the window disappears from the taskbar – Bitchdragon Nov 05 '21 at 18:42
  • Does this answer your question? [PyQt: How to hide QMainWindow](https://stackoverflow.com/questions/22538247/pyqt-how-to-hide-qmainwindow) – Parisa.H.R Nov 05 '21 at 18:42
  • Can I implement this in one function, without using a second class? – Bitchdragon Nov 05 '21 at 18:44
  • you should put your code or program in question. please provide a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) so we can run and test it. – Parisa.H.R Nov 05 '21 at 18:46
  • My code is too big. Requires more details. Imagine that it has one button and an empty function. – Bitchdragon Nov 05 '21 at 18:50
  • By any chance, do you mean minimize or hide? – MSH Nov 05 '21 at 18:56
  • @Bitchdragon 1. We didn't ask you the full code, but a "minimal reproducible example", please read that link to learn how to create such examples; please consider that creating such examples could take some time, and that's a required step in order to create good questions and improve your chances to receive good answers; 2. The fact that you're "bad at OOP" is irrelevant: python and Qt are OOP, you cannot use them without knowing its basics and usage; if you're "bad at it", do more efforts and improve those skills. – musicamante Nov 05 '21 at 19:12

1 Answers1

1

I guess you want something to minimize application

like this button :

enter image description here

To minimize your application you should call showMinimized(); function.

look at this Qt Documentation link :

https://doc.qt.io/qt-5/qwidget.html#showMinimized

Parisa.H.R
  • 3,303
  • 3
  • 19
  • 38