Skip to content

Instantly share code, notes, and snippets.

@Katarn
Created January 28, 2014 08:46
Show Gist options
  • Save Katarn/8664185 to your computer and use it in GitHub Desktop.
Save Katarn/8664185 to your computer and use it in GitHub Desktop.
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