Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::Forms::Form::Section Class Reference

A section within a Form, grouping related questions together. More...

#include <mitkForm.h>

Public Member Functions

 Section (const std::string &title="", const std::string &description="")
 Construct a section with optional title and description. More...
 
 ~Section ()
 Destructor. More...
 
 Section (Section &&other) noexcept
 Move constructor. More...
 
Section & operator= (Section &&other) noexcept
 Move assignment operator. More...
 
std::string GetTitle () const
 Get the title of this section. More...
 
void SetTitle (const std::string &title)
 Set the title of this section. More...
 
std::string GetDescription () const
 Get the description of this section. More...
 
void SetDescription (const std::string &description)
 Set the description of this section. More...
 
std::vector< Question * > GetQuestions () const
 Get all questions belonging to this section. More...
 
void AddQuestion (Question *question)
 Add a question to this section. More...
 

Detailed Description

A section within a Form, grouping related questions together.

Each section has its own title and description, and holds a list of Question objects. The Section takes ownership of any Question pointers added to it.

See also
Form

Definition at line 50 of file mitkForm.h.

Constructor & Destructor Documentation

◆ Section() [1/2]

mitk::Forms::Form::Section::Section ( const std::string &  title = "",
const std::string &  description = "" 
)
explicit

Construct a section with optional title and description.

Parameters
[in]titleThe section title.
[in]descriptionThe section description.

◆ ~Section()

mitk::Forms::Form::Section::~Section ( )

Destructor.

◆ Section() [2/2]

mitk::Forms::Form::Section::Section ( Section &&  other)
noexcept

Move constructor.

Member Function Documentation

◆ AddQuestion()

void mitk::Forms::Form::Section::AddQuestion ( Question *  question)

Add a question to this section.

The section takes ownership of the pointer.

Parameters
[in]questionA pointer to the question to add. Ownership is transferred.

◆ GetDescription()

std::string mitk::Forms::Form::Section::GetDescription ( ) const

Get the description of this section.

Returns
The section description.

◆ GetQuestions()

std::vector<Question*> mitk::Forms::Form::Section::GetQuestions ( ) const

Get all questions belonging to this section.

Returns
A vector of non-owning pointers to the questions.

◆ GetTitle()

std::string mitk::Forms::Form::Section::GetTitle ( ) const

Get the title of this section.

Returns
The section title.

◆ operator=()

Section& mitk::Forms::Form::Section::operator= ( Section &&  other)
noexcept

Move assignment operator.

◆ SetDescription()

void mitk::Forms::Form::Section::SetDescription ( const std::string &  description)

Set the description of this section.

Parameters
[in]descriptionThe section description.

◆ SetTitle()

void mitk::Forms::Form::Section::SetTitle ( const std::string &  title)

Set the title of this section.

Parameters
[in]titleThe section title.

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