#include "dp4loginwidget.h" #include #include #include #include Dp4LoginWidget::Dp4LoginWidget(QWidget *parent) : QWidget(parent) { QWidget *topWidget = new QWidget(this); QLineEdit *topLineEdit = new QLineEdit(topWidget); QPushButton *btn = new QPushButton(topWidget); QHBoxLayout *topLayout = new QHBoxLayout(topWidget); topLayout->addWidget(topLineEdit); topLayout->addWidget(btn); topLayout->addStretch(); topLayout->setSpacing(0); topLayout->setContentsMargins(0,0,0,0); QWidget *bottomWidget = new QWidget(this); QLineEdit *bottomEdit = new QLineEdit(bottomWidget); QPushButton *btnBottom = new QPushButton(bottomWidget); QPushButton *btnBottom2 = new QPushButton(bottomWidget); QHBoxLayout *bottomLayout = new QHBoxLayout(bottomWidget); bottomLayout->addWidget(bottomEdit); bottomLayout->addWidget(btnBottom); bottomLayout->addWidget(btnBottom2); bottomLayout->addStretch(); bottomLayout->setContentsMargins(50,0,0,0); QVBoxLayout *layout = new QVBoxLayout(this); layout->addWidget(topWidget); layout->addWidget(bottomWidget); // layout->setContentsMargins(0,0,0,0); }