Commit d73b1ddcff39e94c93ef9ca5f6e4230ea4c8ddaf
Ignore the mouse press event in the bookmark button so that it gets
propagated to the parent widget (the bookmarks toolbar in that case),
which is essential for drag & drop to work properly.
| |   |
| 206 | 206 | return; |
| 207 | 207 | } |
| 208 | 208 | |
| QAction *action = actionAt(event->pos()); |
| QAction *action = actionAt(m_dragStartPosition); |
| 210 | 210 | QModelIndex index = this->index(action); |
| 211 | 211 | if (!index.isValid()) { |
| 212 | 212 | QToolBar::mouseMoveEvent(event); |
| … | … | |
| 228 | 228 | void BookmarksToolBar::mousePressEvent(QMouseEvent *event) |
| 229 | 229 | { |
| 230 | 230 | if (event->button() == Qt::LeftButton) |
| m_dragStartPosition = event->pos(); |
| m_dragStartPosition = mapFromGlobal(event->globalPos()); |
| 232 | 232 | |
| 233 | 233 | QToolBar::mousePressEvent(event); |
| 234 | 234 | } |
| |   |
| 32 | 32 | { |
| 33 | 33 | } |
| 34 | 34 | |
| void BookmarkToolButton::mousePressEvent(QMouseEvent *event) |
| { |
| QToolButton::mousePressEvent(event); |
| event->ignore(); |
| } |
|
| 35 | 41 | void BookmarkToolButton::mouseReleaseEvent(QMouseEvent *event) |
| 36 | 42 | { |
| 37 | 43 | BrowserApplication::instance()->setEventMouseButtons(event->button()); |
| |   |
| 35 | 35 | BookmarkToolButton(QWidget *parent = 0); |
| 36 | 36 | |
| 37 | 37 | protected: |
| void mousePressEvent(QMouseEvent *event); |
| 38 | 39 | void mouseReleaseEvent(QMouseEvent *event); |
| 39 | 40 | |
| 40 | 41 | }; |