From 1c759cfa09480058243c1896e1340ee06b3f2e14 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Wed, 11 Jan 2017 20:21:11 -0200 Subject: [PATCH] [Qt] Explicitly map the `bool` binder to `int` On Qt4 and Qt5 the QVariant conversion from bool behaves differently. --- platform/qt/src/sqlite3.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/qt/src/sqlite3.cpp b/platform/qt/src/sqlite3.cpp index b339cb14f..00ad178fd 100644 --- a/platform/qt/src/sqlite3.cpp +++ b/platform/qt/src/sqlite3.cpp @@ -192,7 +192,6 @@ template void Statement::bind(int, int8_t); template void Statement::bind(int, int32_t); template void Statement::bind(int, int64_t); template void Statement::bind(int, uint8_t); -template void Statement::bind(int, bool); template void Statement::bind(int offset, T value) { @@ -210,6 +209,11 @@ void Statement::bind(int offset, std::nullptr_t) { checkQueryError(impl->query); } +template <> +void Statement::bind(int offset, bool value) { + bind(offset, static_cast(value)); +} + template <> void Statement::bind(int offset, mbgl::Timestamp value) { bind(offset, std::chrono::system_clock::to_time_t(value));