| 40 | { |
| 41 | } |
| 42 | QWidget *QmitkPropertyViewFactory::CreateView(const mitk::BaseProperty *property, unsigned int, QWidget *parent) |
| 43 | { |
| 44 | if (const mitk::StringProperty *prop = dynamic_cast<const mitk::StringProperty *>(property)) |
| 45 | { |
| 46 | // a string property |
| 47 | return new QmitkStringPropertyView(prop, parent); |
| 48 | } |
| 49 | else if (const mitk::ColorProperty *prop = dynamic_cast<const mitk::ColorProperty *>(property)) |
| 50 | { |
| 51 | // a color property |
| 52 | return new QmitkColorPropertyView(prop, parent); |
| 53 | } |
| 54 | else if (const mitk::BoolProperty *prop = dynamic_cast<const mitk::BoolProperty *>(property)) |
| 55 | { |
| 56 | // a bool property |
| 57 | // TODO fix after refactoring |
| 58 | auto widget = new QmitkBoolPropertyWidget(parent); |
| 59 | widget->SetProperty(const_cast<mitk::BoolProperty *>(prop)); |
| 60 | return widget; |
| 61 | } |
| 62 | else if (const mitk::IntProperty *prop = dynamic_cast<const mitk::IntProperty *>(property)) |
| 63 | { |
| 64 | // a number property |
| 65 | return new QmitkNumberPropertyView(prop, parent); |
| 66 | } |
| 67 | else if (const mitk::FloatProperty *prop = dynamic_cast<const mitk::FloatProperty *>(property)) |
| 68 | { |
| 69 | // a number property |
| 70 | return new QmitkNumberPropertyView(prop, parent); |
| 71 | } |
| 72 | else if (const mitk::DoubleProperty *prop = dynamic_cast<const mitk::DoubleProperty *>(property)) |
| 73 | { |
| 74 | // a number property |
| 75 | return new QmitkNumberPropertyView(prop, parent); |
| 76 | } |
| 77 | else if (property != nullptr) |
| 78 | { |
| 79 | // some unknown property --> use the GetValueAsString() method to |
| 80 | return new QmitkBasePropertyView(prop, parent); |
| 81 | } |
| 82 | |
| 83 | return nullptr; |
| 84 | } |
| 85 | |
| 86 | QWidget *QmitkPropertyViewFactory::CreateEditor(mitk::BaseProperty *property, unsigned int type, QWidget *parent) |
| 87 | { |
nothing calls this directly
no test coverage detected