[Qt-interest] Can you spot my mistake.

Andrew Hodgkinson ahodgkinson at endurancetech.co.uk
Mon Aug 24 10:53:56 CEST 2009


On 24/08/2009 09:24, Thiago Macieira wrote:

> Why do you pass something by reference, instead of by value?
> Because it's going to be changed.

This I know (else, never let me near a computer again!)...

> QApplication and QCoreApplication modify the
> parameter lists to the application, reordering and removing
> elements that they have already parsed.

...this I didn't. I'm using Qt for embedded software and there is no 
command line interface to the applications. They're started and left 
alone. I've never paid any attention to how QApplication uses the 
arguments. Good thing I've only ever instantiated it directly from main() 
or I'm sure I'd have made exactly the same mistake as the OP.

Not sure I like having the parameter list modified but that's just a 
personal preference and I can understand why it's done in this case.

-- 
TTFN, Andrew Hodgkinson
Find some electronic music at:     Photos, wallpaper, software and more:
http://pond.org.uk/music.html                        http://pond.org.uk/



More information about the Qt-interest-old mailing list