32
32
#include < Inventor/nodes/SoShapeHints.h>
33
33
#include < Inventor/nodes/SoTransform.h>
34
34
#include < QAction>
35
- #include < QDockWidget>
36
35
#include < QMenu>
37
- #include < QStackedWidget>
38
36
#endif
39
37
40
38
#include " App/Application.h"
41
39
#include " Gui/Command.h"
42
40
#include " Gui/Control.h"
43
41
#include " Gui/Document.h"
44
42
#include " Gui/MainWindow.h"
43
+ #include " Gui/Selection.h"
45
44
#include " Mod/Fem/App/FemConstraint.h"
46
45
47
- #include " TaskFemConstraint.h"
48
46
#include " ViewProviderFemConstraint.h"
49
47
#include " ViewProviderFemConstraintPy.h"
50
48
@@ -60,8 +58,6 @@ ViewProviderFemConstraint::ViewProviderFemConstraint()
60
58
, pExtraSymbol(nullptr )
61
59
, pExtraTrans(nullptr )
62
60
, ivFile(nullptr )
63
- , wizardWidget(nullptr )
64
- , wizardSubLayout(nullptr )
65
61
, constraintDialog(nullptr )
66
62
{
67
63
pShapeSep = new SoSeparator ();
@@ -151,7 +147,7 @@ void ViewProviderFemConstraint::setDisplayMode(const char* ModeName)
151
147
if (strcmp (ModeName, " Base" ) == 0 ) {
152
148
setDisplayMaskMode (" Base" );
153
149
}
154
- ViewProviderDocumentObject ::setDisplayMode (ModeName);
150
+ ViewProviderGeometryObject ::setDisplayMode (ModeName);
155
151
}
156
152
157
153
std::vector<App::DocumentObject*> ViewProviderFemConstraint::claimChildren () const
@@ -164,7 +160,7 @@ void ViewProviderFemConstraint::setupContextMenu(QMenu* menu, QObject* receiver,
164
160
QAction* act;
165
161
act = menu->addAction (QObject::tr (" Edit analysis feature" ), receiver, member);
166
162
act->setData (QVariant ((int )ViewProvider::Default));
167
- ViewProviderDocumentObject ::setupContextMenu (menu,
163
+ ViewProviderGeometryObject ::setupContextMenu (menu,
168
164
receiver,
169
165
member); // clazy:exclude=skipped-base-method
170
166
}
@@ -283,26 +279,15 @@ void ViewProviderFemConstraint::unsetEdit(int ModNum)
283
279
{
284
280
// clear the selection (convenience)
285
281
Gui::Selection ().clearSelection ();
286
-
287
- if (wizardWidget && wizardSubLayout && constraintDialog) {
288
- wizardWidget = nullptr ;
289
- wizardSubLayout = nullptr ;
290
- delete constraintDialog;
291
- constraintDialog = nullptr ;
292
-
293
- // Notify the Shaft Wizard that we have finished editing
294
- // See WizardShaft.py on why we do it this way
295
- Gui::Command::runCommand (Gui::Command::Doc,
296
- " Gui.runCommand('PartDesign_WizardShaftCallBack')" );
282
+ printf (" unset 0\t %d\n " , ModNum);
283
+ if (ModNum == ViewProvider::Default) {
284
+ // when pressing ESC make sure to close the dialog
285
+ printf (" unset 1\n " );
286
+ Gui::Control ().closeDialog ();
297
287
}
298
288
else {
299
- if (ModNum == ViewProvider::Default) {
300
- // when pressing ESC make sure to close the dialog
301
- Gui::Control ().closeDialog ();
302
- }
303
- else {
304
- ViewProviderGeometryObject::unsetEdit (ModNum);
305
- }
289
+ printf (" unset 2\n " );
290
+ ViewProviderGeometryObject::unsetEdit (ModNum);
306
291
}
307
292
}
308
293
@@ -316,65 +301,6 @@ PyObject* ViewProviderFemConstraint::getPyObject()
316
301
}
317
302
318
303
319
- QObject* ViewProviderFemConstraint::findChildByName (const QObject* parent, const QString& name)
320
- {
321
- for (auto o : parent->children ()) {
322
- if (o->objectName () == name) {
323
- return o;
324
- }
325
- if (!o->children ().empty ()) {
326
- QObject* result = findChildByName (o, name);
327
- if (result) {
328
- return result;
329
- }
330
- }
331
- }
332
-
333
- return nullptr ;
334
- }
335
-
336
- void ViewProviderFemConstraint::checkForWizard ()
337
- {
338
- wizardWidget = nullptr ;
339
- wizardSubLayout = nullptr ;
340
- Gui::MainWindow* mw = Gui::getMainWindow ();
341
- if (!mw) {
342
- return ;
343
- }
344
- QDockWidget* dw = mw->findChild <QDockWidget*>(QString::fromLatin1 (" Combo View" ));
345
- if (!dw) {
346
- return ;
347
- }
348
- QWidget* cw = dw->findChild <QWidget*>(QString::fromLatin1 (" Combo View" ));
349
- if (!cw) {
350
- return ;
351
- }
352
- QTabWidget* tw = cw->findChild <QTabWidget*>(QString::fromLatin1 (" combiTab" ));
353
- if (!tw) {
354
- return ;
355
- }
356
- QStackedWidget* sw =
357
- tw->findChild <QStackedWidget*>(QString::fromLatin1 (" qt_tabwidget_stackedwidget" ));
358
- if (!sw) {
359
- return ;
360
- }
361
- QScrollArea* sa = sw->findChild <QScrollArea*>();
362
- if (!sa) {
363
- return ;
364
- }
365
- QWidget* wd =
366
- sa->widget (); // This is the reason why we cannot use findChildByName() right away!!!
367
- if (!wd) {
368
- return ;
369
- }
370
- QObject* wiz = findChildByName (wd, QString::fromLatin1 (" ShaftWizard" ));
371
- if (wiz) {
372
- wizardWidget = static_cast <QVBoxLayout*>(wiz);
373
- wizardSubLayout = wiz->findChild <QVBoxLayout*>(QString::fromLatin1 (" ShaftWizardLayout" ));
374
- }
375
- }
376
-
377
-
378
304
// Python feature -----------------------------------------------------------------------
379
305
380
306
namespace Gui
0 commit comments