From: D. Michael McIntyre <michael.mcintyre@ro...> - 2008-07-28 02:49:02
I'm pretty sure this could be scriptable, but it's beyond my text processing
chops by a long shot (uh, since I don't know Perl for one thing.)
We have 86 of this kind of thing:
QToolTip::add(plugin, i18n("Audio plugin button"));
Breaking it down into its constituent bits, it's:
We need to convert it to:
Thus the sample becomes:
plugin->setToolTip(i18n("Audio plugin button"));
This might be scriptable, but maybe not. Figuring out if the <widget> was
declared... Uh. Dynamically vs. statically I guess? Figuring out whether
it's a local use the . thingie vs. whether it's a pointer use the -> thingie
seems potentially too tricky to make this scriptable, in retrospect, but if
we could even just script it to use -> for all cases, and fix the cases that
went the wrong way by hand (if any of them happen to be the . thingie type,
which is not too likely, actually,) it might still save a substantial amount
of manual drudge work. Only 86 errors to kill with this, but 86 errors that
will be really pissy and tedious to fix by hand.
This whole thing is more than I know where to start on though, and a good
candidate for someone else to get off his/her ass and help me out.
D. Michael McIntyre
From: Chris Cannam <cannam@al...> - 2008-07-28 16:22:26
On Mon, Jul 28, 2008 at 3:48 AM, D. Michael McIntyre
> <tip>::add(<widget>, <text>)
> We need to convert it to:
Always the latter. The first argument of QToolTip::add() in Qt3 is
always a QWidget pointer, never a reference.
Which means that you don't need to do this:
> Figuring out whether
> it's a local use the . thingie vs. whether it's a pointer use the -> thingie
'cos it's always the arrow.
It's possible that the first argument to QToolTip::add() could be an
address-of an automatic variable, e.g.
I'd be a little bit surprised to find we actually do that anywhere...
but if we did, &myButton->setToolTip() wouldn't work, if I remember
this rather obscure bit of binding precedence aright; I guess putting
it in parentheses would: (&myButton)->setToolTip().