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