Page 1 of 1

QList<QString> bug

Posted: Sun Sep 26 2021 6:07 pm
by seasoned_geek
I had a method that was to build a QList<QString> as its return value.

It was just doing a selection from an SQLite table and returning a list of file paths for recent files. Returning an empty list would be perfectly valid because on a first run or history clear there would be no recent files.

Trying to do this yields a ! isEmpty() assert at run time followed by screen after screen of spew. One should be able to return an empty list. According to the QVariant doc toList() is theoretically capable of this.

https://www.copperspice.com/docs/cs_api/class_qvariant.html#a210153c4e3a598177667e96ae7935e6a

I had to change my method to return a bool and take a QList<QString> reference as a parameter for a work around.