@@ -135,16 +135,13 QChartView::RubberBands QChartView::rubberBand() const | |||
|
135 | 135 | */ |
|
136 | 136 | void QChartView::mousePressEvent(QMouseEvent *event) |
|
137 | 137 | { |
|
138 | if (d_ptr->m_rubberBand && d_ptr->m_rubberBand->isEnabled() && event->button() == Qt::LeftButton) { | |
|
139 | ||
|
140 | 138 |
|
|
141 | ||
|
142 |
|
|
|
139 | if (d_ptr->m_rubberBand && d_ptr->m_rubberBand->isEnabled() | |
|
140 | && event->button() == Qt::LeftButton && plotArea.contains(event->pos())) { | |
|
143 | 141 |
|
|
144 | 142 |
|
|
145 | 143 |
|
|
146 | 144 |
|
|
147 | } | |
|
148 | 145 | } else { |
|
149 | 146 | QGraphicsView::mousePressEvent(event); |
|
150 | 147 | } |
@@ -181,8 +178,8 void QChartView::mouseMoveEvent(QMouseEvent *event) | |||
|
181 | 178 | */ |
|
182 | 179 | void QChartView::mouseReleaseEvent(QMouseEvent *event) |
|
183 | 180 | { |
|
184 | if (d_ptr->m_rubberBand) { | |
|
185 |
if (event->button() == Qt::LeftButton |
|
|
181 | if (d_ptr->m_rubberBand && d_ptr->m_rubberBand->isVisible()) { | |
|
182 | if (event->button() == Qt::LeftButton) { | |
|
186 | 183 | d_ptr->m_rubberBand->hide(); |
|
187 | 184 | QRectF rect = d_ptr->m_rubberBand->geometry(); |
|
188 | 185 | // Since plotArea uses QRectF and rubberband uses QRect, we can't just blindly use |
General Comments 0
You need to be logged in to leave comments.
Login now