5 const std::string& title,
6 const std::string& prompt,
7 const std::string& defaultValue,
12 const QString text = QInputDialog::getText(
nullptr,
13 QString::fromStdString(title),
14 QString::fromStdString(prompt),
16 QString::fromStdString(defaultValue),
22 if (ok && !text.isEmpty()) {
23 return text.toStdString();
32 const std::string& title,
33 const std::string& prompt,
34 const std::optional<FloatingPoint>& defaultValue,
37 title, prompt, defaultValue ? (defaultValue.value()).str() :
"", windowDelegate);
39 if (!input.has_value()) {
43 auto strValue = input.value();
45 std::ranges::replace(strValue,
',',
'.');
49 }
catch (
const std::runtime_error&) {
The delegate for the window.
virtual void focusWindow()=0
Focus the window.
static std::unique_ptr< QApplication > createTempQApplication()
Create a temporary QApplication instance.
static std::optional< std::string > promptForTextInput(const std::string &title, const std::string &prompt, const std::string &defaultValue, business_logic::delegate::IWindowDelegate *windowDelegate)
static std::optional< FloatingPoint > promptForFloatingPointInput(const std::string &title, const std::string &prompt, const std::optional< FloatingPoint > &defaultValue, business_logic::delegate::IWindowDelegate *windowDelegate)
GUI user prompt utilities.
boost::multiprecision::cpp_dec_float_50 FloatingPoint