[Qgis-developer] morph delimited-text-provider to generic table-provider?

Richard Duivenvoorde rdmailings at duif.net
Sat Jul 9 02:00:38 PDT 2016


Hi Devs,

Raymond Nijssen had an (I think) intriguing idea:

QGIS can open different types of table-data: dbf, excel etc etc

But if the excel contains an x,y,wkt column, you have to save it to
csv/tsv first, to be able to use the delimited-text-provider to open it
as a layer.

His idea: can't we use the delimited-text-provider for all tables that
are open in QGIS immediately?

Had a look into the code

https://github.com/qgis/QGIS/blob/master/src/providers/delimitedtext/qgsdelimitedtextfile.cpp#L583

which 'just' looks like a QTextStream:

https://github.com/qgis/QGIS/blob/master/src/providers/delimitedtext/qgsdelimitedtextfile.h#L352

And according to this:
https://forum.qt.io/topic/63310/how-to-save-a-treeview-as-csv-file-in-qt

It is easy to create a textstream from QModel (in which we have the data
I think???)...

So Question:
- (to devs): would this indeed be doable/easy?
- (to UI's): should the Delimited Text File dialog be updated then (or
only with a 'open excisting table button'?
- should we rename the provider to 'table' provider.

Comments/Opinions?

Regards,

Richard Duivenvoorde


More information about the Qgis-developer mailing list