qt - Issue with Focusing the Widget in Touch Screen -


i have qwidget contains line edits. have pop new numpad widget when line edit gets the focus. when click on numpad widget, focus has remained in line edit widget. tried using

bool numpadwidget::nativeevent(const qbytearray &eventtype, void *message, long *result) {     #ifdef q_os_win         if(eventtype == "windows_generic_msg")         {             const msg *msg = reinterpret_cast<msg *>(message);             if(msg->message == wm_mouseactivate)             {                 *result = ma_noactivate;                 return true;             }         }     #endif         return false; } 

this working fine mouse clicks of numpad widget, using touch screen. when touch numpad widget, there flickering ( title bar flashing effect) on lineedit widget. can please tell me macro have use block focus of widget on touch screen.

i tried using wm_touch macro results in no proper output. please help…

thanks n1ghtlight reply. tried using wm_gesture message. accepting touch input focus issue (title bar of lineedit widget shows inactive) still exists. here's code.

bool numpadwidget::nativeevent(const qbytearray &eventtype, void *message, long *result) {     #ifdef q_os_win         if(eventtype == "windows_generic_msg")         {             const msg *msg = reinterpret_cast<msg *>(message);             if(msg->message == wm_mouseactivate || msg->message == wm_gesture)             {                 *result = ma_noactivate;                 return true;             }         }     #endif         return false; } 

please suggest me going wrong.

edit:

when try below code, solves issue, not working mouse clicks. but, want widget handle both touch , mouse clicks. can please tell me macro used handle both touch , mouse clicks.

bool numpadwidget::nativeevent(const qbytearray &eventtype, void *message, long *result) {    #ifdef q_os_win      if(eventtype == "windows_generic_msg")      {         const msg *msg = reinterpret_cast<msg *>(message);         if(msg->message == wm_mouseactivate)        {             *result = ma_noactivateandeat;;              return true;        }     }     #endif         return false; } 

from documentation, ma_activate activates window, , not discard mouse message. ma_activateandeat activates window, , discards mouse message. ma_noactivate not activate window, , not discard mouse message. ma_noactivateandeat not activate window, discards mouse message. when tried using ma_noactivate, focus problem (lineedit widget titlebar shows widget inactive) exists.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -