nocturne nocturne - 2 months ago 15
C++ Question

Qt - overlap labels in QVBoxLayout

I am trying to make labels overlap each other in

QVBoxLayout
like this:

this->layout = new QGridLayout;
this->layout->addLayout(new QVBoxLayout, 1, 0);

for (int j = 0; j < 7; j++) {
ClickableLabel *label = new ClickableLabel();

auto stack = this->layout->findChildren<QVBoxLayout*>();
stack[0]->addWidget(label);
stack[0]->setAlignment(Qt::AlignTop);

button->setGeometry(10000, 100, 0, 0);
}


Now the
setGeometry
is doing nothing. So my question is: Can I achieve overlaping labels in
QVBoxLayout
?

Answer

No, you can't achieve overlaping labels in QVBoxLayout.