#pragma once #include "iGridLineItem.h" // 列表区分组(应用于模型选择) class X_GUI_GRIDPTY_EXPORT iGridLineGroup : public iGridLineItem { Q_OBJECT public: explicit iGridLineGroup(iGridLineItem* pParent = NULL); ~iGridLineGroup(); protected: // 绘图 virtual void paint(QPainter* pPainter); virtual void paintGroup(QPainter* pPainter, int nCountVisible); virtual void paintItem(QPainter* pPainter); virtual bool isPaintNeeded(); virtual void _paintItemIcon(QPainter* pPainter); virtual void _paintItemTag(QPainter* pPainter, QString s); public: // 位置相关Bounds virtual void setBounds(QRectF& rt); //全局 virtual QRectF getIconBound(); //Icon的Bound virtual QRectF getLeftBounds(); //左 virtual double getItemHeight(); //当前节点高度,包括孩子 int getChildVisibleCount(); //可见的孩子数目 // 当前节点及孩子中的特定状态的节点(唯一) virtual iGridLineItem* getItemOfState(LineItemState o); public: virtual bool hitTest(QPoint pt, GridTickPos& ht, \ iGridLineItem*& pItem); virtual bool hitTest_SelfOnly(QPoint pt, GridTickPos& ht, \ iGridLineItem*& pItem); protected: // 其它常量 double m_fIconWidth; double m_fIconMarginH; double m_fIconMarginV; // Group模式的背景色 QColor m_vecBackColors[3]; // 图标 QPixmap m_oPixCollapse; QPixmap m_oPixExpand; };