mirror of https://github.com/CGAL/cgal
remove separate event filter, directly filter with plugin
This commit is contained in:
parent
5c2ef6d32e
commit
44a225e0e2
|
|
@ -36,22 +36,6 @@
|
|||
|
||||
#include <boost/function_output_iterator.hpp>
|
||||
|
||||
// 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<class T>
|
||||
|
|
@ -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<Polyhedron::Facet_handle> 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()));
|
||||
|
|
|
|||
Loading…
Reference in New Issue