From c70aef5c0fa2bfcf63457d679ed956f5077fefff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Thu, 9 Jun 2011 17:17:24 +0200 Subject: QmlInspector: Some cleanup in the Color Picker tool Also, the tool now picks a color on press rather than on release. (cherry picked from commit e045046c694ea98c5f3b651c99e1cb9eed2e045c in Qt 5 / QtDeclarative, to make synchronizing future changes easier) Change-Id: I068801ff969c9eadd538dd93b92916677b2c97ca Reviewed-by: Kai Koehne --- .../qmldbg_inspector/editor/colorpickertool.cpp | 37 ++-------------------- .../qmldbg_inspector/editor/colorpickertool.h | 17 +++++----- 2 files changed, 10 insertions(+), 44 deletions(-) diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp index 9cef6b5..72e1380 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp @@ -61,56 +61,23 @@ ColorPickerTool::ColorPickerTool(QDeclarativeViewInspector *view) : ColorPickerTool::~ColorPickerTool() { - } -void ColorPickerTool::mousePressEvent(QMouseEvent * /*event*/) -{ -} - -void ColorPickerTool::mouseMoveEvent(QMouseEvent *event) +void ColorPickerTool::mousePressEvent(QMouseEvent *event) { pickColor(event->pos()); } -void ColorPickerTool::mouseReleaseEvent(QMouseEvent *event) +void ColorPickerTool::mouseMoveEvent(QMouseEvent *event) { pickColor(event->pos()); } -void ColorPickerTool::mouseDoubleClickEvent(QMouseEvent * /*event*/) -{ -} - - -void ColorPickerTool::hoverMoveEvent(QMouseEvent * /*event*/) -{ -} - -void ColorPickerTool::keyPressEvent(QKeyEvent * /*event*/) -{ -} - -void ColorPickerTool::keyReleaseEvent(QKeyEvent * /*keyEvent*/) -{ -} -void ColorPickerTool::wheelEvent(QWheelEvent * /*event*/) -{ -} - -void ColorPickerTool::itemsAboutToRemoved(const QList &/*itemList*/) -{ -} - void ColorPickerTool::clear() { view()->setCursor(Qt::CrossCursor); } -void ColorPickerTool::selectedItemsChanged(const QList &/*itemList*/) -{ -} - void ColorPickerTool::pickColor(const QPoint &pos) { QRgb fillColor = view()->backgroundBrush().color().rgb(); diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.h b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.h index 8c8152b..a28ffea 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.h +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.h @@ -60,17 +60,17 @@ public: void mousePressEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - void mouseDoubleClickEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *) {} + void mouseDoubleClickEvent(QMouseEvent *) {} - void hoverMoveEvent(QMouseEvent *event); + void hoverMoveEvent(QMouseEvent *) {} - void keyPressEvent(QKeyEvent *event); - void keyReleaseEvent(QKeyEvent *keyEvent); + void keyPressEvent(QKeyEvent *) {} + void keyReleaseEvent(QKeyEvent *) {} - void wheelEvent(QWheelEvent *event); + void wheelEvent(QWheelEvent *) {} - void itemsAboutToRemoved(const QList &itemList); + void itemsAboutToRemoved(const QList &) {} void clear(); @@ -78,8 +78,7 @@ signals: void selectedColorChanged(const QColor &color); protected: - - void selectedItemsChanged(const QList &itemList); + void selectedItemsChanged(const QList &) {} private: void pickColor(const QPoint &pos); -- cgit v0.12