#include "funcwidget1.h"

#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QTabWidget>
#include <QLabel>


FuncWidget1::FuncWidget1(QWidget *parent)
    : FancyWindow(parent)
{
    mCentralWidget = new QWidget;
    mCentralWidget->setObjectName("FuncWidgetCentralWidget");
    mVLayout = new QVBoxLayout;

    mTabWidget = new QTabWidget;
    mALabel = new QLabel;
    mALabel->setObjectName("FuncWidgetLabel");
    mALabel->setText("I am A");
    mALabel->setAlignment(Qt::AlignCenter);
    mBLabel= new QLabel;
    mBLabel->setText("I am B");
    mBLabel->setObjectName("FuncWidgetLabel");
    mBLabel->setAlignment(Qt::AlignCenter);
    mCLabel = new QLabel;
    mCLabel->setText("I am C");
    mCLabel->setObjectName("FuncWidgetLabel");
    mCLabel->setAlignment(Qt::AlignCenter);
    mDLabel = new QLabel;
    mDLabel->setText("I am D");
    mDLabel->setObjectName("FuncWidgetLabel");
    mDLabel->setAlignment(Qt::AlignCenter);
    mTabWidget->addTab(mALabel, "A");
    mTabWidget->addTab(mBLabel, "B");
    mTabWidget->addTab(mCLabel, "C");
    mTabWidget->addTab(mDLabel, "D");

    mButtonHLayout = new QHBoxLayout;
    mSubmitButton = new QPushButton;
    mSubmitButton->setText("确定");
    mCancelButton = new QPushButton;
    mCancelButton->setText("取消");
    mButtonHLayout->addStretch();
    mButtonHLayout->addWidget(mSubmitButton);
    mButtonHLayout->addWidget(mCancelButton);

    mVLayout->addWidget(mTabWidget);
    mVLayout->addLayout(mButtonHLayout);
    mCentralWidget->setLayout(mVLayout);

    this->setWindowTitle("功能1");
    this->setCentralWidget(mCentralWidget);

    connect(mSubmitButton, &QPushButton::clicked, this, &FuncWidget1::hide);
    connect(mCancelButton, &QPushButton::clicked, this, &FuncWidget1::hide);
}

FuncWidget1::~FuncWidget1()
{

}
