mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-10-08 00:00:29 -04:00
As a trial: single-click on a decode to select a new DX Call; double-click to also Enable Tx.
Thanks to W9MDB for this patch, which also removes the option *Double-click on call sets Tx Enable*. Please test and report any perceived issues! git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8462 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
+35
-1
@@ -7,6 +7,7 @@
|
||||
#include <QTextBlock>
|
||||
#include <QMenu>
|
||||
#include <QAction>
|
||||
#include <QTimer>
|
||||
|
||||
#include "qt_helpers.hpp"
|
||||
|
||||
@@ -32,6 +33,8 @@ DisplayText::DisplayText(QWidget *parent)
|
||||
delete menu;
|
||||
});
|
||||
connect (erase_action_, &QAction::triggered, this, &DisplayText::erase);
|
||||
qTimerMouseClick=new QTimer();
|
||||
connect(qTimerMouseClick,SIGNAL(timeout()),this,SLOT(mouseTimeout()));
|
||||
}
|
||||
|
||||
void DisplayText::erase ()
|
||||
@@ -61,9 +64,40 @@ void DisplayText::setContentFont(QFont const& font)
|
||||
ensureCursorVisible ();
|
||||
}
|
||||
|
||||
void DisplayText::mouseTimeout()
|
||||
{
|
||||
qTimerMouseClick->stop();
|
||||
Q_EMIT selectCallsignSingleClick(mouseKeyboardModifiers);
|
||||
}
|
||||
|
||||
void DisplayText::mousePressEvent(QMouseEvent *e)
|
||||
{
|
||||
qTimerMouseClick->stop();
|
||||
mouseStartPos = QCursor::pos();
|
||||
mouseKeyboardModifiers = e->modifiers();
|
||||
selectedLength = textCursor().selectedText().length();
|
||||
QTextEdit::mousePressEvent(e);
|
||||
}
|
||||
|
||||
void DisplayText::mouseReleaseEvent(QMouseEvent *e)
|
||||
{
|
||||
// If our mouse doesn't move then it's the single click event we want
|
||||
QPoint mouseChanged = mouseStartPos-QCursor::pos();
|
||||
if (e->button() == Qt::LeftButton
|
||||
&& mouseKeyboardModifiers == Qt::NoModifier
|
||||
&& selectedLength == 0
|
||||
&& mouseChanged.x() == 0
|
||||
&& mouseChanged.y() == 0)
|
||||
{
|
||||
qTimerMouseClick->start(500);
|
||||
}
|
||||
QTextEdit::mouseReleaseEvent(e);
|
||||
}
|
||||
|
||||
void DisplayText::mouseDoubleClickEvent(QMouseEvent *e)
|
||||
{
|
||||
Q_EMIT selectCallsign(e->modifiers ());
|
||||
qTimerMouseClick->stop();
|
||||
Q_EMIT selectCallsignDoubleClick(e->modifiers ());
|
||||
QTextEdit::mouseDoubleClickEvent(e);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user