Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::Forms::DropdownQuestion Class Reference

A Question whose possible responses are represented by a combo box. More...

#include <mitkDropdownQuestion.h>

Inheritance diagram for mitk::Forms::DropdownQuestion:
Collaboration diagram for mitk::Forms::DropdownQuestion:

Public Member Functions

 ~DropdownQuestion () override
 Virtual destructor. More...
 
std::string GetType () const override
 Return the type string "Drop-down". More...
 
Question * CreateAnother () const override
 Create a new default-constructed DropdownQuestion instance. More...
 
void FromJSON (const nlohmann::ordered_json &j) override
 Deserialize this DropdownQuestion from JSON. More...
 
void ToJSON (nlohmann::ordered_json &j) const override
 Serialize this DropdownQuestion to JSON. More...
 
virtual void SetResponse (size_t i)
 Set one of the possible answer options as the single response. More...
 
- Public Member Functions inherited from mitk::Forms::QuestionWithOptions
 ~QuestionWithOptions () override
 Virtual destructor. More...
 
std::vector< std::string > GetResponsesAsStrings () const override
 Return the selected options as strings. More...
 
void ClearResponses () override
 Clear all selected responses. More...
 
bool IsComplete () const override
 Check whether at least one option has been selected. More...
 
size_t AddOption (const std::string &option)
 Add a non-exclusive option as possible answer to the question. More...
 
std::vector< std::string > GetOptions () const
 Get all available options. More...
 
- Public Member Functions inherited from mitk::Forms::Question
 Question ()
 Default constructor. More...
 
virtual ~Question ()
 Virtual destructor. More...
 
std::string GetQuestionText () const
 Get the literal question text. More...
 
void SetQuestionText (const std::string &question)
 Set the literal question text. More...
 
bool IsRequired () const
 Check whether a response to this question is required to complete a form. More...
 
void SetRequired (bool required=true)
 Set whether a response to this question is required to complete a form. More...
 
virtual std::string GetRequiredText () const
 Get the text that should be displayed to clearly mark a question as required. More...
 
virtual bool HasFileResponses () const
 Query whether the responses given to this question are file paths. More...
 
virtual std::vector< fs::path > SubmitFileResponses (const fs::path &basePath) const
 Attach response files to submission. More...
 

Additional Inherited Members

- Protected Member Functions inherited from mitk::Forms::QuestionWithOptions
void AddResponse (size_t i)
 Add one of the possible answer options to the responses. More...
 
void RemoveResponse (size_t i)
 Remove one of the already given responses. More...
 
virtual void SetResponse (size_t i)
 Set one of the possible answer options as the single response. More...
 

Detailed Description

A Question whose possible responses are represented by a combo box.

The question can have a single response.

See also
MultipleChoiceQuestion, CheckboxesQuestion

Definition at line 26 of file mitkDropdownQuestion.h.

Constructor & Destructor Documentation

◆ ~DropdownQuestion()

mitk::Forms::DropdownQuestion::~DropdownQuestion ( )
override

Virtual destructor.

Member Function Documentation

◆ CreateAnother()

Question* mitk::Forms::DropdownQuestion::CreateAnother ( ) const
overridevirtual

Create a new default-constructed DropdownQuestion instance.

Returns
A pointer to a new DropdownQuestion. The caller takes ownership.

Implements mitk::Forms::Question.

◆ FromJSON()

void mitk::Forms::DropdownQuestion::FromJSON ( const nlohmann::ordered_json &  j)
overridevirtual

Deserialize this DropdownQuestion from JSON.

Parameters
[in]jThe JSON object to deserialize from.

Implements mitk::Forms::Question.

◆ GetType()

std::string mitk::Forms::DropdownQuestion::GetType ( ) const
overridevirtual

Return the type string "Drop-down".

Returns
The string "Drop-down".

Implements mitk::Forms::Question.

◆ SetResponse()

virtual void mitk::Forms::QuestionWithOptions::SetResponse

Set one of the possible answer options as the single response.

Exposed from QuestionWithOptions. Only a single option may be selected.

◆ ToJSON()

void mitk::Forms::DropdownQuestion::ToJSON ( nlohmann::ordered_json &  j) const
overridevirtual

Serialize this DropdownQuestion to JSON.

Parameters
[out]jThe JSON object to serialize into.

Implements mitk::Forms::Question.


The documentation for this class was generated from the following file: