canvas.h 725 B

1234567891011121314151617181920212223242526272829303132333435
  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. void clear();
  18. protected:
  19. void paintEvent(QPaintEvent *event) override;
  20. private:
  21. QColor m_backgroundColor;
  22. QList<QWidget *> m_widgetList;
  23. QList<QStringList> m_parameterList;
  24. };
  25. #endif // CANVAS_H