[Eric] Mac Fonts and Keyboard Shortcuts

Larry Shaffer larrys at dakotacarto.com
Wed Jan 20 10:48:49 GMT 2010


Detlev,

Got it working. Settings now save and reload in their QKeySequence textual
representation without error.

Instead of:
QVariant(QString(act.shortcut()))

I substituted the QKeySequence.toString() method (see attachment):
QVariant(act.shortcut().toString()))

I did the same for alternateShortcut. This produced the correct key sequence
text in eric4.ini. I tested it with Return and Enter and everything works as
expected (saves, and respective keys stay mapped). toString() returns a
QString as well, but maybe does a little something extra that deals with
this issue.

Thanks for the help.

-- 
Larry


> From: detlev <detlev at die-offenbachs.de>
> Date: Tue, 19 Jan 2010 20:35:59 +0100
> To: "eric at riverbankcomputing.com" <eric at riverbankcomputing.com>
> Cc: Larry Shaffer <larrys at dakotacarto.com>
> Subject: Re: [Eric] Mac Fonts and Keyboard Shortcuts
> 
> Hi,
> 
> on my system they are not saved as hexadecimal. Actually the code uses
> "QString(act.alternateShortcut())" where act is a reference to the action and
> this string is encoded as utf-8. So it's
> str(QString(act.alternateShortcut())).encode("utf-8").
> 
> Does your shortcut return something different?
> 
> Detlev
> 
> On Dienstag, 19. Januar 2010, Larry Shaffer wrote:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Shortcuts.py.diff
Type: application/octet-stream
Size: 822 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/eric/attachments/20100120/1fbb2767/attachment.obj>


More information about the Eric mailing list