<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/108367/">http://git.reviewboard.kde.org/r/108367/</a>
</td>
</tr>
</table>
<br />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">You may want to look this:
https://github.com/fcitx/kcm-fcitx/blob/master/layout/keyboardlayoutwidget.cpp
It's a more featured widget in fcitx (but the code I mentioned is only depends on qt/xkb).
Your implementation is still, hardcode the key position, while this implementation is parsing the xkb model for drawing the keyboard image, one screenshot would explain it:
http://susepaste.org/3952607
I'd admit your key string is much better :) , but feel free to take my code to improve it</pre>
<br />
<p>- Xuetian</p>
<br />
<p>On January 12th, 2013, 5:13 p.m. UTC, Manuel Tortosa wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for kde-workspace.</div>
<div>By Manuel Tortosa.</div>
<p style="color: grey;"><i>Updated Jan. 12, 2013, 5:13 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I am working in a keyboard preview widget, based on kcontrol's one, for the Chakra Project's installer. If you are interested i can create a patch so it may replace the KDE one.
This one is 768x292 (the one in kcontrol is 1300+ wide, not suitable for lower resolutions), and it is almost done (i need to center the Ctrl, Alt and ALtGr texts using QTextMetric or whatever).
If you are interested i can create the patch, the relevant files are kbpreviewframe.cpp+h, the current code (need clean, etc) it is located here:
http://gitorious.org/chakra/tribe/blobs/info/src/widgets/kbpreview/kbpreviewframe.cpp
http://gitorious.org/chakra/tribe/blobs/info/src/widgets/kbpreview/kbpreviewframe.h
The change is kinda big and it is my first attempt to create something with Qt so i prefer to wait some ideas before actually create the relevant patch.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Basically i have tested it in our installer and works.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
</ul>
<p><a href="http://git.reviewboard.kde.org/r/108367/diff/" style="margin-left: 3em;">View Diff</a></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">File Attachments </h1>
<ul>
<li><a href="http://git.reviewboard.kde.org/media/uploaded/files/2013/01/12/before.png">before</a></li>
<li><a href="http://git.reviewboard.kde.org/media/uploaded/files/2013/01/12/after.jpg">after</a></li>
</ul>
</td>
</tr>
</table>
</div>
</body>
</html>