File tree Expand file tree Collapse file tree
src/front_end_utils/include Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22#define FRONT_END_UTILS_HXX
33
44#include < qcolor.h>
5+ #include < qcontainerfwd.h>
56#include < qicon.h>
7+ #include < qmessagebox.h>
68#include < qpixmap.h>
79#include < qstringview.h>
10+ #include < qwidget.h>
811
912#include < initializer_list>
1013#include < type_traits>
@@ -37,7 +40,7 @@ inline constexpr bool is_valid_hex_color(const Args&... args) noexcept {
3740 ...);
3841}
3942
40- inline QIcon image_from_bytes (const initializer_list<uint8_t >& data) {
43+ inline QIcon image_from_bytes (const initializer_list<uint8_t >& data) noexcept {
4144 QByteArray bytes_array;
4245 bytes_array.reserve (static_cast <int >(data.size ()));
4346
@@ -53,6 +56,14 @@ inline QIcon image_from_bytes(const initializer_list<uint8_t>& data) {
5356 return QIcon ();
5457}
5558
59+ inline void error_dialog_show (QWidget* parent, const QString& message,
60+ ErrorTypes error_types) noexcept {
61+ auto error_string = error_to_string (error_types).data ();
62+ auto fmt_msg = QString (" %1\n Error name: %2" ).arg (message).arg (error_string);
63+
64+ QMessageBox::critical (parent, " Error" , fmt_msg);
65+ }
66+
5667} // namespace Lazyboard::front_end_utils
5768
5869#endif
You can’t perform that action at this time.
0 commit comments