12345678910111213141516171819202122232425262728293031323334 |
- #ifndef CSCHEMEVIEW_H
- #define CSCHEMEVIEW_H
- #include <QGraphicsView>
- class CSchemeItem;
- class CSchemeView : public QGraphicsView
- {
- public:
- CSchemeView(QWidget *parent = nullptr);
- void addItem(CSchemeItem *item);
- void clear();
- void refreshItems();
- qreal maxItemHeight() const;
- void refreshItemsGeometry();
- private:
- QGraphicsItemGroup *m_group = nullptr;
- // 场景中显示的项目
- QList<CSchemeItem *> m_schemes;
- QList<QGraphicsItem *> m_items;
- qreal m_hNodeSpace = 50;
- };
- #endif // CSCHEMEVIEW_H
|