VImage.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #include "VImage.h"
  2. VImage::VImage(QWidget *parent, CONTROL_PROPERTY* pProperty)
  3. : HWndUnit(parent)
  4. , VControlObject(pProperty)
  5. {
  6. //// 设置默认属性
  7. //QRadioButton::setEnabled(m_Property.m_bEnable);
  8. //style()->unpolish(this);
  9. m_pWidget = this;
  10. m_Type = VALUE_TYPE::Control_Image;
  11. }
  12. VImage::~VImage()
  13. {
  14. }
  15. // 属性的实现函数
  16. void VImage::setEnable(const bool enable)
  17. {
  18. if (this->m_Property.m_bEnable != enable)
  19. {
  20. this->m_Property.m_bEnable = enable;
  21. //QRadioButton::setEnabled(enable);
  22. }
  23. }
  24. void VImage::paintEvent(QPaintEvent*)
  25. {
  26. QPainter painter(this);
  27. painter.drawPixmap(rect(), QPixmap(":/image/Vimage.jpeg"), QRect());
  28. }
  29. /// <summary>
  30. ///
  31. /// </summary>
  32. /// <param name="image"></param>
  33. void VImage::ShowImage(HImage image)
  34. {
  35. HWndUnit::ShowImage(image);
  36. }
  37. /// <summary>
  38. ///
  39. /// </summary>
  40. /// <param name="obj"></param>
  41. /// <param name="color"></param>
  42. /// <param name="fTransparency"></param>
  43. /// <param name="nLinsWhite"></param>
  44. void VImage::ShowObj(HObject obj, QColor color, double fTransparency , int nLinsWhite)
  45. {
  46. HWndUnit::ShowObj(obj, color, fTransparency, nLinsWhite);
  47. }
  48. /// <summary>
  49. ///
  50. /// </summary>
  51. /// <param name="msg"></param>
  52. /// <param name="strColor"></param>
  53. /// <param name="nX"></param>
  54. /// <param name="nY"></param>
  55. /// <param name="nSize"></param>
  56. void VImage::ShowMsg(HTuple msg, QString strColor, int nX, int nY, int nSize)
  57. {
  58. HWndUnit::ShowMsg(msg, strColor, nX, nY, nSize);
  59. }
  60. /// <summary>
  61. ///
  62. /// </summary>
  63. void VImage::Refresh()
  64. {
  65. HWndUnit::Refresh();
  66. }