I've tried delete on some widgets:
if(rec.
value(1).
toString()=="warning") msgBox
->setIcon
(QMessageBox::Warning);
else if (rec.
value(1).
toString()=="info") msgBox
->setIcon
(QMessageBox::Information);
else if (rec.
value(1).
toString()=="error") msgBox
->setIcon
(QMessageBox::Critical);
msgBox->setFont(font);
msgBox->setWindowTitle(rec.value(1).toString());
msgBox->setText(rec.value(2).toString());
layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount());
msgBox->move(0,0);
msgBox->exec();
delete msgBox;
//delete horizontalSpacer;
//delete layout;
QMessageBox *msgBox=new QMessageBox;
if(rec.value(1).toString()=="warning") msgBox->setIcon(QMessageBox::Warning);
else if (rec.value(1).toString()=="info") msgBox->setIcon(QMessageBox::Information);
else if (rec.value(1).toString()=="error") msgBox->setIcon(QMessageBox::Critical);
msgBox->setFont(font);
msgBox->setWindowTitle(rec.value(1).toString());
msgBox->setText(rec.value(2).toString());
QSpacerItem* horizontalSpacer = new QSpacerItem(240, 290, QSizePolicy::Minimum, QSizePolicy::Minimum);
QGridLayout* layout = (QGridLayout*)msgBox->layout();
layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount());
msgBox->move(0,0);
msgBox->exec();
delete msgBox;
//delete horizontalSpacer;
//delete layout;
To copy to clipboard, switch view to plain text mode
but if I uncomment last two lines my program exits. Why?
thanks in advance
best regards
Tomasz
Bookmarks