groupscreendelegate.h 789 B

1234567891011121314151617181920212223242526272829
  1. #ifndef GROUPSCREENDELEGATE_H
  2. #define GROUPSCREENDELEGATE_H
  3. #include "Common/BaseViewEx/buttondelegate.h"
  4. class GroupScreenDelegate : public ButtonDelegate
  5. {
  6. Q_OBJECT
  7. public:
  8. explicit GroupScreenDelegate(QObject *parent = nullptr);
  9. void SetDragTarget(int nTargetRow, bool bIsUpOn);
  10. public:
  11. void PaintText(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
  12. void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
  13. private:
  14. QString GetCheckboxImage(Qt::CheckState state) const;
  15. private:
  16. // 目标行
  17. int m_nTargetRow;
  18. // 指示线是否在目标行上方
  19. bool m_bIsUpOn;
  20. // 指示线圆角
  21. int m_nRadius;
  22. };
  23. #endif // GROUPSCREENDELEGATE_H