FlowArithmeticCalculator 1.0.0
Flow Arithmetic Calculator
Loading...
Searching...
No Matches
GuiMessageBox.cpp
Go to the documentation of this file.
1#include "GuiMessageBox.h"
2
4 void GuiMessageBox::showWarning(const std::string& title,
5 const std::string& message,
7 const auto app = createTempQApplication();
8
9 QMessageBox::warning(
10 nullptr, QString::fromStdString(title), QString::fromStdString(message));
11
12 // restore focus to the window
13 windowDelegate->focusWindow();
14 }
15
17 const std::string& title,
18 const std::string& message,
20 const auto app = createTempQApplication();
21
22 bool const retVal =
23 QMessageBox::question(nullptr,
24 QString::fromStdString(title),
25 QString::fromStdString(message)) == QMessageBox::Yes;
26
27 // restore focus to the window
28 windowDelegate->focusWindow();
29
30 return retVal;
31 }
32} // namespace gui::window::prompt
virtual void focusWindow()=0
Focus the window.
static bool promptConfirmation(const std::string &title, const std::string &message, business_logic::delegate::IWindowDelegate *windowDelegate)
static void showWarning(const std::string &title, const std::string &message, business_logic::delegate::IWindowDelegate *windowDelegate)
static std::unique_ptr< QApplication > createTempQApplication()
Create a temporary QApplication instance.
GUI user prompt utilities.