Python / PyQt5: bouton de redimensionnement
Résolu
Medestrac
-
Medestrac -
Medestrac -
A voir également:
- Python / PyQt5: bouton de redimensionnement
- Citizen code python avis - Accueil - Outils
- Python est introuvable. exúcutez sans argument pour procúder ó l ✓ - Forum Python
- Mot secret python pix ✓ - Forum Python
- Python par la pratique : 101 exercices corrigés pdf - Forum Python
- Exercice python - Forum Python
2 réponses
J'ai trouvé: il y avait une valeur max rentrée pour la fenêtre, ce qui désactive la possibilité de la maximiser. J'ai remis les valeurs par défaut et ça fonctionne
Bonjour,
Attention, les puristes insistent, c'est Qt et pas QT, car le but est que ça se prononce "cute" :-)
As-tu essayé ceci ?
import sys from PyQt5.QtWidgets import QDialog, QApplication from PyQt5.QtCore import Qt class MyForm(QDialog): def __init__(self): super().__init__() self.setWindowFlag(Qt.WindowMinimizeButtonHint, True) self.setWindowFlag(Qt.WindowMaximizeButtonHint, True) self.show() if __name__=="__main__": app = QApplication(sys.argv) w = MyForm() w.show() sys.exit(app.exec_())
Bonne chance
Bonjour,
J'ai essayé mais ça ne change rien. J'ai une QMainWindow et pas QDialog.
class MyWindow(QMainWindow): def __init__(self): super(MyWindow, self).__init__() self.my_ui = Ui_MainWindow() self.my_ui.setupUi(self) self.setWindowFlag(Qt.WindowMinimizeButtonHint, True) self.setWindowFlag(Qt.WindowMaximizeButtonHint, True) if __name__ == '__main__': app = QApplication(sys.argv) win = MyWindow() win.show() sys.exit(app.exec())