canvas.h 706 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef __CANVAS_H__
  2. #define __CANVAS_H__
  3. #include <QWidget>
  4. #include <libxml/parser.h>
  5. #include <libxml/tree.h>
  6. class Canvas : public QWidget
  7. {
  8. Q_OBJECT
  9. public:
  10. explicit Canvas(const xmlNodePtr canvasNodePtr, QWidget *parent = nullptr);
  11. ~Canvas();
  12. const QColor &backgroundColor() const;
  13. void setBackgroundColor(const QColor &newBackgroundColor);
  14. bool load(const xmlNodePtr canvasNodePtr);
  15. QList<QWidget *> widgetList() const;
  16. QList<QStringList> parameterList() const;
  17. protected:
  18. void paintEvent(QPaintEvent *event) override;
  19. private:
  20. QColor m_backgroundColor;
  21. QList<QWidget *> m_widgetList;
  22. QList<QStringList> m_parameterList;
  23. };
  24. #endif // CANVAS_H