Silly newb question, regarding text inputs and the return key
-
So I've got a chat program up and running, with a friends list, individual windows per chat, all i want to do is set up the chat widget to send on enter while entering text in the input, and not add a \n to the text.
This is a pretty simple task but its completely eluded me so far
-
You have 2 choices : subclass from QTextEdit (or other inputwidget) and add your functionality in keyPressEvent() or install eventFilter without subclassing.
"I suggest you to read this :":http://developer.qt.nokia.com/doc/qt-4.7/eventsandfilters.html
There are plenty of examples there.
-
"Here is a good chat network example :":http://developer.qt.nokia.com/doc/qt-4.7/network-network-chat.html#id-5c32885a-244d-40f7-95b1-054e0e80ffb7
There they use signal slots