I'm having some problems with the Central Widget, I'm trying to positionate the LabelTitle overlapping the top of the central widget, so it would look like a small box title, but for some reason I can't figure out how to stretch the space between the layout and the top of the central widget.
I tried using a Frame, or the layout.setRowStretch but it didn't work for me
class WindowEtiquette(QMainWindow):
def __init__(self):
super().__init__()
self.setFixedSize(460, 350)
self._add_widgets()
def _add_widgets(self):
self.CuadroLayout = QGridLayout()
#Generando elementos y layouts
self.TituloLayout = QGridLayout()
self.labelTitulo = QLabel("Formato de la dirección")
self.labelTitulo.setObjectName("EtiquetaTitulo")
self.TituloLayout.addWidget(self.labelTitulo, 0, 0, Qt.AlignCenter)
self.CuadroLayout.addLayout(self.TituloLayout, 0, 0, alignment=Qt.AlignTop)
self.widgetCentral = QWidget()
self.widgetCentral.setObjectName("FondoEtiqueta")
self.widgetCentral
self.widgetCentral.setLayout(self.CuadroLayout)
self.setCentralWidget(self.widgetCentral)
The objects name are in a CSS File, and I don't add any margins or paddings in them
I know maybe I shouldn't worry too much about the GUI, but I wanted to see if I could solve that problem
I'm sorry, I am kind of new in this place so I guess I jumped over conclusions, I'm sorry if the code it's too big, I was in kind of a rush doing it so I just did a mess, but here it is:
I