CSchemeView.h 558 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef CSCHEMEVIEW_H
  2. #define CSCHEMEVIEW_H
  3. #include <QGraphicsView>
  4. class CSchemeItem;
  5. class CSchemeView : public QGraphicsView
  6. {
  7. public:
  8. CSchemeView(QWidget *parent = nullptr);
  9. void addItem(CSchemeItem *item);
  10. void clear();
  11. void refreshItems();
  12. qreal maxItemHeight() const;
  13. void refreshItemsGeometry();
  14. private:
  15. QGraphicsItemGroup *m_group = nullptr;
  16. // 场景中显示的项目
  17. QList<CSchemeItem *> m_schemes;
  18. QList<QGraphicsItem *> m_items;
  19. qreal m_hNodeSpace = 50;
  20. };
  21. #endif // CSCHEMEVIEW_H