I
I
Ilya1992018-06-21 23:19:46
Python
Ilya199, 2018-06-21 23:19:46

How to forbid minimizing the program, making the window smaller?

I wrote only in such a way that it was impossible to close the program, the rest I have no idea how to do Is it
possible to simply remove them somehow or if there was a click, then it did nothing

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya199, 2018-06-21
@Ilya199

Solved
It was necessary to write: self.setWindowFlags(QtCore.Qt.FramelessWindowHint|QtCore.Qt.WindowTitleHint)

A
Alexander, 2018-06-21
@sanya84

That's how it's decided)

import sys
from PyQt5.QtWidgets import *
from PyQt5.QtCore import Qt


class Example(QWidget):
    def __init__(self):
        super().__init__()
        self.initUI()

    def initUI(self):
        self.setGeometry(300, 300, 300, 200)
        self.setWindowTitle('Example')
        self.setWindowFlags(Qt.WindowMaximizeButtonHint)

if __name__ == '__main__':

    app = QApplication(sys.argv)
    example = Example()
    example.show()
    sys.exit(app.exec_())

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question