diff options
author | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2011-06-10 17:52:25 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2011-06-23 16:26:11 +0200 |
commit | df1835f06c99d95a6f35ab84abc5fa7950cb5fe7 (patch) | |
tree | a44e6fa70e325185a01e7c913d17332c86e962ef /src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp | |
parent | a1cdeba0e16c487fdc479fcb3b2d0bd5a5493f1a (diff) |
QmlInspector: Some code cleanups
* Inlined empty method implementations
* Removed unused QDeclarativeViewInspectorPrivate::cursosPos
* Small simplification in setting shortcuts
* Prefer const & for QList parameter
Change-Id: I5c2c04f32bb311a835d79a59206d6ebab212c73b
Diffstat (limited to 'src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp')
-rw-r--r-- | src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp index 91dd43bfbe..6085d8131a 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp +++ b/src/plugins/qmltooling/qmldbg_inspector/editor/liveselectiontool.cpp @@ -132,7 +132,7 @@ void LiveSelectionTool::mousePressEvent(QMouseEvent *event) } } -void LiveSelectionTool::createContextMenu(QList<QGraphicsItem*> itemList, QPoint globalPos) +void LiveSelectionTool::createContextMenu(const QList<QGraphicsItem*> &itemList, QPoint globalPos) { QMenu contextMenu; connect(&contextMenu, SIGNAL(hovered(QAction*)), @@ -143,7 +143,6 @@ void LiveSelectionTool::createContextMenu(QList<QGraphicsItem*> itemList, QPoint contextMenu.addAction(tr("Items")); contextMenu.addSeparator(); int shortcutKey = Qt::Key_1; - bool addKeySequence = true; int i = 0; foreach (QGraphicsItem * const item, itemList) { @@ -158,12 +157,11 @@ void LiveSelectionTool::createContextMenu(QList<QGraphicsItem*> itemList, QPoint } elementAction->setData(i); - if (addKeySequence) - elementAction->setShortcut(QKeySequence(shortcutKey)); - shortcutKey++; - if (shortcutKey > Qt::Key_9) - addKeySequence = false; + if (shortcutKey <= Qt::Key_9) { + elementAction->setShortcut(QKeySequence(shortcutKey)); + shortcutKey++; + } ++i; } @@ -305,10 +303,6 @@ void LiveSelectionTool::mouseReleaseEvent(QMouseEvent *event) } } -void LiveSelectionTool::mouseDoubleClickEvent(QMouseEvent * /*event*/) -{ -} - void LiveSelectionTool::keyPressEvent(QKeyEvent *event) { switch (event->key()) { @@ -323,11 +317,6 @@ void LiveSelectionTool::keyPressEvent(QKeyEvent *event) } } -void LiveSelectionTool::keyReleaseEvent(QKeyEvent * /*keyEvent*/) -{ - -} - void LiveSelectionTool::wheelEvent(QWheelEvent *event) { if (event->orientation() == Qt::Horizontal || m_rubberbandSelectionMode) @@ -372,10 +361,6 @@ void LiveSelectionTool::setSelectOnlyContentItems(bool selectOnlyContentItems) m_selectOnlyContentItems = selectOnlyContentItems; } -void LiveSelectionTool::itemsAboutToRemoved(const QList<QGraphicsItem*> &/*itemList*/) -{ -} - void LiveSelectionTool::clear() { view()->setCursor(Qt::ArrowCursor); |