Created
January 28, 2014 08:46
-
-
Save Katarn/8664185 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/ui/AddressWidget.cpp b/src/ui/AddressWidget.cpp | |
index e2ddb6d..ee6549f 100644 | |
--- a/src/ui/AddressWidget.cpp | |
+++ b/src/ui/AddressWidget.cpp | |
@@ -142,6 +142,20 @@ void AddressWidget::mouseReleaseEvent(QMouseEvent *event) | |
} | |
} | |
+void AddressWidget::mouseDoubleClickEvent(QMouseEvent *event) | |
+{ | |
+ if (event->button() == Qt::LeftButton) | |
+ { | |
+ selectAll(); | |
+ | |
+ event->accept(); | |
+ } | |
+ else | |
+ { | |
+ QLineEdit::mouseDoubleClickEvent(event); | |
+ } | |
+} | |
+ | |
void AddressWidget::removeIcon() | |
{ | |
QAction *action = qobject_cast<QAction*>(sender()); | |
diff --git a/src/ui/AddressWidget.h b/src/ui/AddressWidget.h | |
index 10cd242..5fc7b94 100644 | |
--- a/src/ui/AddressWidget.h | |
+++ b/src/ui/AddressWidget.h | |
@@ -49,6 +49,7 @@ protected: | |
void resizeEvent(QResizeEvent *event); | |
void mouseMoveEvent(QMouseEvent *event); | |
void mouseReleaseEvent(QMouseEvent *event); | |
+ void mouseDoubleClickEvent(QMouseEvent *event); | |
protected slots: | |
void removeIcon(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment