<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><div style="direction: ltr;"><span style="-webkit-text-size-adjust: auto;">Well I am ok with those drivers I have problem with creating qsqltableview rows and columns and their codes like qtable widget which I can easyly do it but the problem is its low speed.</span></div><br><span style="-webkit-text-size-adjust: auto;">Sent from my iPhone</span></div><div style="-webkit-text-size-adjust: auto;"><br>On Mordad 2, 1397 AP, at 8:08 PM, J Barchan <<a href="mailto:jnbarchan@gmail.com">jnbarchan@gmail.com</a>> wrote:<br><br></div><blockquote type="cite" style="-webkit-text-size-adjust: auto;"><div><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 24 July 2018 at 16:24, Maziar Parsijani <span dir="ltr"><<a href="mailto:maziar.parsijani@gmail.com" target="_blank">maziar.parsijani@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Obviously I have a problem with creation of qsqltableview not to put just my data base.<br></div>Here you can see that I can read my database :<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">import sqlite3<br><br>conn = sqlite3.connect(' sqlite path to file.db ')<br>conn_cursor = conn.cursor()<br>conn.text_factory = str<br>res = conn.execute("SELECT text FROM table WHERE condition='?';")<br>for text in res:<br>    print (text[0])<br></blockquote><div> I need a help to put these data which is text in qsqltable view and the example have just created a db with its own data that I don't understand anything of it.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 24, 2018 at 4:10 PM, Florian Bruhin <span dir="ltr"><<a href="mailto:me@the-compiler.org" target="_blank">me@the-compiler.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Tue, Jul 24, 2018 at 01:54:13PM +0430, Maziar Parsijani wrote:<br>
> PYQT5 examples for sqlite and <div style="font-family:tahoma,sans-serif;display:inline" class="gmail_default">​​</div>QSqlTableModel are not for reading sqlite<br>
> database  and show them in QSqlTableModel.<br>
> I want to read my database rows and columns and show them in<br>
> QSqlTableModel.Are there any good examples for such thing ?<br>
<br>
</span>The examples just use an in-memory database<br>
("db.setDatabaseName(':memory:<wbr>')" in connection.py). If you instead pass<br>
a filename to a sqlite database, it'll read that database.<br>
<div class="m_-8984251640367879352HOEnZb"><div class="m_-8984251640367879352h5"><br>
Florian<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
<a href="https://www.qutebrowser.org" rel="noreferrer" target="_blank">https://www.qutebrowser.org</a> | <a href="mailto:me@the-compiler.org" target="_blank">me@the-compiler.org</a> (Mail/XMPP)<br>
   GPG: 916E B0C8 FD55 A072 | <a href="https://the-compiler.org/pubkey.asc" rel="noreferrer" target="_blank">https://the-compiler.org/pubke<wbr>y.asc</a><br>
         I love long mails! | <a href="https://email.is-not-s.ms/" rel="noreferrer" target="_blank">https://email.is-not-s.ms/</a><br>
</font></span></div></div></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
PyQt mailing list    <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>
<a href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt" rel="noreferrer" target="_blank">https://www.<wbr>riverbankcomputing.com/<wbr>mailman/listinfo/pyqt</a><br></blockquote></div><br><div style="font-family:tahoma,sans-serif" class="gmail_default">​To start out from: you are using a dedicated Python <span style="font-family:monospace,monospace">import sqlite3</span> module.​</div><div style="font-family:tahoma,sans-serif" class="gmail_default">Unless you have a good reason (lots of existing code) which makes you want to stick with that, I would suggest instead you consider changing over to using the Qt MySQL database drivers (includes support for SQLite) & classes.</div><div style="font-family:tahoma,sans-serif" class="gmail_default">That will allow you to use classes like <span style="font-family:monospace,monospace"><div style="display:inline" class="gmail_default">​</div>QSqlTableModel</span> easily, which in turn interface with <span style="font-family:monospace,monospace">QTableView</span> naturally, and there are plenty of examples of that.<br></div><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><span style="font-family:tahoma,sans-serif">Kindest,</span></div><div><span style="font-family:tahoma,sans-serif">Jonathan</span></div></div></div></div></div>
</div></div>
</div></blockquote></body></html>