#include "lodateselector.h"
#include "LoUIClass/x_uimsgboxonlyclosebtn.h"
LoDateSelector::LoDateSelector(QWidget *parent) :
    QPushButton(parent)
{
    connect(this, SIGNAL(clicked(bool)), this, SLOT(onClicked(bool)));
}

void LoDateSelector::onClicked(bool)
{

//    LoQDialog *w = new LoQDialog(this);
//    QCalendarWidget *wDate = new QCalendarWidget();
//    QVBoxLayout *layout = new QVBoxLayout();
//    layout->addWidget(wDate, 1);
//    connect(wDate, SIGNAL(clicked(const QDate &)),    w,   SLOT(accept()));
//    connect(wDate, SIGNAL(clicked(const QDate &)), this, SIGNAL(sDateSelected(const QDate &)));
//    w->setLayout(layout);
//    w->exec();
    x_uiMsgBoxOnlyCloseBtn *w = new x_uiMsgBoxOnlyCloseBtn(tr("Date selector"),this);
    QCalendarWidget *wDate = new QCalendarWidget();
    connect(wDate, SIGNAL(clicked(const QDate &)),    w,   SLOT(accept()));
    connect(wDate, SIGNAL(clicked(const QDate &)), this, SIGNAL(sDateSelected(const QDate &)));
    w->InSertDateSelector(wDate);
    w->exec();

}
