<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 class="">On Tue, Jul 24, 2018 at 01:54:13PM +0430, Maziar Parsijani wrote:<br>
> PYQT5 examples for sqlite and 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="HOEnZb"><div class="h5"><br>
Florian<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">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/<wbr>pubkey.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>
</div></div></blockquote></div><br></div>