#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 float getItemHeight(); //当前节点高度,包括孩子 int getChildVisibleCount(); //可见的孩子数目 virtual iGridLineItem* getActiveItem(); //当前节点及孩子中的Active节点 public: virtual bool hitTest(QPoint pt, GridTickPos& ht, \ iGridLineItem*& pItem); virtual bool hitTest_SelfOnly(QPoint pt, GridTickPos& ht, \ iGridLineItem*& pItem); protected: // 其它常量 float m_fIconWidth; float m_fIconMarginH; float m_fIconMarginV; // Group模式的背景色 QColor m_groupBackColor[3]; // 图标 QPixmap m_oPixCollapse; QPixmap m_oPixExpand; };