qt-interest@trolltech.com
[Top] [All Lists]

Re: Setting a qtextedit to use a specific language?

Subject: Re: Setting a qtextedit to use a specific language?
From: Yorgos Pagles
Date: Fri, 21 Oct 2005 09:39:31 +0300
You should search on the web on how to change  keyboard layouts (if
possible) at runtime as I can't help with that. I can only suggest that
you overide the QTextEdit's keyPressEvent for the editor you want to
show arabic text (there are 28 letters is I recall corectly and that
means that you will have to assign tham to the keystrokes). Make a new
class ArabicTextEdit with public inheritance from QTextEdit and
reimplement the keyPressEvent:

void ArabicTextEdit::keyPressEvent(QKeyEvent * e){
switch (e->key()){
   case Qt::Key_A :
       append(tr("a")); //with translator you can set new languages as well
      break;
   }
   // go on with the rest of the keys
}

Haven't tested it I must admit, hope it helps,
Yorgos

Jason Wood wrote:


That's not quite what I need.

A simple example of what I am trying to achieve : I want to be able to
create a dialog with two QTextEdit's. One of them will accept keyboard
input that is always in English. The other QTextEdit I want to accept
keyboard input always in Arabic.

It this possible to set up? I've never needed to do anything like it
before! I'm using QT 3.

Cheers,
Jason


--
To unsubscribe - send "unsubscribe" in the body to 
qt-interest-request@xxxxxxxxxxxxx
List archive and information: http://lists.trolltech.com/qt-interest/





--
Yorgos Pagles
Gaming Applications Software Section
Lottery Systems Department
Digital Media & Internet Technologies
INTRACOM S.A.

A3 Building
19th Km of Markopoulou Ave.
GR19002 Peania, Athens, Greece

[Email]: gpag [at] intracom [dot] gr
[Tel. ]: +30 210 667 1242
[Fax. ]: +30 210 667 7180


--
To unsubscribe - send "unsubscribe" in the body to 
qt-interest-request@xxxxxxxxxxxxx
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>