12345678910111213141516171819202122232425262728 |
- #include "widget.h"
- #include "ui_widget.h"
- #include <QHBoxLayout>
- Widget::Widget(QWidget *parent)
- : QWidget(parent)
- , ui(new Ui::Widget)
- {
- ui->setupUi(this);
- setAttribute(Qt::WA_TranslucentBackground);
- setStyleSheet("QWidget { background: transparent; }");
- QHBoxLayout *layout = new QHBoxLayout(this);
- layout->setContentsMargins(50, 50, 50, 50);
- layout->setSpacing(0);
- priBtn = new QAntPrimaryButton(this);
- priBtn->setText("Hello world");
- priBtn->setFixedSize(200, 100);
- layout->addWidget(priBtn, 0, Qt::AlignCenter);
- setLayout(layout);
- }
- Widget::~Widget()
- {
- delete ui;
- }
|