1
Comment puis-je déplacer un QVBoxLayout avec plusieurs QPushButtons 50px vers le haut?Comment déplacer un QVBoxLayout avec QPushButtons 50px vers le haut?
Ceci est mon code. J'ai essayé this-> adjustSize(), this-> repaint(), mais il ne bouge pas.
// get current geometry
QRect geo = ui->VBoxLayout->geometry();
// apply geometry, but substract 50px from y() to move it to the top
ui->VBoxLayout->setGeometry(
QRect(geo.x(), geo.y() - 50, geo.width(), geo.height())
);
[ajouter un espacement] (http://qt-project.org/doc/qt-5/qboxlayout.html#addSpacing) comme premier widget? –