grellsworth
6th August 2007, 17:40
I get a list of tables from my database into a QStringList, I want to use QStringList's filter function to list all tables EXCEPT those that begin with "sqlite", how can I do this with filter, using RegExp?
Here's what I'm currently trying:
QStringList tables = database.tables(tableType); // tableType = QSql::Tables
QStringList ret_tables = tables.filter(QRegExp("^sqlite{0,0}", Qt::CaseInsensitive));
When I do this, my ret_tables ends up completely blank.
So basically I want to know how to do a RegExp filter which will match everything except strings beginning with "sqlite".
Here's what I'm currently trying:
QStringList tables = database.tables(tableType); // tableType = QSql::Tables
QStringList ret_tables = tables.filter(QRegExp("^sqlite{0,0}", Qt::CaseInsensitive));
When I do this, my ret_tables ends up completely blank.
So basically I want to know how to do a RegExp filter which will match everything except strings beginning with "sqlite".