MCPcopy Create free account
hub / github.com/MITK/MITK / SetupWidgets

Method SetupWidgets

Examples/Tutorial/Step8/Step8.cpp:30–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30void Step8::SetupWidgets()
31{
32 //*************************************************************************
33 // Part I: Create windows and pass the tree to it
34 //*************************************************************************
35
36 // Create toplevel widget with vertical layout
37 QVBoxLayout *vlayout = new QVBoxLayout(this);
38 vlayout->setContentsMargins({});
39 vlayout->setSpacing(2);
40
41 // Create viewParent widget with horizontal layout
42 QWidget *viewParent = new QWidget(this);
43 vlayout->addWidget(viewParent);
44 QHBoxLayout *hlayout = new QHBoxLayout(viewParent);
45 hlayout->setContentsMargins({});
46
47 //*************************************************************************
48 // Part Ia: create and initialize QmitkStdMultiWidget
49 //*************************************************************************
50 QmitkStdMultiWidget *multiWidget = new QmitkStdMultiWidget(viewParent);
51
52 hlayout->addWidget(multiWidget);
53
54 // Tell the multiWidget which DataStorage to render
55 multiWidget->SetDataStorage(m_DataStorage);
56
57 // Initialize the multiWidget with the render windows
58 multiWidget->InitializeMultiWidget();
59 multiWidget->ResetCrosshair();
60
61 // Add the displayed views to the DataStorage to see their positions in 2D and 3D
62 multiWidget->AddPlanesToDataStorage();
63
64 // Turn on the menu widgets
65 multiWidget->ActivateMenuWidget(true);
66
67 //*************************************************************************
68 // Part Ib: create and initialize LevelWindowWidget
69 //*************************************************************************
70 QmitkLevelWindowWidget *levelWindowWidget = new QmitkLevelWindowWidget(viewParent);
71
72 hlayout->addWidget(levelWindowWidget);
73
74 // Tell the levelWindowWidget which DataStorage to access
75 levelWindowWidget->SetDataStorage(m_DataStorage);
76
77}
78/**
79 \example Step8.cpp
80 */

Callers

nothing calls this directly

Calls 5

SetDataStorageMethod · 0.45
InitializeMultiWidgetMethod · 0.45
ResetCrosshairMethod · 0.45
ActivateMenuWidgetMethod · 0.45

Tested by

no test coverage detected