On Saturday 14 August 2004 14:50,
[EMAIL PROTECTED] wrote:
> Quoting stephan beal <[EMAIL PROTECTED]>:
> > QString::replace("_","\\_") should do the trick, and would be
> > trivial to add to the slot which handles the OK button (though i
> > don't know if that slot has access to the string itself).
>
> Except that this doesn't work in the case where the user added the
> backslash already himself.
Agreed, but this would be trivial to catch with a regex. In fact, a
single regex could escape all non-escaped underscores. i don't think
the fact that uscores are special is a problem here: does anyone put
math codes in their index entries?
> > For non-Qt interfaces, std::string's replace() could be used,
> > though it requires more work than Qt::String. (But i have no idea
> > if lyx uses the STL.)
>
> Sure it does.
Oh, good. i thought perhaps it was restricted to (char *).
> I'd think QValidator is the way to go for the Qt interface.
That does indeed sound like a reasonable approach.
--
----- [EMAIL PROTECTED] http://s11n.net
"...pleasure is a grace and is not obedient to the commands
of the will." -- Alan W. Watts