On 28/01/2013 08:36 ص, Yves Bailly wrote:
Assuming your're using some low-level SQL function and not QSqlQuery and the likes to
"build" the SQL command to execute, here's something that works, albeit probably not
very efficient:
QString html = textEdit->toHtml();
QByteArray utf8 = html.toUtf8();
QByteArray base64 = utf8.toBase64();
char const* data = ""
sql_writer_function(data);

To read the data back:
char const* data = ""
QByteArray base64(data);
QByteArray utf8 = QByteArray::fromBase64(base64);
QString html = QString::fromUtf8(utf8.constData());

A drawback is that your text is not stored in a human-readable way, but you get the idea.
You can also store a BLOB if your database backend supports this.
Thanks Yves,

Actually it works fine :-D 


-- 
Best Regards
Muhammad Bashir Al-Noimi
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to