QtBootSender.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef _RVC_QT_BOOT_SENDER_H__
  2. #define _RVC_QT_BOOT_SENDER_H__
  3. #include "sp_gui_def.h"
  4. #include <Widgets/QtMessageInfo.h>
  5. #include <Widgets/BootWidget.h>
  6. #include <QApplication>
  7. #include <QObject>
  8. #include "SpBase.h"
  9. int qt_gui_create_format(sp_gui_format_t** p_gui);
  10. void qt_gui_destroy_format(sp_gui_format_t* p_gui);
  11. // type: 0 normal msg; 1 bluescreen; 2 fatal error
  12. int qt_gui_show_running_info(void* gui, const char* msg, int type);
  13. int qt_gui_show_entity_info(void* gui, const char* entity, int state);
  14. int qt_gui_display(void* gui);
  15. int qt_gui_undisplay(void* gui);
  16. void qt_gui_post_message(void* gui, unsigned long param1, unsigned long param2);
  17. class QtBootSender : public QObject
  18. {
  19. Q_OBJECT
  20. public:
  21. QtBootSender(QObject* parent = nullptr) :QObject(parent)
  22. {
  23. }
  24. ~QtBootSender() {}
  25. void SendShowMessage(const char* msg, MessageType type = TextEvent, int param1 = 0, int param2 = 0)
  26. {
  27. QtMessageInfo message;
  28. message.content = QString(msg);
  29. message.type = type;
  30. message.param1 = param1;
  31. message.param2 = param2;
  32. QVariant var;
  33. var.setValue(message);
  34. emit ShowMessageVariant(var);
  35. }
  36. void SendEntityInfo(QEntityActiveInfo info)
  37. {
  38. QVariant var;
  39. var.setValue(info);
  40. emit SendEntityStateChange(var);
  41. }
  42. signals:
  43. void SendEntityStateChange(QVariant entityInfo);
  44. void ShowMessage(const QtMessageInfo* meesage);
  45. void ShowMessageVariant(QVariant info);
  46. };
  47. #endif //_RVC_QT_BOOT_SENDER_H__