From 92cb998499571334451c7b6483e8d06f9d819d3d Mon Sep 17 00:00:00 2001 From: ange-clement Date: Mon, 2 Oct 2023 13:16:28 +0200 Subject: [PATCH] Diabled "Alpha slider" on edit box --- .../Plugins/PCA/Scene_edit_box_item.cpp | 15 +++++++++++++++ .../Polyhedron/Plugins/PCA/Scene_edit_box_item.h | 1 + 2 files changed, 16 insertions(+) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.cpp index 91bcde149bab..b007fc612821 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.cpp @@ -281,6 +281,7 @@ struct Scene_edit_box_item_priv{ Scene_edit_box_item::Scene_edit_box_item() { d = nullptr; + contextMenu(); } Scene_edit_box_item::Scene_edit_box_item(const Scene_interface *scene_interface) { @@ -311,12 +312,26 @@ Scene_edit_box_item::Scene_edit_box_item(const Scene_interface *scene_interface) : Vi::PROGRAM_NO_SELECTION, false)); } + contextMenu(); } QString Scene_edit_box_item::toolTip() const { return QString(); } + +QMenu* Scene_edit_box_item::contextMenu() +{ + // diasable "Alpha slider" in menu + QMenu* resMenu = Scene_item::contextMenu(); + bool prop = property("menu_changed").toBool(); + if(!prop) + { + setProperty("menu_changed", true); + } + return resMenu; +} + void Scene_edit_box_item::drawSpheres(Viewer_interface *viewer, const QMatrix4x4 f_matrix ) const { GLdouble d_mat[16]; diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.h b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.h index 4d8988955655..0d99b9ce08ed 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.h +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.h @@ -33,6 +33,7 @@ class SCENE_EDIT_BOX_ITEM_EXPORT Scene_edit_box_item: } QString toolTip() const; + QMenu* contextMenu(); bool eventFilter(QObject *, QEvent *); // Indicate if rendering mode is supported