Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[db manager] Fix virtual layers plugin (fixes #14404)
  • Loading branch information
Hugo Mercier committed Mar 23, 2016
1 parent 3d16010 commit 7dbc0bf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions python/plugins/db_manager/db_plugins/vlayers/data_model.py
Expand Up @@ -26,7 +26,7 @@
from ..plugin import DbError

from PyQt.QtCore import QUrl, QTime, QTemporaryFile
from qgis.core import QGis, QgsVectorLayer
from qgis.core import QGis, QgsVectorLayer, QgsWKBTypes


class LTableDataModel(TableDataModel):
Expand All @@ -46,7 +46,13 @@ def __init__(self, table, parent=None):
# populate self.resdata
self.resdata = []
for f in self.layer.getFeatures():
self.resdata.append(f.attributes())
a = f.attributes()
# add the geometry type
if f.geometry():
a.append(QgsWKBTypes.displayString(QGis.fromOldWkbType(f.geometry().wkbType())))
else:
a.append('None')
self.resdata.append(a)

self.fetchedFrom = 0
self.fetchedCount = len(self.resdata)
Expand Down

0 comments on commit 7dbc0bf

Please sign in to comment.