void DDSWidget::customEvent(QEvent *e) { QMessageBox msg; if(e->type() == ((QEvent::Type)7892)) { qDebug()<<"Event Raised"; } QEvent(e->type()); }
void QAcceptSocketsThread :: SignalOwner() { #if QT_VERSION >= 0x040000 QEvent * evt = newnothrow QEvent((QEvent::Type)QMTT_SIGNAL_EVENT); #else QCustomEvent * evt = newnothrow QCustomEvent(QMTT_SIGNAL_EVENT); #endif if (evt) QCoreApplication::postEvent(this, evt); else WARN_OUT_OF_MEMORY; }
void ShortLocater::customEvent(QEvent *e){ qDebug()<<"SL Custom Event"; if(e->type() == ((QEvent::Type)1234)){ qDebug()<<"Embedded Probe"; ProbeFunction(); } if(e->type() == ((QEvent::Type)5678)){ qDebug()<<"PT Keypad:-"<<m_nPTKeyCode; KeyFunction(); } else qDebug()<<"Unknown Event"; QEvent(e->type()); }
void PTPSoCTestJigInterface2::customEvent(QEvent *eve) { unsigned int l_nRegisterValue; unsigned int reads; if (eve->type() == GpioEvent) { l_nRegisterValue = IBackPlane->readBackPlaneRegister(0x001E); IBackPlane->writeBackPlaneRegister(0x0900, 0x001E); qDebug() << "data read at 1E is" << hex << l_nRegisterValue; IPsoc->writeSerial(0x01); usleep(1000); reads = IPsoc->readSerial(); convertToBits((unsigned char) reads, 5); qDebug() << "Inside GPIO EMBEDDED PROBE" << hex << m_nGPIOCode; IBackPlane->writeBackPlaneRegister(0x0001, 0x0024); } QEvent(eve->type()); }
LONG NT_handleMsg( HWND hWnd, /* window handle */ UINT message, /* type of message */ UINT wParam, /* additional information */ LONG lParam) /* additional information */ { RECT rect; WINDOWPOS *posStruct; unsigned long int st=0L; NT_window *window; long mask; PAINTSTRUCT paintStruct; /* if (message == WM_CLOSE) exit(0); */ window = NT_find_window_from_id(hWnd); if (window == NULL) return (NT_default(hWnd, message, wParam, lParam)); mask = window->mask; switch (message) { /* we'll handle these, later */ case WM_KILLFOCUS: QEvent(wineventq,window,message,wParam,lParam); NT_wakeup(hWnd); break; case WM_SETFOCUS: case WM_QUIT: case WM_CLOSE: case WM_DESTROY: case WM_LBUTTONDBLCLK: case WM_MBUTTONDBLCLK: case WM_RBUTTONDBLCLK: case USR_MapNotify: case USR_EnterNotify: case WM_MOVE: #if defined(WIN9X) case WM_SIZING: #endif case WM_SIZE: QEvent(wineventq,window,message,wParam,lParam); break; case WM_CHAR: case WM_SYSKEYDOWN: /* some alt-keys go here */ QEvent(wineventq,window,message,wParam,lParam); break; case WM_SYSCHAR: /* other alt-keys go here */ switch (wParam) { case VK_SPACE: /* ensure Alt-Space is passed to OS */ if ((GetKeyState(VK_MENU) & 0x8000) && (!unix_alt_space)) { return (NT_default(hWnd, message, wParam, lParam)); } else { QEvent(wineventq,window,message,wParam,lParam); return 0L; } break; default: QEvent(wineventq,window,message,wParam,lParam); break; } break; case WM_DESTROYCLIPBOARD: if (destroyClipboardCatcher) destroyClipboardCatcher=0; else { QEvent(wineventq,window,message,wParam,lParam); NT_wakeup(hWnd); } break; case WM_PAINT: BeginPaint(hWnd,&paintStruct); FillRect(paintStruct.hdc, &paintStruct.rcPaint,window->bg); QEvent(wineventq,window,message, (((paintStruct.rcPaint.right-paintStruct.rcPaint.left)&0xffff) | (((paintStruct.rcPaint.bottom-paintStruct.rcPaint.top)&0xffff)<<16)), (((paintStruct.rcPaint.left)&0xffff) | (((paintStruct.rcPaint.top)&0xffff)<<16))); EndPaint(hWnd,&paintStruct); break; /* capture the mouse on button down to emulate x */ case WM_LBUTTONDOWN: case WM_MBUTTONDOWN: case WM_RBUTTONDOWN: SetCapture(hWnd); QEvent(wineventq,window,message,wParam,lParam); break; case WM_MBUTTONUP: case WM_LBUTTONUP: case WM_RBUTTONUP: ReleaseCapture(); QEvent(wineventq,window,message,wParam,lParam); break; case WM_MOUSEMOVE: if ((mask&PointerMotionMask) || ((mask&Button1MotionMask)&& (wParam&MK_LBUTTON)) || ((mask&Button2MotionMask)&& (wParam&MK_MBUTTON)) || ((mask&Button3MotionMask)&& (wParam&MK_RBUTTON)) || ((mask&ButtonMotionMask)&&((wParam&(MK_LBUTTON|MK_MBUTTON|MK_RBUTTON)))) ) QEvent(wineventq,window,message,wParam,lParam); else return (NT_default(hWnd, message, wParam, lParam)); break; case WM_MOUSEWHEEL: /* this event only seems to go to the top most window. see if child windows accept it. */ window = NT_find_child(window,ButtonPressMask|Button2MotionMask|Button3MotionMask, ButtonPressMask|Button3MotionMask ); if (window && ((window->mask)&ButtonPressMask)) QEvent(wineventq,window,message,wParam,lParam); else return (NT_default(hWnd, message, wParam, lParam)); break; case WM_ERASEBKGND: /* don't erase the background */ return 1; break; case WM_SYSCOMMAND: wineventq->dispatch++; NT_default(hWnd, message, wParam, lParam); wineventq->dispatch--; break; case WM_KEYDOWN: switch (wParam) { case VK_CANCEL: case VK_CLEAR: case VK_PAUSE: case VK_PRIOR: case VK_NEXT: case VK_END: case VK_HOME: case VK_LEFT: case VK_UP: case VK_RIGHT: case VK_DOWN: case VK_SELECT: case VK_PRINT: case VK_EXECUTE: case VK_INSERT: case VK_DELETE: case VK_HELP: case VK_NUMLOCK: case VK_SCROLL: case VK_BACK: case VK_F1: case VK_F2: case VK_F3: case VK_F4: case VK_F5: case VK_F6: case VK_F7: case VK_F8: case VK_F9: case VK_F10: case VK_F11: case VK_F12: QEvent(wineventq,window,message,wParam,lParam); break; case VK_ADD: case VK_SUBTRACT: if (GetKeyState(VK_SHIFT) & 0x8000) { QEvent(wineventq,window,message,wParam,lParam); return 0L; } else { return (NT_default(hWnd, message, wParam, lParam)); } break; default: return (NT_default(hWnd, message, wParam, lParam)); break; } break; default: /* Passes it on if unproccessed */ return (NT_default(hWnd, message, wParam, lParam)); } return 0L; }