Work around a possible Qt bug: str(QString) fails.