Hi, in case anybody else stumbles over this: with a lot of help from Thomas Leitner the problem has been solved.
The problem was that legacy versions of CentOS (4.x and 5.x; and probably other older distributions as well) contain a very subtle syntactic problem that some newer versions of xkbcommon (like the one bundled with Qt) cannot handle. If you have root access on your system: open /usr/share/X11/xkb/rules/base (it may also be located under /usr/lib/X11/xkb or /usr/X11R6/lib/xkb or similar) in an editor. Look for a line like this: btc5113rf btc5126t btc9000 btc9000a btc9001ah btc5090\ ("btc5090" immediately followed by a "\" and newline) insert a space before the backslash: btc5113rf btc5126t btc9000 btc9000a btc9001ah btc5090 \ Problem solved. XKB actually regarded the backslash as part of the keyboard layout name instead of as a line continuation. So it gets confused on the next line and stops parsing the file altogether, hence no keyboard layouts can be found - it doesn't get around to the interesting parts. If your distributor modified the file you may have other lines with backslashes lacking space. If you have trouble locating the problem set the environment variables XKB_LOG_LEVEL=debug and XKB_LOG_VERBOSITY=9 (I'm not sure whether the latter is actually necessary, but it does not hurt) when you start your Qt program it will complain about an unexpected symbol in the line after the problematic backslash. If you do not have root access or there are simply too many systems affected: apply the appended patch - it alters the parser routine to recognize the backslash as something special. cd qtbase/src/3rdparty/xkbcommon/src/xkbcomp/ patch -p0 <xkb_rules.diff Warning: I did not test it for possible other side effects, since I did not have time to fully understand the XKB rules syntax. Konrad On Wednesday 18 September 2013 13:29:29 kon...@silmor.de wrote: > I've got a strange problem here: my Qt program does not accept any > keyboard input at all, no matter how hard I pound on those keys. It works > fine with non-Qt and Qt 4.8. > > I get the following output at program start: > QXcbConnection: Failed to get the primary output of the screen > Error: No components returned from XKB rules > "/usr/share/X11/xkb/rules/xorg" > Error: Couldn't look up rules 'xorg', model 'pc105', layout 'de', > variant '', options '' > Qt: Failed to compile a keymap > > Qt: 5.1.1 (compiled with built-in XCB: -no-opengl -qpa xcb -qt-xcb) > GCC: 4.8.1 (compiled it myself, from vanilla sources) > OS: CentOS release 5.7 (Final) [I know it is horribly old, I have no > control over this and I have no root] > CPU: amd64 > X11: X.org 7.1.1; XMing 6.9.0.31 > > > Konrad > > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest
--- rules.c_bak 2013-10-15 15:29:33.000000000 +0200 +++ rules.c 2013-10-15 15:32:18.000000000 +0200 @@ -265,6 +265,12 @@ #define lit(s, literal) str(s, literal, sizeof(literal) - 1) +static int isgraph2(int c) +{ + if(c=='\\')return 0; + return isgraph(c); +} + static enum rules_token lex(struct scanner *s, union lvalue *val, struct location *loc) { @@ -310,7 +316,7 @@ if (chr(s, '$')) { val->string.start = s->s + s->pos; val->string.len = 0; - while (isgraph(peek(s))) { + while (isgraph2(peek(s))) { next(s); val->string.len++; } @@ -323,10 +329,10 @@ } /* Identifier. */ - if (isgraph(peek(s))) { + if (isgraph2(peek(s))) { val->string.start = s->s + s->pos; val->string.len = 0; - while (isgraph(peek(s))) { + while (isgraph2(peek(s))) { next(s); val->string.len++; }
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest