Bug report #9761
qlonglong with EditRange widget
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | - | ||
Affected QGIS version: | 2.2.0 | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 18307 |
Description
Integer values from spatialite files have QVariant:LongLong format in Qgis and it's impossible to use EditRange widget, value is always 0.
The problem is in qgsattributeeditor_8cpp_source.html, line 1210 : if ( myFieldType QVariant::Int )
A solution is just to change with that : if ( myFieldType QVariant::Int || myFieldType == QVariant::LongLong )
And there is a small issue in qgsattributedialog.cpp for linedit widget, line 407 :
switch ( value.type() )
{
case QVariant::Invalid: text = "NULL"; break;
case QVariant::Int: text = QString::number( value.toInt() ); break;
//LongLong type to add
case QVariant::LongLong: text = QString::number( value.toLongLong() ); break;
case QVariant::Double: text = QString::number( value.toDouble() ); break;
case QVariant::String:
default: text = value.toString();
}
Associated revisions
More LongLong fixes
Fix #9761
History
#1 Updated by Matthias Kuhn over 10 years ago
- Status changed from Open to Closed
Fixed in changeset b02ad1e7d95fe891cc8e2cb9b2a0e3eebe71a9b8.
Thank you for the detailed report