Simulating Keypress from Button click
Unsolved
General and Desktop
-
I am using the following code to simulate a keypress from within a button click method :-
QKeyEvent *event = new QKeyEvent(QEvent::KeyPress, key, Qt::NoModifier, txt); QApplication::sendEvent(target, event);
My question is, will this cause memory leaks since I am not deleting the QKeyEvent after use or is this handled automatically by the receiver ?
-
Hi and welcome to devnet,
Yes it will. Take a look at the sendEvent method documentation.
-
You're welcome !
Since that answers your question, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)