From d71c8e4f8cde5f73d21aff5efc7c7f038085e4f4 Mon Sep 17 00:00:00 2001 From: iyaz Date: Sat, 3 Aug 2013 00:52:02 +0300 Subject: [PATCH] activate wait cursor --- .../demo/Polyhedron/Polyhedron_demo_fairing_plugin.cpp | 6 ++++-- .../demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp | 4 ++++ .../Polyhedron_demo_hole_filling_polyline_plugin.cpp | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_fairing_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_fairing_plugin.cpp index aa00e2d8fb3..1c317d26d20 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_fairing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_fairing_plugin.cpp @@ -76,7 +76,7 @@ public slots: if(selection_item->selected_vertices.empty()) { print_message("Error: please select a region of vertices!"); } - + QApplication::setOverrideCursor(Qt::WaitCursor); int weight_index = ui_widget.weight_combo_box->currentIndex(); if(weight_index == 1) @@ -88,6 +88,7 @@ public slots: selection_item->selected_vertices.end(), CGAL::internal::Cotangent_weight_with_voronoi_area_fairing()); selection_item->changed_with_poly_item(); + QApplication::restoreOverrideCursor(); } void on_Refine_button_clicked() { @@ -97,7 +98,7 @@ public slots: if(selection_item->selected_facets.empty()) { print_message("Error: please select a region of facets!"); } - + QApplication::setOverrideCursor(Qt::WaitCursor); double alpha = ui_widget.Density_control_factor_spin_box->value(); std::vector new_facets; @@ -108,6 +109,7 @@ public slots: selection_item->selected_facets.insert(*it); } selection_item->changed_with_poly_item(); + QApplication::restoreOverrideCursor(); } private: diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp index e0506595a8e..1f64f734e55 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp @@ -460,6 +460,7 @@ void Polyhedron_demo_hole_filling_plugin::on_Fill_selected_holes_button() { return; } + QApplication::setOverrideCursor(Qt::WaitCursor); // fill selected holes bool any_filled = false; for(Scene_polylines_collection::Selected_holes_set::iterator it = polyline_item->selected_holes.begin(); @@ -472,6 +473,7 @@ void Polyhedron_demo_hole_filling_plugin::on_Fill_selected_holes_button() { last_active_item = polyline_item->poly_item; accept_reject_toggle(true); } + QApplication::restoreOverrideCursor(); }; // fills all holes and removes associated Scene_polylines_collection if any void Polyhedron_demo_hole_filling_plugin::on_Fill_all_holes_button() { @@ -506,6 +508,7 @@ void Polyhedron_demo_hole_filling_plugin::on_Fill_all_holes_button() { return; } + QApplication::setOverrideCursor(Qt::WaitCursor); bool any_filled = false; for(std::vector::iterator it = border_reps.begin(); it != border_reps.end(); ++it) { any_filled |= fill(poly, *it); @@ -516,6 +519,7 @@ void Polyhedron_demo_hole_filling_plugin::on_Fill_all_holes_button() { last_active_item = poly_item; accept_reject_toggle(true); } + QApplication::restoreOverrideCursor(); } // Simply create polyline items and put them into scene - nothing related with other parts of the plugin void Polyhedron_demo_hole_filling_plugin::on_Create_polyline_items_button(){ diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_polyline_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_polyline_plugin.cpp index 1fe1b3d474d..f20851c39ab 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_polyline_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_polyline_plugin.cpp @@ -106,7 +106,8 @@ public slots: bool use_DT = QMessageBox::Yes == QMessageBox::question( NULL, "Use Delaunay Triangulation", "Use Delaunay Triangulation ?", QMessageBox::Yes|QMessageBox::No); - + + QApplication::setOverrideCursor(Qt::WaitCursor); std::size_t counter = 0; for(Scene_polylines_item::Polylines_container::iterator it = polylines_item->polylines.begin(); it != polylines_item->polylines.end(); ++it, ++counter) @@ -147,6 +148,7 @@ public slots: poly_item->setRenderingMode(FlatPlusEdges); scene->setSelectedItem(scene->addItem(poly_item)); } + QApplication::restoreOverrideCursor(); } private: