0
I am trying to put two Qwidgets imported from ui files, however none appears, problem that does not occur when I enter only one.
# -*- coding: utf-8 -*-
import sys
from PySide2.QtUiTools import *
from PySide2.QtWidgets import *
from PySide2.QtCore import *
def tela(ui):
arquivo = QFile(ui)
arquivo.open(QFile.ReadOnly)
loader = QUiLoader()
janela = loader.load(arquivo)
arquivo.close()
return janela
class Janela(QMainWindow):
def __init__(self, *args, **kwargs):
super().__init__()
menu = tela('menu.ui')
conteudo = tela('adiciona.ui')
janela = QHBoxLayout()
janela.addWidget(menu)
janela.addWidget(conteudo)
self.setLayout(janela)
if __name__ == "__main__":
app = QApplication(sys.argv)
window = Janela()
window.show()
app.exec_()
I am not given any error message.