serialicon/mydialog.cpp

20 lines
681 B
C++

#include "mydialog.h"
#include<QHBoxLayout>
#include<QVBoxLayout>
myDialog::myDialog(QWidget *parent) : QDialog(parent)
{
QHBoxLayout *hLayout = new QHBoxLayout();
myWidget = new QStackedWidget(this);
myWidget->setMinimumWidth(800);
myWidget->setMinimumHeight(400);
OKbtn = new QPushButton(tr("OK"),this);
Cancelbtn = new QPushButton(tr("Cancel"),this);
hLayout->addWidget(OKbtn);
hLayout->addWidget(Cancelbtn);
QVBoxLayout *vLayout = new QVBoxLayout(this);
vLayout->addWidget(myWidget);
vLayout->addLayout(hLayout);
connect(OKbtn,SIGNAL(clicked()),this,SLOT(close()));
connect(Cancelbtn,SIGNAL(clicked()),this,SLOT(close()));
}