entering text through user interaction in QTextEdit
hi....
i had to write two application wherein in one application , i'l have pushbutons. and in another application i'l have a textbox.i mapped a letter to each pushbutton.i.e when user clicks a pushbutton, i'l signal a function which prints out the corresponding letter. no my problem is that i need to divert the letters to the textbox in another application...
hope i'm not confusing..
can anyone provide me solutions/suggestions as to how to do this...? i don't want the complete code. i jst want how enter a text in the textbox created using QTextEdit.
thanks in advance...
saravanan..............
Re: entering text through user interaction in QTextEdit
If you have two actually independent Qt-Applications that you want to be able to communicate with each other, you best use the Qt-DBus facilities to achieve this interprocess communication.
http://doc.trolltech.com/4.2/intro-to-dbus.html
The corresponding classes were introduced with Qt-4.2 and are not available in earliere qt-releases. If your application is to be deployed in kde-3*, you can also use KDE's dcop facilities that however will be obsolete in KDE-4 in favour of a crossplattform dbus solution.
If this is too much trouble for you, you can also use a file to write to from one application and read out the content of the file via the other application within given intervals or by using the QFileSystemWatcher class that was also introduced in Qt-4.2. This way, everytime you write something to the file, the other application is notified and can then start reading out the letter,text etc.
Good luck
Re: entering text through user interaction in QTextEdit
hi...
currently we are working with qt-embedded-free-3.3.5. is this possible with this package...? or should i migrate to qt-4.x....?
Re: entering text through user interaction in QTextEdit
Quote:
Originally Posted by
sar_van81
currently we are working with qt-embedded-free-3.3.5. is this possible with this package...? or should i migrate to qt-4.x....?
No, there are other IPC mechanisms you can use. As for the keys themselves, you can try to simulate them by posting QKeyEvents to a widget that currently has the focus.
Re: entering text through user interaction in QTextEdit
I think the problem is that the other widget is in a different application, so I doubt it's possible using Qt events only unless Qt/Embedded has such an ability.
Re: entering text through user interaction in QTextEdit
Quote:
Originally Posted by
wysota
I think the problem is that the other widget is in a different application
Yes and when that other application receives a character through some IPC mechanism, it can post an event to pass it to the right widget.
Re: entering text through user interaction in QTextEdit
Quote:
Originally Posted by
jacek
Yes and when that other application receives a character through some IPC mechanism, it can post an event to pass it to the right widget.
Ah, I see :) I misunderstood you.