Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 5a02940c rédigé par Kubat's avatar Kubat
Parcourir les fichiers

UI: Ensure the delete of the contained widget in the UnclosableDockWidget at destruction time

parent f75b4c1f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!18Implement the VivyDocument specification
...@@ -9,6 +9,14 @@ UnclosableDockWidget::UnclosableDockWidget(const QString &name, QWidget *parent) ...@@ -9,6 +9,14 @@ UnclosableDockWidget::UnclosableDockWidget(const QString &name, QWidget *parent)
DockWidgetTitleBar::addToDock(this); DockWidgetTitleBar::addToDock(this);
} }
UnclosableDockWidget::~UnclosableDockWidget() noexcept
{
QWidget *w = widget();
if (w != nullptr)
delete w;
setWidget(nullptr);
}
void void
UnclosableDockWidget::closeEvent(QCloseEvent *event) noexcept UnclosableDockWidget::closeEvent(QCloseEvent *event) noexcept
{ {
...@@ -21,6 +29,5 @@ UnclosableDockWidget::closeEvent(QCloseEvent *event) noexcept ...@@ -21,6 +29,5 @@ UnclosableDockWidget::closeEvent(QCloseEvent *event) noexcept
void void
UnclosableDockWidget::allowClose() noexcept UnclosableDockWidget::allowClose() noexcept
{ {
// qDebug() << "Dock" << windowTitle() << "is now allowed to be closed";
allowedToClose = true; allowedToClose = true;
} }
...@@ -10,6 +10,7 @@ class UnclosableDockWidget final : public QDockWidget { ...@@ -10,6 +10,7 @@ class UnclosableDockWidget final : public QDockWidget {
public: public:
explicit UnclosableDockWidget(const QString &, QWidget *parent) noexcept; explicit UnclosableDockWidget(const QString &, QWidget *parent) noexcept;
~UnclosableDockWidget() noexcept override;
void allowClose() noexcept; void allowClose() noexcept;
protected: protected:
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter