ensured parenting of qwidgets

This commit is contained in:
itsmattkc
2019-01-30 17:36:54 +11:00
parent 54180e5e0d
commit 6f3a826da7
32 changed files with 350 additions and 357 deletions
+4 -5
View File
@@ -7,16 +7,15 @@
TextEditDialog::TextEditDialog(QWidget *parent, const QString &s) :
QDialog(parent)
{
setWindowTitle(tr("Edit Text"));
setWindowTitle(tr("Edit Text"));
QVBoxLayout* layout = new QVBoxLayout();
setLayout(layout);
QVBoxLayout* layout = new QVBoxLayout(this);
textEdit = new QPlainTextEdit();
textEdit = new QPlainTextEdit(this);
textEdit->setPlainText(s);
layout->addWidget(textEdit);
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
layout->addWidget(buttons);
connect(buttons, SIGNAL(accepted()), this, SLOT(save()));
connect(buttons, SIGNAL(rejected()), this, SLOT(cancel()));