Group: http://groups.google.com/group/qdjango/topics
- Is qdjango-db safe to use from Qt5 apps? [1 Update]
Pete Woods <pete....@canonical.com> Jun 24 02:21AM -0700
Hi,
I'm considering using qdjango in a Qt5 app I'm writing at the moment, but
I'm not getting very far with the examples.
For example:
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName(":memory:");
db.open();
QDjango::setDatabase(db);
Causes the following segmentation fault:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff49ea8d4 in QString::operator==(QLatin1String const&) const ()
from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
(gdb) bt
#0 0x00007ffff49ea8d4 in QString::operator==(QLatin1String const&) const
() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#1 0x00007ffff70f2d08 in operator!= (s=..., this=0x7fffffffdc20) at
/usr/include/qt4/QtCore/qstring.h:413
#2 QDjango::setDatabase (database=...) at QDjango.cpp:164
If I copy the the same code from there into my code locally, e.g.:
QSqlDatabase database(db);
if (database.driverName() != QLatin1String("QSQLITE")
&& database.driverName() != QLatin1String("QSQLITE2")
&& database.driverName() != QLatin1String("QMYSQL")
&& database.driverName() != QLatin1String("QPSQL")) {
qWarning() << "Unsupported database driver" << database.driverName();
}
then that doesn't segfault. Is this problem the result of mixing qt4 and
qt5 libraries together?
I'm using the Ubuntu-packaged version of qdjango (0.2.6) on a 64-bit VM.
Cheers,
Pete
You received this message because you are subscribed to the Google Group qdjango.
--
You can post via email.
To unsubscribe from this group, send an empty message.
For more options, visit this group.
You received this message because you are subscribed to the Google Groups "QDjango" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qdjango+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.