Op 7-10-2011 12:43, Tommaso Cucinotta schreef:
Il 07/10/2011 09:20, Vincent van Ravesteijn ha scritto:
> FileDialog::Result FileDialog::save(QString const& path,
> - QStringList const& filters, QString const& suggested)
> + QStringList const& filters, QString const& suggested,
> + QString& selectedFilter)
[...]
It's anyway a bit strange to have a pointer to/address of a non-const
reference.
Notice that selectedFilter is an output parameter for save(), that's
why it is non-const.
I have no strong preferences for pointer versus reference.
With the pointer we'd save creation of a useless QString object by
providing 0, so, ok.
It's not about saving anything, it's just about clarity. The Qt function
uses a pointer, so why not using a pointer as well in the save function.
Especially if you have to convert it to a pointer anyway in a later stadium.
Vincent