title: PyQt5: main window shows without any widgets
body: <p>I'm using PyQt5 to create my application. The problem is that my window appears, but without any widgets (i.e. without my <code>Main</code> class, without any menus, toolbars, etc.) - just still empty. I'm using Python-3.6 and PyQt5, Windows 10 environment.</p>
  <p>Here's my code:</p>
  <p>app.py:</p>
  <pre><code>#!/usr/bin/env python
  import sys
  
  from PyQt5.QtCore import Qt
  from PyQt5.QtGui import QIcon
  from PyQt5.QtWidgets import QApplication, qApp, QWidget, QMainWindow, QGridLayout, QMenuBar, QAction, QToolBar, QStatusBar
  
  from views import Main
   
  class TerraSoft(QMainWindow):
      def __init__(self):
          QMainWindow.__init__(self)
          self.setWindowTitle('TerraSoft')
          self.setWindowState(Qt.WindowMaximized)
  
          # init menu
          menubar = QMenuBar()
          fileMenu = menubar.addMenu('File')
  
          #init toolbar
          exitAct = QAction(QIcon('exit24.png'), 'Exit', self)
          exitAct.setShortcut('Ctrl+Q')
          exitAct.triggered.connect(qApp.quit)
          
          toolbar = QToolBar()
  
          # load ihm
          main = Main()
          centWidget = QWidget()
  
          # widget centralizer
          window = QGridLayout()
          window.addWidget(main, 0, 0)
          centWidget.setLayout(window)
          
          self.setCentralWidget(centWidget)
  
          #status bar
          statusBar = QStatusBar().showMessage('Bienvenue dans TerraSoft')
          
          # show ihm
          self.show()
          main.show()
   
  if __name__ == '__main__':
      app = QApplication(sys.argv)
      ex = TerraSoft()
      ex.show()
      sys.exit(app.exec_())
  </code></pre>
  <p>.views (main)</p>
  <pre><code>import sys
  
  from PyQt5.QtCore import Qt
  from PyQt5.QtGui import QIcon
  from PyQt5.QtWidgets import QApplication, QWidget, qApp, QAction, QSplitter, QMenuBar, QToolBar, QGridLayout, QStatusBar
  
  from Family.views import FamilyTreeView
  from Specie.views import EventsTableView
  
  class Main(QWidget):
      &quot;&quot;&quot;description of class&quot;&quot;&quot;
      def __init__(self, *args):
          QWidget.__init__(self, *args)
  
          # init elements of widget
          familyTreeView = FamilyTreeView(self)
          eventsTableView = EventsTableView(self)
  
          #init splitters
          HSplitter = QSplitter(Qt.Horizontal)
          VSplitter = QSplitter(Qt.Vertical)
  
          # add elements to splitters
          HSplitter.addWidget(familyTreeView)
          HSplitter.addWidget(eventsTableView)
  
          
          grid = QGridLayout()
          grid.addWidget(HSplitter)
  </code></pre>
  <p>My module <code>family.views</code> (I want to add .models in the future, but one thing after other):</p>
  <pre><code>import sys
  
  from PyQt5.QtCore import Qt
  from PyQt5.QtGui import QStandardItemModel, QStandardItem
  from PyQt5.QtWidgets import QApplication, QWidget, QTreeView
  
  families = [
      (&quot;Craspedocephalus&quot;, [
          (&quot;puniceus&quot;, []),
          (&quot;trigonocephalus&quot;, [])
      ]),
      (&quot;Trimeresurus&quot;, [
          (&quot;albolabris&quot;, [])
      ]),
      (&quot;Elapidé&quot;, [])
  ]
  
  class FamilyTreeView(QWidget):
      &quot;&quot;&quot;description of class&quot;&quot;&quot;
      def __init__(self, *args):
          QWidget.__init__(self, *args)
          
          self.familyList = QTreeView()
          self.familyList.setMaximumWidth(300)
          
          self.model = QStandardItemModel()
          self.addItems(self.model, families)
          self.familyList.setModel(self.model)
          
          self.model.setHorizontalHeaderLabels([self.tr(&quot;Familles&quot;)])
  
      def addItems(self, parent, elements):     
          for text, children in elements:
              item = QStandardItem(text)
              parent.appendRow(item)
              if children:
                  self.addItems(item, children)
  </code></pre>
  <p>and my module <code>specie.views</code>:</p>
  <pre><code>import sys
  
  from PyQt5.QtCore import Qt
  from PyQt5.QtGui import QStandardItemModel, QStandardItem
  from PyQt5.QtWidgets import QApplication, QWidget, QTableWidget, QTreeView
  
  class EventsTableView(QTableWidget):
      &quot;&quot;&quot;description of class&quot;&quot;&quot;
      def __init__(self, *args):
          QTableWidget.__init__(self, *args)
  
          self.eventsTable = QTableWidget()
          self.eventsTable.setColumnCount(3)
          self.eventsTable.setHorizontalHeaderLabels(('Date', 'Catégorie', 'Description'))
  </code></pre>
  <p>You can see the result below:</p>
  <p><a href="https://i.stack.imgur.com/0jGJe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0jGJe.png" alt="You can see the result bellow:" /></a></p>