Hello,

Mon QGridLayout s'affiche pas Aucune erreur, juste pas de visibilité:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
#!/usr/bin/env python
import sys
 
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QMainWindow, QApplication, QDesktopWidget, 
    qApp, QAction, QListView, QGridLayout, QPushButton)
 
class TerraSoft(QMainWindow):
    def __init__(self):
        super().__init__()
 
        self.initUI()
 
    def initUI(self):
        self.showMaximized()
        self.setWindowTitle('TerraSoft')
 
        grid = QGridLayout(self)
        self.setLayout(grid)
 
        button = QPushButton("Hello")
        grid.addWidget(button, 0, 0)
 
        self.statusBar().showMessage('Bienvenue dans TerraSoft') 
        self.show()
 
if __name__ == '__main__':
    app = QApplication(sys.argv)
    ex = TerraSoft()
    sys.exit(app.exec_())
L'idée final étant d'afficher sur la gauche une listView et sur la droite différentes données organisées....

Cordialement,