| 108 | } |
| 109 | |
| 110 | void WizSearchEdit::paintEvent(QPaintEvent* event) |
| 111 | { |
| 112 | QLineEdit::paintEvent(event); |
| 113 | |
| 114 | QPainter pt(this); |
| 115 | QSize szIcon = m_searchIcon.size(); |
| 116 | WizScaleIconSizeForRetina(szIcon); |
| 117 | QRect rcIcon(QPoint(4, (height() - szIcon.height()) / 2 + 1), |
| 118 | szIcon); |
| 119 | pt.drawPixmap(rcIcon, m_searchIcon); |
| 120 | |
| 121 | if (!text().isEmpty()) |
| 122 | { |
| 123 | szIcon = m_deleteIcon.size(); |
| 124 | WizScaleIconSizeForRetina(szIcon); |
| 125 | rcIcon = QRect(QPoint(width() - szIcon.width() - 4, (height() - szIcon.height()) / 2), |
| 126 | szIcon); |
| 127 | pt.drawPixmap(rcIcon, m_deleteIcon); |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | void WizSearchEdit::mousePressEvent(QMouseEvent* event) |
| 132 | { |