@@ -23,7 +23,7 @@ QPointer<DockPopupWindow> DockItem::PopupWindow(nullptr);
2323DockItem::DockItem (QWidget *parent)
2424 : QWidget(parent)
2525 , m_hover(false )
26- , m_down (false )
26+ , m_pressed (false )
2727 , m_popupShown(false )
2828 , m_tapAndHold(false )
2929 , m_draging(false )
@@ -135,14 +135,14 @@ void DockItem::updatePopupPosition()
135135
136136void DockItem::paintEvent (QPaintEvent *e)
137137{
138- if (m_hover && !m_down )
138+ if (m_hover && !m_pressed )
139139 {
140140 QPainter painter (this );
141141 painter.setBrush (QBrush (QColor (248 , 248 , 255 )));
142142 painter.setPen (Qt::NoPen);
143143 QRect tempRect = rect ();
144144 painter.drawRect (tempRect.x (), tempRect.y (), tempRect.width (), tempRect.height ());
145- }else if (m_hover && m_down )
145+ }else if (m_hover && m_pressed )
146146 {
147147 QPainter painter (this );
148148 painter.setBrush (Qt::gray);
@@ -156,7 +156,7 @@ void DockItem::paintEvent(QPaintEvent *e)
156156void DockItem::mousePressEvent (QMouseEvent *e)
157157{
158158 m_popupTipsDelayTimer->stop ();
159- m_down = true ;
159+ m_pressed = true ;
160160 hideNonModel ();
161161
162162 if (e->button () == Qt::RightButton) {
@@ -195,7 +195,7 @@ void DockItem::leaveEvent(QEvent *e)
195195 QWidget::leaveEvent (e);
196196
197197 m_hover = false ;
198- m_down = false ;
198+ m_pressed = false ;
199199 // FIXME: 可能是qt的bug,概率性导致崩溃,待修复
200200// m_hoverEffect->setHighlighting(false);
201201 m_popupTipsDelayTimer->stop ();
@@ -209,7 +209,7 @@ void DockItem::leaveEvent(QEvent *e)
209209
210210void DockItem::mouseReleaseEvent (QMouseEvent *event)
211211{
212- m_down = false ;
212+ m_pressed = false ;
213213 QWidget::mouseReleaseEvent (event);
214214 update ();
215215}
0 commit comments