@@ -71,6 +71,28 @@ LRESULT inline MouseCatcherThread::MouseCallBackProc(int nCode, WPARAM wParam, L
7171 m_ClickTimer.restart ();
7272
7373
74+ if (isMouseHoldAutoSelectionMode ())
75+ {
76+ QTimer *t = new QTimer ();
77+ t->setSingleShot (true );
78+ t->setInterval (getMouseHoldingDelay ());
79+ t->moveToThread (this );
80+ connect (this , SIGNAL (mouse_up ()), t, SLOT (stop ()));
81+ connect (this , SIGNAL (mouse_up ()), t, SLOT (deleteLater ()));
82+
83+ connect (this , SIGNAL (finished ()), t, SLOT (stop ()));
84+ connect (this , SIGNAL (finished ()), t, SLOT (deleteLater ()));
85+
86+
87+ connect (t, &QTimer::timeout, [this ](){
88+
89+ setSelectionMode (true );
90+ m_iToggled=true ;
91+ });
92+
93+
94+ t->start ();
95+ }
7496 bool needLog = isLoggingStarted ();
7597
7698 if (getDelay ()>=iMSecs)
@@ -104,28 +126,6 @@ LRESULT inline MouseCatcherThread::MouseCallBackProc(int nCode, WPARAM wParam, L
104126 {
105127 m_iToggled=!m_iToggled;
106128 }
107- else if (isMouseHoldAutoSelectionMode ())
108- {
109- QTimer *t = new QTimer ();
110- t->setSingleShot (true );
111- t->setInterval (getMouseHoldingDelay ());
112- t->moveToThread (this );
113- connect (this , SIGNAL (mouse_up ()), t, SLOT (stop ()));
114- connect (this , SIGNAL (mouse_up ()), t, SLOT (deleteLater ()));
115-
116- connect (this , SIGNAL (finished ()), t, SLOT (stop ()));
117- connect (this , SIGNAL (finished ()), t, SLOT (deleteLater ()));
118-
119-
120- connect (t, &QTimer::timeout, [this ](){
121-
122- setSelectionMode (true );
123- m_iToggled=true ;
124- });
125-
126-
127- t->start ();
128- }
129129 }
130130 break ;
131131 }
0 commit comments