diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp index 25aa7fb9c84..fba23227f43 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp @@ -36,22 +36,6 @@ #include -// To get close event from dock widget (close event in this case means pressing x button) -class Dock_widget_event_filter : public QObject -{ - Q_OBJECT -public: -signals: - void dock_widget_closed(); -protected: - bool eventFilter(QObject *, QEvent *event) { - if(event->type() == QEvent::Close) { - emit dock_widget_closed(); - } - return false; - } -}; - // Class for visualizing holes in a polyhedron // provides mouse selection functionality class Q_DECL_EXPORT Scene_polylines_collection : public Scene_item @@ -330,7 +314,13 @@ public slots: void item_about_to_be_destroyed(Scene_item*); void item_changed_polylines_collection(); void dock_widget_closed(); - +protected: + bool eventFilter(QObject *, QEvent *event) { + if(event->type() == QEvent::Close) { + dock_widget_closed(); + } + return false; + } private: struct Nop_functor { template @@ -345,7 +335,6 @@ private: QDockWidget* dock_widget; Ui::HoleFilling ui_widget; - Dock_widget_event_filter filter; // hold created facet for accept reject functionality std::vector new_facets; @@ -390,7 +379,7 @@ void Polyhedron_demo_hole_filling_plugin::init(QMainWindow* mainWindow, dock_widget = new QDockWidget("Hole Filling", mw); dock_widget->setVisible(false); - dock_widget->installEventFilter(&filter); + dock_widget->installEventFilter(this); ui_widget.setupUi(dock_widget); ui_widget.Accept_button->setVisible(false); @@ -398,7 +387,6 @@ void Polyhedron_demo_hole_filling_plugin::init(QMainWindow* mainWindow, mw->addDockWidget(Qt::LeftDockWidgetArea, dock_widget); - connect(&filter, SIGNAL(dock_widget_closed()), this, SLOT(dock_widget_closed())); connect(ui_widget.Visualize_holes_button, SIGNAL(clicked()), this, SLOT(on_Visualize_holes_button())); connect(ui_widget.Fill_selected_holes_button, SIGNAL(clicked()), this, SLOT(on_Fill_selected_holes_button())); connect(ui_widget.Fill_all_holes_button, SIGNAL(clicked()), this, SLOT(on_Fill_all_holes_button()));