Questions tagged [qtsql]

Questions related to QtSQl Module, a collection of Qt classes that work with various relational database management systems.

Provides a driver layer, SQL API layer, and a user interface layer for SQL databases.

238 questions
1
vote
1 answer

How to connect QSqlTableModel with QTableView?

i want a simple example of connecting QSqlTableModel with QTableView , connecting the QSqlTableModel to dataset file (*.db) then connecting it to QTableView ? semi code: from PyQt5 import QtWidgets, QtGui, QtCore, QtSql class…
user13522091
1
vote
0 answers

Cached QSqlQueryModel to mimic OnManualSubmit

I would like to implement a feature like the EditStrategy available on the QSqlTableModel but on a QSqlQueryModel because I have complex queries. I have already created my subclass of QSqlQueryModel implementing the setData() following the…
Thombou
  • 367
  • 2
  • 15
1
vote
1 answer

PyQt - Accessing SQL data from a table entry

I will briefly describe my program first Program Description Below are the 2 widows used in the program: Main Window (Group List) Input Window (Student Table) The Main Window allows users to create/edit/delete entries in Groups list (QListWidget),…
yhkdev
  • 35
  • 7
1
vote
0 answers

Opening encrypted database with qtsql

I would like to know if it is possible without adding new libraries, to open an encrypted sql database inside a software using QT libraries. In the program SQLITEManager, it is possible to use 4 kinds of encryption: AES128 AES256 RC4 SQLCipher My…
froz
  • 163
  • 1
  • 12
1
vote
2 answers

what's the fastest way to fill a table in SQLite?

I'm writing an application which produces a lot of data to store in a database. The DB schema is very simple: it's a table with just 4 columns, but I must fill it with more than 30000 rows. I'm using SQLite and QSql as API. Data is produced very…
Emiliano
  • 22,232
  • 11
  • 45
  • 59
1
vote
2 answers

QT paging using QSqlQueryModel

I am looking for a solution of creating paging using QSqlQueryModel. Problem I am having is I want to use paging in extracting the data from sql db file , for this i have chosen QSqlQueryModel. But now the problem is that I cannot control of how…
Mandeep
  • 335
  • 3
  • 13
1
vote
1 answer

PyQt load database in tableview

I have some issues with loading correctly databases in a tableview in my pyqt ui. The problem is that these specific databases have column that contains BLOB data and they are not displayed correctly in tableview. Opening the same database with…
erma86
  • 75
  • 1
  • 10
1
vote
1 answer

Inserting data from an SqlLite3 database into a QTableWidget

I'm building a GUI for our testing platform have been instructed the user should be able select tests from a table to run. I'm having issues getting the data into the table itself. I can fetch the data fine, but cannot populate the QTableWidget This…
Glazbee
  • 640
  • 5
  • 22
1
vote
1 answer

QSqlite changes

My team were previously using Qt 4.3 and are trying to update to the latest release (4.7.2). Before we were using the qsqlite plugin, but this functionality has been moved into the main QSql component of Qt. Now that we have upgraded, we're unable…
Liron
  • 2,012
  • 19
  • 39
1
vote
0 answers

PyQt4 (python 2.7): QSqlQuery can't extract value

I'm new to PyQt programming and I was asked to build a GUI for a Postgres database. I'm trying to use the QtSql, but when I try to return a value after executing a query, I don't get the value I'm looking for. db = QSqlDatabase.addDatabase("QPSQL",…
Luca
  • 11
  • 2
1
vote
1 answer

QtSql Dynamic Select query with multiple WHERE filters

I need to execute any select query using the same method. So, the query my has to filter the selected data using one value or more. Filters are stored in a map that has the column name as the key and the filtering value as its value. So my…
Samir N Ahmad
  • 575
  • 6
  • 16
1
vote
1 answer

How do I display a SQLite table in a QTableView

I am trying to connect to a local database and show a table in QTableView. I am currently getting a connection to my database but whenever I try to append my query to the QTableView box i am getting QSqlError("", "Unable to find table projects",…
Jordan
  • 27
  • 6
1
vote
1 answer

QtSql: binding doesn't change query with SQLite

I have the following code that's supposed to bind a value to a prepare statement: QSqlQuery query(db); query.setForwardOnly(true); query.prepare("SELECT Entry.* FROM Entry WHERE body LIKE ?;"); query.addBindValue(QVariant("%" + name +…
bb94
  • 1,294
  • 1
  • 11
  • 24
1
vote
1 answer

QtSql (from PyQT) seems to be broken

I cannot access mysql server (on localhost). Python 3.1 & latest PyQt my code: from PyQt4 import QtSql db =…
1
vote
1 answer

Display data from joined SQLite tables using PyQt5.QtSql?

I'm trying to build a GUI using PyQT5 (under Python3) which, among other things, should display and allow interaction with data from joined tables from an SQLite database. I think this needs the QSqlRelationalTableModel class. I have found…
CodingCat
  • 4,999
  • 10
  • 37
  • 59