Fix Message Delete Button.

Now, frame is cleared and next message selected.
This commit is contained in:
Phenom 2020-04-14 14:29:37 +02:00
parent b6c5e2f188
commit 2dc2b3598d
6 changed files with 93 additions and 24 deletions

View file

@ -405,3 +405,23 @@ QString misc::getExistingDirectory(QWidget *parent, const QString &caption, cons
return QFileDialog::getExistingDirectory(parent, caption, dir, QFileDialog::DontUseNativeDialog | QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
#endif
}
/*!
* Clear a Layout content
* \param layout: Layout to Clear
*/
void misc::clearLayout(QLayout * layout) {
if (! layout)
return;
while (auto item = layout->takeAt(0))
{
if (auto *widget = item->widget())
widget->deleteLater();
if (auto *spacer = item->spacerItem())
delete spacer;
clearLayout(item->layout());
delete item;
}
}