canvas.h 807 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. bool isDefault() const;
  18. void clear();
  19. int parameterCount() const;
  20. protected:
  21. void paintEvent(QPaintEvent *event) override;
  22. private:
  23. QColor m_backgroundColor;
  24. QList<QWidget *> m_widgetList;
  25. QList<QStringList> m_parameterList;
  26. bool m_isDefault;
  27. };
  28. #endif // CANVAS_H