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
- #include " Gui/MainWindow .h"
42
+ #include " Gui/Selection .h"
45
43
#include " Mod/Fem/App/FemConstraint.h"
46
44
47
- #include " TaskFemConstraint.h"
48
45
#include " ViewProviderFemConstraint.h"
49
46
#include " ViewProviderFemConstraintPy.h"
50
47
@@ -60,9 +57,6 @@ ViewProviderFemConstraint::ViewProviderFemConstraint()
60
57
, pExtraSymbol(nullptr )
61
58
, pExtraTrans(nullptr )
62
59
, ivFile(nullptr )
63
- , wizardWidget(nullptr )
64
- , wizardSubLayout(nullptr )
65
- , constraintDialog(nullptr )
66
60
{
67
61
pShapeSep = new SoSeparator ();
68
62
pShapeSep->ref ();
@@ -151,7 +145,7 @@ void ViewProviderFemConstraint::setDisplayMode(const char* ModeName)
151
145
if (strcmp (ModeName, " Base" ) == 0 ) {
152
146
setDisplayMaskMode (" Base" );
153
147
}
154
- ViewProviderDocumentObject ::setDisplayMode (ModeName);
148
+ ViewProviderGeometryObject ::setDisplayMode (ModeName);
155
149
}
156
150
157
151
std::vector<App::DocumentObject*> ViewProviderFemConstraint::claimChildren () const
@@ -164,7 +158,7 @@ void ViewProviderFemConstraint::setupContextMenu(QMenu* menu, QObject* receiver,
164
158
QAction* act;
165
159
act = menu->addAction (QObject::tr (" Edit analysis feature" ), receiver, member);
166
160
act->setData (QVariant ((int )ViewProvider::Default));
167
- ViewProviderDocumentObject ::setupContextMenu (menu,
161
+ ViewProviderGeometryObject ::setupContextMenu (menu,
168
162
receiver,
169
163
member); // clazy:exclude=skipped-base-method
170
164
}
@@ -283,26 +277,12 @@ void ViewProviderFemConstraint::unsetEdit(int ModNum)
283
277
{
284
278
// clear the selection (convenience)
285
279
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')" );
280
+ if (ModNum == ViewProvider::Default) {
281
+ // when pressing ESC make sure to close the dialog
282
+ Gui::Control ().closeDialog ();
297
283
}
298
284
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
- }
285
+ ViewProviderGeometryObject::unsetEdit (ModNum);
306
286
}
307
287
}
308
288
@@ -316,65 +296,6 @@ PyObject* ViewProviderFemConstraint::getPyObject()
316
296
}
317
297
318
298
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
299
// Python feature -----------------------------------------------------------------------
379
300
380
301
namespace Gui
0 commit comments