PDA

View Full Version : Virtual Keyboard



NoRulez
25th February 2009, 11:18
Hey @all,

i search a virtual keyboard for a touchscreen in Qt, currently with a german or english layout.

I have tried to build some with and without Qt Designer and also QSignalMapper but i doesn't work how i want and it looks terrible ugly too.

Can anybody help me? Please post nothing with Qtopia

Regards

LG NoRulez

talk2amulya
25th February 2009, 12:20
u havent mentioned where the output of clicking a keyboard button will go, but assuming its a textedit box, here's how you go about it:

use designer to create the buttons, connect the click to a slot where u set text with the button character. For e.g. if u click button 'a', on the slot, u append character 'a' to the textedit. but i guess u must have already tried that. so where is the click button's output going?

NoRulez
25th February 2009, 13:52
The output is going into a QLineEdit.

My Problem is the design of the buttons, the design locks ugly but maybe you have an example on how to draw/design it, for example the TABS/CAPS key is a bit larger the the "^" key and so.

Regards
NoRulez

talk2amulya
25th February 2009, 14:04
it'd be better to use pixmaps on buttons than to draw every button

http://www.techonthenet.com/clipart/keyboard/index.php

u can find related images on the above link..just arrange them as in keyboard..shouldnt be a problem

NoRulez
25th February 2009, 15:26
I don't draw every button, I only create QPushButton's for each key and place the buttons into a QGridLayout

talk2amulya
25th February 2009, 17:33
yes, u r doing the right thing..now u just have to set pixmap on these buttons..from the images i sent u earlier..

NoRulez
26th February 2009, 08:14
OK, i will try it

Bjoern
26th February 2009, 13:18
I'd suggest that you do not use Pixmaps, even though this saves you time to design a nice look of your widget at the moment.
The problem with pixmaps is that you'll have to provide one for each key, in every language, you can't scale this to nicely fit onto a screen, and such on.

Either use a stylesheet (which is really nice as you can try this is designer / needs no recompile) or subclass QAbstractPushButton and paint the stuff on your own.

And, may I ask which kind of touch device you're using ?
As I'm working with a WACOM tablet using Linux/X11 and there are many issues when using a tablet and Qt ...
You'll probably need to subclass in order to dispatch the tabletEvents() correctly either, as PushButtons are in many ways buggy using a tablet :p

jsmith
11th June 2009, 06:23
hi,
i am doing vitual keyboard in designer. how to implement code for F1, F2, Shift, Ctl, and Delete

advanced thanks

lwinhtooko
5th August 2010, 07:02
Hi,

I am using HTC HD2 PDA Phone to deploy my application. When I select my QLineEdit or QTextEdit, there is no Virtual Keyboard appeared. I also tried Qt examples but got the same result. How can I get the build-in virtual keyboard? Or Need to create own?
I have just tried Qt for Mobile and there are still a lot that I don't understand, yet.

Thanks for your time, :D
Lwin Htoo Ko