diff options
author | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2011-06-09 15:17:24 (GMT) |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2011-06-23 14:38:42 (GMT) |
commit | c70aef5c0fa2bfcf63457d679ed956f5077fefff (patch) | |
tree | 4e7502dfed8e4223418c7e12d1a4f16c8ca1628b /src/plugins/qmltooling | |
parent | 201d6b8d0bfed588d609fd5619470ced78c7718d (diff) | |
download | Qt-c70aef5c0fa2bfcf63457d679ed956f5077fefff.zip Qt-c70aef5c0fa2bfcf63457d679ed956f5077fefff.tar.gz Qt-c70aef5c0fa2bfcf63457d679ed956f5077fefff.tar.bz2 |
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
Diffstat (limited to 'src/plugins/qmltooling')
-rw-r--r-- | src/plugins/qmltooling/qmldbg_inspector/editor/colorpickertool.cpp | 37 | ||||
-rw-r--r-- | src/plugins/qmltooling/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<QGraphicsItem*> &/*itemList*/) -{ -} - void ColorPickerTool::clear() { view()->setCursor(Qt::CrossCursor); } -void ColorPickerTool::selectedItemsChanged(const QList<QGraphicsItem*> &/*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<QGraphicsItem*> &itemList); + void itemsAboutToRemoved(const QList<QGraphicsItem*> &) {} void clear(); @@ -78,8 +78,7 @@ signals: void selectedColorChanged(const QColor &color); protected: - - void selectedItemsChanged(const QList<QGraphicsItem*> &itemList); + void selectedItemsChanged(const QList<QGraphicsItem*> &) {} private: void pickColor(const QPoint &pos); |