int WDL_VirtualComboBox::OnMouseDown(int xpos, int ypos) { if (m__iaccess) m__iaccess->OnFocused(); if (m_items.GetSize()) { //SendCommand(WM_COMMAND, GetID()|(CBN_DROPDOWN<<16), 0, this); HMENU menu=CreatePopupMenu(); int x=0; GenSubMenu(menu,&x,&m_items,m_curitem); HWND h=GetRealParent(); POINT p={0,}; WDL_VirtualWnd *w=this; while (w) { RECT r; w->GetPosition(&r); p.x+=r.left; p.y+=w==this?r.bottom:r.top; w=w->GetParent(); } if (h) { ClientToScreen(h,&p); //SetFocus(h); } int ret=TrackPopupMenu(menu,TPM_LEFTALIGN|TPM_TOPALIGN|TPM_RETURNCMD|TPM_NONOTIFY,p.x,p.y,0,h,NULL); if (ret>=1000) { m_curitem=ret-1000; RequestRedraw(NULL); // track menu WDL_VWND_DCHK(a); SendCommand(WM_COMMAND,GetID() | (CBN_SELCHANGE<<16),0,this); if (a.isOK() && m__iaccess) m__iaccess->OnStateChange(); } } return -1; }
void WDL_VirtualSlider::OnMoveOrUp(int xpos, int ypos, int isup) { int pos; bool isVert = GetIsVert(); int rsize=m_maxr-m_minr; if (rsize<1)rsize=1; int viewh=m_position.bottom-m_position.top; int vieww=m_position.right-m_position.left; LICE_IBitmap *bm_image=m_skininfo ? m_skininfo->thumbimage[isVert] : 0; int bm_w=16,bm_h=16; if (bm_image) { bm_w=bm_image->getWidth(); bm_h=bm_image->getHeight(); AdjustThumbImageSize(vieww,viewh,m_skininfo,isVert,&bm_w,&bm_h); } else { bm_image=WDL_STYLE_GetSliderBitmap2(isVert); if (bm_image) { bm_w=bm_image->getWidth(); bm_h=bm_image->getHeight(); } AdjustThumbImageSize(vieww,viewh,NULL,isVert,&bm_w,&bm_h); } int precmode=0; if (m_is_knob) isVert=true; if (isVert) { #ifndef _WIN32 if (isup) pos=m_pos; else #endif if (viewh <= bm_h || m_is_knob || (GetAsyncKeyState(VK_CONTROL)&0x8000)) { int sc=m_is_knob && !(GetAsyncKeyState(VK_CONTROL)&0x8000)?4:1; pos = m_pos- ((ypos-m_last_y) - (m_is_knob ?xpos-m_last_x:0))*sc; precmode=1; } else { pos=m_minr+ (((double)(viewh-bm_h - ypos + m_move_offset)*(double)rsize)/(double)(viewh-bm_h)); } if (pos < m_minr)pos=m_minr; else if (pos > m_maxr)pos=m_maxr; if (pos != m_pos || isup) { if (ypos == m_last_y&&(m_is_knob && xpos==m_last_x)) pos=m_pos; if ((GetAsyncKeyState(VK_MENU)&0x8000) && isup) pos=m_click_pos; m_pos=pos; if (isup || ypos != m_last_y||(m_is_knob&&xpos!=m_last_x)) { WDL_VWND_DCHK(chk); SendCommand(m_scrollmsg?m_scrollmsg:WM_VSCROLL,isup?SB_ENDSCROLL:SB_THUMBTRACK,GetID(),this); if (chk.isOK()) { RequestRedraw(NULL); if (m__iaccess) m__iaccess->OnStateChange(); } } } } else { #ifndef _WIN32 if (isup) pos=m_pos; else #endif if ((GetAsyncKeyState(VK_CONTROL)&0x8000) || vieww <= bm_w || m_is_knob) { pos = m_pos+ (xpos-m_last_x); precmode=1; } else { pos=m_minr + (((double)(xpos - m_move_offset)*(double)rsize)/(double)(vieww-bm_w)); } if (pos < m_minr)pos=m_minr; else if (pos > m_maxr)pos=m_maxr; if (pos != m_pos || isup) { if (xpos == m_last_x) pos=m_pos; if ((GetAsyncKeyState(VK_MENU)&0x8000) && isup) pos=m_click_pos; m_pos=pos; if (isup || xpos != m_last_x) { WDL_VWND_DCHK(chk); SendCommand(m_scrollmsg?m_scrollmsg:WM_HSCROLL,isup?SB_ENDSCROLL:SB_THUMBTRACK,GetID(),this); if (chk.isOK()) { RequestRedraw(NULL); if (m__iaccess) m__iaccess->OnStateChange(); } } } } if (precmode&&GetRealParent()) { if (xpos != m_last_x || ypos != m_last_y) { POINT p; GetCursorPos(&p); p.x-=(xpos-m_last_x); #ifdef _WIN32 p.y-=(ypos-m_last_y); #else p.y+=(ypos-m_last_y); #endif #ifdef _WIN32 if (!m_is_knob) { POINT pt={0,0}; ClientToScreen(GetRealParent(),&pt); WDL_VWnd *wnd=this; while (wnd) { RECT r; wnd->GetPosition(&r); pt.x+=r.left; pt.y+=r.top; wnd=wnd->GetParent(); } if (isVert) { m_last_y=( viewh - bm_h - (((m_pos-m_minr) * (viewh-bm_h))/rsize))+m_move_offset; p.y=m_last_y+pt.y; } else { m_last_x=( (((m_pos-m_minr) * (vieww-bm_w))/rsize))+m_move_offset; p.x=m_last_x+pt.x; } } #endif if (!SetCursorPos(p.x,p.y)) { m_last_y = ypos; m_last_x = xpos; } } do m_last_precmode++; while (ShowCursor(FALSE)>=0); } else { m_last_y=ypos; m_last_x=xpos; while (m_last_precmode>0) {m_last_precmode--; ShowCursor(TRUE); } } m_needflush=0; }
void QTVS_Leap::FingerLogic(handIndex hIndex) { if (ui.checkBox_gesturesParangus->isChecked()) ParangusGestureLogic(); if (ui.checkBox_gesturesLeap->isChecked()) LeapGestureLogic(); //DEBUG: Atm we cancel // return; // 0 -> 4 = left hand // 5 -> 9 = right hand // So lets use a shift and no redundant code int iHandToFingerShift = 0; if (hIndex == handRight) iHandToFingerShift += 5; for (FingerList::const_iterator fl = fingers.begin(); fl != fingers.end(); ++fl) { const Finger finger = *fl; // std::cout << std::string(4, ' ') << fingerNames[finger.type()] // << " finger, id: " << finger.id() // << ", length: " << finger.length() // << "mm, width: " << finger.width() << std::endl; Leap::Vector position = finger.stabilizedTipPosition(); // Convert Leap::Vector position to Screen Coords QPoint screenPosition = FingerCursorPosition(position); // Lerp coords for smoothness if required int xCoord = lerp(fingerTraces.at(finger.type() + iHandToFingerShift)->geometry().left(), screenPosition.x(), dMouseLerpValue); int yCoord = lerp(fingerTraces.at(finger.type() + iHandToFingerShift)->geometry().top(), screenPosition.y(), dMouseLerpValue); // Qt Doesn't allow different threads to overwride gui locations. // Therefore, the usage of events are well, used. // This updates visual finger representation to correct location QMoveEvent *tEvent = new QMoveEvent(QPoint(xCoord, yCoord), fingerTraces.at(finger.type() + iHandToFingerShift)->pos()); QCoreApplication::postEvent(fingerTraces.at(finger.type() + iHandToFingerShift), tEvent); // Z axis does NOT use stabilized position. // Stabilized position is generally used for X/Y movement (2D display) // Therefore Z is updated quite poorely. So we used unStabalized position instead // Setup position limits (manual testing for values position = finger.tipPosition(); float zFinger = position.z < 0 ? 0 : position.z > 200 ? 200 : position.z; // Convert to percentages // trim lowerend of percentages zFinger /= 200; if (zFinger < 0.1) zFinger = 0.1; if (hIndex == handLeft) { if(ui.checkBox_FingerDragsWindows->isChecked()) { // We're on index finger and its close to screen / center of Z-plane on leap motion if (finger.type() == leapIndex && zFinger < 0.12) { POINT pt; pt.x = screenPosition.x(); pt.y = screenPosition.y(); // if our rect was reset // Therefore, we just started to drag if (debugWindowDrag_Left.left == -1) { // Find window under point // Find window's dimmensions // Find difference between player's finger coords and window's coords debugWindowHWND_Left = GetRealParent(WindowFromPoint(pt)); // Set it as active window if need be. if(debugWindowHWND_Left != GetForegroundWindow() && ui.checkBox_DragSetsActive->isChecked()) { SetForegroundWindow(debugWindowHWND_Left); // Backup incase SetForegroundWindow fails // TODO: Perhaps replace in future? since foreground window DOES faile occasionally. // SetWindowPos(debugWindowHWND_Left,HWND_TOPMOST,0,0,0,0, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE); } // Restore window if maximized Section WINDOWPLACEMENT wndpl = { sizeof(WINDOWPLACEMENT) }; GetWindowPlacement(debugWindowHWND_Left, &wndpl); // Determine if window is maximized to begin with if (wndpl.showCmd == SW_MAXIMIZE) { // Setup the restore command and send it wndpl.showCmd = SW_RESTORE; SetWindowPlacement(debugWindowHWND_Left, &wndpl); // Center restored window around player's fingers int iTempWindowWidth = wndpl.rcNormalPosition.right - wndpl.rcNormalPosition.left; int iTempWindowHeight = wndpl.rcNormalPosition.bottom - wndpl.rcNormalPosition.top; MoveWindow(debugWindowHWND_Left, pt.x - iTempWindowWidth / 2, pt.y - iTempWindowHeight / 2, iTempWindowWidth, iTempWindowHeight, true); } GetWindowRect(debugWindowHWND_Left, &debugWindowDrag_Left); debugWindowDrag_Left.left = pt.x - debugWindowDrag_Left.left; debugWindowDrag_Left.top = pt.y - debugWindowDrag_Left.top; debugWindowDrag_Left.bottom = pt.y;//debugWindowDrag_Left.bottom - pt.y; debugWindowDrag_Left.right = pt.x;//debugWindowDrag_Left.bottom - pt.y; } // Setup temp rect for window's width/height RECT tRect; GetWindowRect(debugWindowHWND_Left, &tRect); debugDisplayString = QString::number(pt.y); // If left hand and right hand have different HWNDs on drag // Proceed with normal drag if (debugWindowHWND_Left != debugWindowHWND_Right) { WINDOWPLACEMENT wndpl = { sizeof(WINDOWPLACEMENT) }; GetWindowPlacement(debugWindowHWND_Left, &wndpl); // AeroSnap time // Maximize window on top if (pt.y <= 30 && wndpl.showCmd != SW_MAXIMIZE) { iDebugWindowRestore_LeftHand = 1; iDebug_PreviousWindowWidth_LeftHand = tRect.right - tRect.left; iDebug_PreviousWindowHeight_LeftHand = tRect.bottom - tRect.top; wndpl.showCmd = SW_SHOWMAXIMIZED; SetWindowPlacement(debugWindowHWND_Left, &wndpl); } // AeroSnap Left else if (pt.x <= 30) { if (iDebugWindowRestore_LeftHand == 0) { iDebugWindowRestore_LeftHand = 1; iDebug_PreviousWindowWidth_LeftHand = tRect.right - tRect.left; iDebug_PreviousWindowHeight_LeftHand = tRect.bottom - tRect.top; int wndwidth = (rcMonitor.right - rcMonitor.left) / 2; int wndheight = rcMonitor.bottom - rcMonitor.top;//max(min((rcMonitor.bottom-rcMonitor.top), state.mmi.ptMaxTrackSize.y), state.mmi.ptMinTrackSize.y); int posx = rcMonitor.left; int posy = rcMonitor.top + (rcMonitor.bottom - rcMonitor.top) / 2 - wndheight / 2; // Center vertically (if window has a max height) MoveWindow(debugWindowHWND_Left, posx, posy, wndwidth, wndheight, true); } } // AeroSnap Left else if (pt.x >= (rcMonitor.right - rcMonitor.left) - 30) { if (iDebugWindowRestore_LeftHand == 0) { iDebugWindowRestore_LeftHand = 1; iDebug_PreviousWindowWidth_LeftHand = tRect.right - tRect.left; iDebug_PreviousWindowHeight_LeftHand = tRect.bottom - tRect.top; int wndwidth = (rcMonitor.right - rcMonitor.left) / 2; int wndheight = rcMonitor.bottom - rcMonitor.top;//max(min((rcMonitor.bottom-rcMonitor.top), state.mmi.ptMaxTrackSize.y), state.mmi.ptMinTrackSize.y); int posx = rcMonitor.right - wndwidth; int posy = rcMonitor.top + (rcMonitor.bottom - rcMonitor.top) / 2 - wndheight / 2; // Center vertically (if window has a max height) MoveWindow(debugWindowHWND_Left, posx, posy, wndwidth, wndheight, true); } } // Normal Drag else if ( pt.y > 30 && pt.x > 30 && (pt.x < (rcMonitor.right - rcMonitor.left) - 30 )) { // some other custom snap is in effect if (iDebugWindowRestore_LeftHand == 1) { iDebugWindowRestore_LeftHand = 0; if (wndpl.showCmd == SW_MAXIMIZE) { // Setup the restore command and send it wndpl.showCmd = SW_RESTORE; SetWindowPlacement(debugWindowHWND_Left, &wndpl); } MoveWindow(debugWindowHWND_Left, pt.x - iDebug_PreviousWindowWidth_LeftHand / 2, pt.y - iDebug_PreviousWindowHeight_LeftHand / 2, iDebug_PreviousWindowWidth_LeftHand, iDebug_PreviousWindowHeight_LeftHand, true); } // Nope, just normal drag else if (wndpl.showCmd != SW_MAXIMIZE) MoveWindow(debugWindowHWND_Left, pt.x - debugWindowDrag_Left.left, pt.y - debugWindowDrag_Left.top, tRect.right - tRect.left, tRect.bottom - tRect.top, true); } } // Left and Right hand have same HWNDs // Resize mode engadged else if(ui.checkBox_ResizeWindows->isChecked()) { // Left hand's overview: // Horizontal movement = simultaneious change in window's coords + change in width. // Vertical movement = change in window's height only. // Left reference points: // X = hwnd.left // Y = hwnd.bottom RECT resizeRect; resizeRect.top = tRect.top; resizeRect.left = tRect.left + (pt.x - debugWindowDrag_Left.right);// / 5; resizeRect.right = (tRect.right - resizeRect.left);// - (pt.x - debugWindowDrag_Left.left) ;/// 5; resizeRect.bottom = (tRect.bottom - tRect.top) + (pt.y - debugWindowDrag_Left.bottom);// / 5; debugWindowDrag_Left.right = pt.x; debugWindowDrag_Left.bottom = pt.y; MoveWindow(debugWindowHWND_Left, resizeRect.left, resizeRect.top, resizeRect.right , resizeRect.bottom, true); } } else if (finger.type() == leapIndex && zFinger > 0.15) { debugWindowDrag_Left.left = -1; debugWindowHWND_Left = NULL; } } } if (hIndex == handRight) { if(ui.checkBox_FingerDragsWindows->isChecked()) { if (finger.type() == leapIndex && zFinger < 0.12) { // debugDisplayString = "TRYIGN"; POINT pt; pt.x = screenPosition.x() - 15; pt.y = screenPosition.y() - 15; if (debugWindowDrag_Right.left == -1) { debugWindowHWND_Right = GetRealParent(WindowFromPoint(pt)); if(debugWindowHWND_Right != GetForegroundWindow() && ui.checkBox_DragSetsActive->isChecked()) { SetForegroundWindow(debugWindowHWND_Right); // Backup incase SetForegroundWindow fails // TODO: Perhaps replace in future? since foreground window DOES faile occasionally. // SetWindowPos(debugWindowHWND_Left,HWND_TOPMOST,0,0,0,0, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE); } GetWindowRect(debugWindowHWND_Right, &debugWindowDrag_Right); debugWindowDrag_Right.left = pt.x - debugWindowDrag_Right.left; debugWindowDrag_Right.top = pt.y - debugWindowDrag_Right.top; debugWindowDrag_Right.bottom = pt.y;//debugWindowDrag_Left.bottom - pt.y; debugWindowDrag_Right.right = pt.x;//debugWindowDrag_Left.bottom - pt.y; } RECT tRect; GetWindowRect(debugWindowHWND_Right, &tRect); if (debugWindowHWND_Left != debugWindowHWND_Right) { WINDOWPLACEMENT wndpl = { sizeof(WINDOWPLACEMENT) }; GetWindowPlacement(debugWindowHWND_Right, &wndpl); // AeroSnap time // Maximize window on top if (pt.y <= 30 && wndpl.showCmd != SW_MAXIMIZE) { iDebugWindowRestore_RightHand = 1; iDebug_PreviousWindowWidth_RightHand = tRect.right - tRect.left; iDebug_PreviousWindowHeight_RightHand = tRect.bottom - tRect.top; wndpl.showCmd = SW_SHOWMAXIMIZED; SetWindowPlacement(debugWindowHWND_Right, &wndpl); } // AeroSnap Left else if (pt.x <= 30) { if (iDebugWindowRestore_RightHand == 0) { iDebugWindowRestore_RightHand = 1; iDebug_PreviousWindowWidth_RightHand = tRect.right - tRect.left; iDebug_PreviousWindowHeight_RightHand = tRect.bottom - tRect.top; int wndwidth = (rcMonitor.right - rcMonitor.left) / 2; int wndheight = rcMonitor.bottom - rcMonitor.top;//max(min((rcMonitor.bottom-rcMonitor.top), state.mmi.ptMaxTrackSize.y), state.mmi.ptMinTrackSize.y); int posx = rcMonitor.left; int posy = rcMonitor.top + (rcMonitor.bottom - rcMonitor.top) / 2 - wndheight / 2; // Center vertically (if window has a max height) MoveWindow(debugWindowHWND_Right, posx, posy, wndwidth, wndheight, true); } } // AeroSnap Left else if (pt.x >= (rcMonitor.right - rcMonitor.left) - 30) { if (iDebugWindowRestore_RightHand == 0) { iDebugWindowRestore_RightHand = 1; iDebug_PreviousWindowWidth_RightHand = tRect.right - tRect.left; iDebug_PreviousWindowHeight_RightHand = tRect.bottom - tRect.top; int wndwidth = (rcMonitor.right - rcMonitor.left) / 2; int wndheight = rcMonitor.bottom - rcMonitor.top;//max(min((rcMonitor.bottom-rcMonitor.top), state.mmi.ptMaxTrackSize.y), state.mmi.ptMinTrackSize.y); int posx = rcMonitor.right - wndwidth; int posy = rcMonitor.top + (rcMonitor.bottom - rcMonitor.top) / 2 - wndheight / 2; // Center vertically (if window has a max height) MoveWindow(debugWindowHWND_Right, posx, posy, wndwidth, wndheight, true); } } // Normal Drag else if ( pt.y > 30 && pt.x > 30 && (pt.x < (rcMonitor.right - rcMonitor.left) - 30 )) { // some other custom snap is in effect if (iDebugWindowRestore_RightHand == 1) { iDebugWindowRestore_RightHand = 0; if (wndpl.showCmd == SW_MAXIMIZE) { // Setup the restore command and send it wndpl.showCmd = SW_RESTORE; SetWindowPlacement(debugWindowHWND_Right, &wndpl); } MoveWindow(debugWindowHWND_Right, pt.x - iDebug_PreviousWindowWidth_RightHand / 2, pt.y - iDebug_PreviousWindowHeight_RightHand / 2, iDebug_PreviousWindowWidth_RightHand, iDebug_PreviousWindowHeight_RightHand, true); } // Nope, just normal drag else if (wndpl.showCmd != SW_MAXIMIZE) MoveWindow(debugWindowHWND_Right, pt.x - debugWindowDrag_Right.left, pt.y - debugWindowDrag_Right.top, tRect.right - tRect.left, tRect.bottom - tRect.top, true); } } else if (ui.checkBox_ResizeWindows->isChecked()){ // Right hand's overview: // Horizontal movement = change in width. // Vertical movement = simultaneious change in window's coords + change in window's height only. // debug_iReferencePointX_Right = tRect.left + debugWindowDrag_Right.left;// + debug_iReferencePointY_Left; // debug_iReferencePointY_Right = tRect.top + debugWindowDrag_Right.top;// + debug_iReferencePointY_Left; // RECT resizeRect; // resizeRect.top = tRect.top; // resizeRect.left = tRect.left + (pt.x - debugWindowDrag_Left.right);// / 5; // resizeRect.right = (tRect.right - resizeRect.left);// - (pt.x - debugWindowDrag_Left.left) ;/// 5; // resizeRect.bottom = (tRect.bottom - tRect.top) + (pt.y - debugWindowDrag_Left.bottom);// / 5; // debugWindowDrag_Left.right = pt.x; // debugWindowDrag_Left.bottom = pt.y; RECT resizeRect; resizeRect.top = tRect.top + (pt.y - debugWindowDrag_Right.bottom); resizeRect.left = tRect.left; resizeRect.right = (tRect.right - tRect.left) + (pt.x - debugWindowDrag_Right.right); resizeRect.bottom = (tRect.bottom - resizeRect.top);// - (pt.y - debug_iReferencePointY_Right) / 5; // debugWindowDrag_Right.left += (pt.x - debug_iReferencePointX_Right) / 5; // debugWindowDrag_Right.top += (pt.y - debug_iReferencePointY_Right) / 5; debugWindowDrag_Right.right = pt.x; debugWindowDrag_Right.bottom = pt.y; MoveWindow(debugWindowHWND_Right, resizeRect.left, resizeRect.top, resizeRect.right , resizeRect.bottom, false); } // debugDisplayString = QString::number(finger.tipPosition().z); } else if (finger.type() == leapIndex && zFinger > 0.15) { debugWindowDrag_Right.left = -1; debugWindowHWND_Right = NULL; } } } zFinger *= 75.0; QResizeEvent *rEvent = new QResizeEvent(QSize(zFinger, zFinger), fingerTraces.at(finger.type() + iHandToFingerShift)->size()); QCoreApplication::postEvent(fingerTraces.at(finger.type() + iHandToFingerShift), rEvent); // switch (finger.type()) // { // case leapThumb: // { // // if(finger.isExtended()) // // { // // QShowEvent * sEvent = new QShowEvent(); // // QCoreApplication::postEvent(thumbTrace, sEvent); // int xCoord = lerp(thumbTrace->geometry().left(), screenPosition.x(), dMouseLerpValue); // int yCoord = lerp(thumbTrace->geometry().top(), screenPosition.y(), dMouseLerpValue); // QMoveEvent *tEvent = new QMoveEvent(QPoint(xCoord, yCoord), thumbTrace->pos()); // QCoreApplication::postEvent(thumbTrace, tEvent); // // } // // else // // { // // QHideEvent * hEvent = new QHideEvent(); // // QCoreApplication::postEvent(thumbTrace, hEvent); // // } // // thumbTrace->move(xCoord, yCoord); // } // // indexTrace; // // middleTrace; // // ringTrace; // // pinkieTrace; // break; // case leapIndex: // { // int xCoord = lerp(indexTrace->geometry().left(), screenPosition.x(), dMouseLerpValue); // int yCoord = lerp(indexTrace->geometry().top(), screenPosition.y(), dMouseLerpValue); // QMoveEvent *tEvent = new QMoveEvent(QPoint(xCoord, yCoord), indexTrace->pos()); // QCoreApplication::postEvent(indexTrace, tEvent); // // thumbTrace->move(xCoord, yCoord); // } // break; // case leapMiddle: // { // int xCoord = lerp(middleTrace->geometry().left(), screenPosition.x(), dMouseLerpValue); // int yCoord = lerp(middleTrace->geometry().top(), screenPosition.y(), dMouseLerpValue); // QMoveEvent *tEvent = new QMoveEvent(QPoint(xCoord, yCoord), middleTrace->pos()); // QCoreApplication::postEvent(middleTrace, tEvent); // // thumbTrace->move(xCoord, yCoord); // } // break; // case leapRing: // { // int xCoord = lerp(ringTrace->geometry().left(), screenPosition.x(), dMouseLerpValue); // int yCoord = lerp(ringTrace->geometry().top(), screenPosition.y(), dMouseLerpValue); // QMoveEvent *tEvent = new QMoveEvent(QPoint(xCoord, yCoord), ringTrace->pos()); // QCoreApplication::postEvent(ringTrace, tEvent); // // thumbTrace->move(xCoord, yCoord); // } // break; // case leapPinkie: // { // int xCoord = lerp(pinkieTrace->geometry().left(), screenPosition.x(), dMouseLerpValue); // int yCoord = lerp(pinkieTrace->geometry().top(), screenPosition.y(), dMouseLerpValue); // QMoveEvent *tEvent = new QMoveEvent(QPoint(xCoord, yCoord), pinkieTrace->pos()); // QCoreApplication::postEvent(pinkieTrace, tEvent); // // thumbTrace->move(xCoord, yCoord); // } // break; // } } }