From 7ed41613def11a4c01bfb8c1da5239a68bd341dd Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sun, 26 Mar 2023 21:12:14 +0200 Subject: [PATCH] Add ControllerWidget::insertAfterTab() to put a new tab where we want. --- hurricane/src/viewer/ControllerWidget.cpp | 13 +++++++++++++ .../src/viewer/hurricane/viewer/ControllerWidget.h | 1 + 2 files changed, 14 insertions(+) diff --git a/hurricane/src/viewer/ControllerWidget.cpp b/hurricane/src/viewer/ControllerWidget.cpp index bdab568d..4b425f10 100644 --- a/hurricane/src/viewer/ControllerWidget.cpp +++ b/hurricane/src/viewer/ControllerWidget.cpp @@ -658,6 +658,19 @@ namespace Hurricane { } + void ControllerWidget::insertTabAfter ( const QString& ref, QWidget* tab, const QString& label ) + { + for ( int itab=0 ; true; ++itab ) { + QWidget* refTab = widget( itab ); + if (not refTab) break; + if (refTab->objectName() != ref) continue; + insertTab( itab, tab, label ); + return; + } + addTab( tab, label ); + } + + // ------------------------------------------------------------------- // Class : "ControllerWidget::GraphicsObserver". diff --git a/hurricane/src/viewer/hurricane/viewer/ControllerWidget.h b/hurricane/src/viewer/hurricane/viewer/ControllerWidget.h index e3811f06..a74f2713 100644 --- a/hurricane/src/viewer/hurricane/viewer/ControllerWidget.h +++ b/hurricane/src/viewer/hurricane/viewer/ControllerWidget.h @@ -312,6 +312,7 @@ namespace Hurricane { inline TabSettings* getSettings (); void setCellWidget ( CellWidget* ); //inline int addSetting ( QWidget* page, const QString& label ); + void insertTabAfter ( const QString& ref, QWidget*, const QString& label ); public slots: void graphicsUpdated (); void cellPreModificate ();