Commit 2c95738b authored by Christoffer Ackelman's avatar Christoffer Ackelman Committed by Esteban Blanc

QT: Fixed PLC editor closing when the user clicked cancel in the confirm box.

parent 64f06da2
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#include "wb_watt_qt.h" #include "wb_watt_qt.h"
#include "wb_watttext_qt.h" #include "wb_watttext_qt.h"
#include <QCloseEvent>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QMenu> #include <QMenu>
#include <QMenuBar> #include <QMenuBar>
...@@ -578,7 +579,7 @@ void WFoeQt::destroy() ...@@ -578,7 +579,7 @@ void WFoeQt::destroy()
delete navctx; delete navctx;
/* Destroy the widget */ /* Destroy the widget */
toplevel->close(); delete toplevel;
// Yes, this is intentional, we want to call the destructor here. // Yes, this is intentional, we want to call the destructor here.
delete this; delete this;
...@@ -725,7 +726,7 @@ void WFoeQt::pop() ...@@ -725,7 +726,7 @@ void WFoeQt::pop()
void WFoeQtWidget::closeEvent(QCloseEvent* event) void WFoeQtWidget::closeEvent(QCloseEvent* event)
{ {
foe->activate_quit(); foe->activate_quit();
QWidget::closeEvent(event); event->ignore();
} }
// Create a new foe window // Create a new foe window
...@@ -747,7 +748,6 @@ pwr_tStatus WFoeQt::create_window(int x_top, int y_top, int width_adb, ...@@ -747,7 +748,6 @@ pwr_tStatus WFoeQt::create_window(int x_top, int y_top, int width_adb,
pwr_tStatus sts; pwr_tStatus sts;
toplevel->setMinimumSize(1100, 1000); toplevel->setMinimumSize(1100, 1000);
toplevel->setAttribute(Qt::WA_DeleteOnClose);
CoWowQt::SetWindowIcon(toplevel); CoWowQt::SetWindowIcon(toplevel);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment