look at code and find the bug
OptionDlg
::OptionDlg(QWidget *parent, Qt
::WFlags flags
) : QDialog(parent, flags
){
frmScroll = new FrameScroll(this);
frmScroll->setMinimumSize( 20, 20 );
layout->addWidget(frmScroll);
mainLayout->addLayout(layout);
connect(submitBt, SIGNAL(clicked()), this, SLOT(processUserInput()));
connect(cancelBt, SIGNAL(clicked()), this, SLOT(close()));
hBtLayout->addSpacing(200);
hBtLayout->addWidget(submitBt);
hBtLayout->addWidget(cancelBt);
mainLayout->addLayout(hBtLayout);
setLayout(mainLayout);
setWindowTitle(tr("Basic Layouts"));
};
OptionDlg::~OptionDlg()
{ };
void OptionDlg::processUserInput() {
//FrameScroll *frmScroll = new FrameScroll(this);//<---- you create a new widget and get data from it
//QString sr = frmScroll->cbx->text();
//bool cbool = true;
qDebug() << (frmScroll->cbx->isChecked());
//this->close();
}
OptionDlg::OptionDlg(QWidget *parent, Qt::WFlags flags) : QDialog(parent, flags)
{
QVBoxLayout *mainLayout = new QVBoxLayout;
QHBoxLayout *hBtLayout = new QHBoxLayout;
QHBoxLayout *layout = new QHBoxLayout;
frmScroll = new FrameScroll(this);
frmScroll->setFrameStyle( QFrame::Box | QFrame::Raised );
frmScroll->setMinimumSize( 20, 20 );
layout->addWidget(frmScroll);
mainLayout->addLayout(layout);
submitBt = new QPushButton(tr("&Ok"));
cancelBt = new QPushButton(tr("&Cancel"));
connect(submitBt, SIGNAL(clicked()), this, SLOT(processUserInput()));
connect(cancelBt, SIGNAL(clicked()), this, SLOT(close()));
hBtLayout->addSpacing(200);
hBtLayout->addWidget(submitBt);
hBtLayout->addWidget(cancelBt);
mainLayout->addLayout(hBtLayout);
setLayout(mainLayout);
setWindowTitle(tr("Basic Layouts"));
};
OptionDlg::~OptionDlg()
{ };
void OptionDlg::processUserInput() {
//FrameScroll *frmScroll = new FrameScroll(this);//<---- you create a new widget and get data from it
//QString sr = frmScroll->cbx->text();
//bool cbool = true;
qDebug() << (frmScroll->cbx->isChecked());
//this->close();
}
To copy to clipboard, switch view to plain text mode
PS. for feature,please post code in archive.
Bookmarks