Results 1 to 7 of 7

Thread: entering text through user interaction in QTextEdit

  1. #1
    Join Date
    Dec 2006
    Posts
    123
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Smile 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..............

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    258
    Thanks
    22
    Thanked 19 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default 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

  3. #3
    Join Date
    Dec 2006
    Posts
    123
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default 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....?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: entering text through user interaction in QTextEdit

    Quote Originally Posted by sar_van81 View Post
    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.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: entering text through user interaction in QTextEdit

    Quote Originally Posted by wysota View Post
    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.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: entering text through user interaction in QTextEdit

    Quote Originally Posted by jacek View Post
    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.

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Problem pasting text into a QTextEdit
    By Spockmeat in forum Qt Programming
    Replies: 8
    Last Post: 14th March 2009, 14:36
  3. How to get text of last line only in QTextEdit?
    By rajesh in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2006, 13:37
  4. QTextEdit API questions (plain text)
    By Gaspar in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 06:03
  5. coordinates of selected text in QTextEdit
    By sreedhar in forum Qt Programming
    Replies: 1
    Last Post: 15th May 2006, 17:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.