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
0
votes
1 answer

Passing QSqlQueryModel through control class

How would I go about passing QSqlQueryModel from a class that connects and queries the database through the control class or QMainWindow in my attempt and back to the widget needing the information? I thought I could pass the reference location to…
Brandon Clark
  • 788
  • 1
  • 13
  • 26
0
votes
0 answers

Invalid QSqlRecord after performing another query to DB

Here is the code: QSqlQuery q1(db_connection), q2(db_connection); q1.exec("SELECT * from users"); while(q1.next()) { q2.exec("delete from table1"); if (!q2.isValid()) qDebug() << "q2 is not valid"; if (q1.isActive() &&…
crew4ok
  • 195
  • 1
  • 3
  • 10
-1
votes
1 answer

Can I use an existing Python sqlite connection with a QSqlDatabase?

This project is in Python and will have an sqlite3 database. I would like to open the sqlite3 database using Python's sqlite3 module. But I also want to have functionality from the PySide6.QtSql module. PySide's documentation shows an example of…
UndoingTech
  • 709
  • 3
  • 16
-1
votes
1 answer

Why is QSqlDatabase::drivers() empty when used in a Qt shared library project?

I am creating a standalone Qt shared library. This library basically acts as an interface to perform SQLite queries so it needs to use the QSqlDatabase module. The library's source code: wxsqlite3-interface.h: #ifndef WXSQLITE3INTERFACE_H #define…
Kazuto_Ute
  • 679
  • 6
  • 20
-1
votes
1 answer

Convenient Way to Create Offline/Disconnected data from QtSQL?

I'm trying to figure out how to grab 2D data from a database and stuff it into widgets. This data is quasistatic -- once I grab it there is no need to stay connected to the database. Further, if I leave the connection open, but it times out, it can…
bfris
  • 5,272
  • 1
  • 20
  • 37
-1
votes
1 answer

undefined reference to symbol '_ZN12QSqlDatabase11setHostNameERK7QString'

My program has a basic function for adding datas to database but when the code gives an error when it is compiled. void MainWindow::AddLocationToDatabase() { QSqlDatabase db= QSqlDatabase::addDatabase("QMYSQL"); …
Ms.Sahin
  • 101
  • 8
-1
votes
2 answers

How to show data from database in QTableView using some condition

I am a beginner in Qt programming and I am working on a project in which I am using SQLite database. I have 20 rows in my database and I just want to show last five rows in QTableView when I press show button first time. If I then press the show…
-1
votes
1 answer

build master/detail form using pyqt and qtsql

Edit: Repost with new code and clear question: in the code below you can add and save properly and the question is: I need to do the same but without submitting data to database on row change, I need to be able to add new contact record (master)…
Mohamed Yousof
  • 725
  • 1
  • 9
  • 38
-1
votes
2 answers

QtSql application not working on the deployed machine

I made a software in Qt/C++. I need to deploy it on Windows 7 (64 bit), which is also the host machine on which I developed the software. The problem is that my software can interact with the sqlite database on the developed machine, but when I try…
-1
votes
2 answers

QT sql programming

include "mythread.h mythread::mythread(int ID, QObject *parent) : QThread(parent) { this->socketDescriptor = ID; db = QSqlDatabase::addDatabase("QODBC"); db.setHostName("127.0.0.1"); db.setDatabaseName("mydsn"); if…
developer
  • 37
  • 1
  • 6
-1
votes
1 answer

How to install QMYSQL plugin

As the question says, how to install QMYSQL plugin? I'm using Ubuntu 11.10, QtSDK 4.8
Dewsworld
  • 13,367
  • 23
  • 68
  • 104
-2
votes
1 answer

How to get PYQT5 text box to be taken as an input by sqlite?

I've been trying to create a program that registers and logs in a user, the register part should store the details into a database but I've experienced a bit of trouble with taking input from the QT text box and inserting it into my database. It…
DIRi
  • 13
  • 5
-4
votes
2 answers

I need a query to delete a value in table if value is older than 4 months please look at details

I have a EmailID_tbl that has email address of the users I have got request to "remove emails from EmailID_tbl if last login date for user is within the past 4 months."
1 2 3
15
16