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

How to get the executed SQL statement associated with QSqlTableModel::setData()?

I am inserting/updating a database table from a Qt application using QSqlTableModelmethods setData, submitAll and commit. For logging purposes, I need to record the corresponding SQL statements. How can I do that? (I am looking at…
fortytwo
  • 491
  • 1
  • 5
  • 16
0
votes
1 answer

QSqlDatabase hello world application fails to debug

I'm attempting a QSqlDatabase hello world application using PostgreSQL. My environment is as follows: Windows 7 64-bit, Qt 4.8.2, PostgreSQL 9.0.13. The following code compiles, but will not debug, i.e. when I place a break on the…
soulia
  • 483
  • 2
  • 6
  • 20
0
votes
1 answer

Why the QTableView is painted black when i resize the Dialog?

I have a problem when the resize function, I do this in the click signal: if(ShowingDetails){ ui->BtShowingData->setText("<< Hide details"); //this->setMaximumWidth(1050); //this->setMinimumWidth(1050); this->resize(1050,…
bluesky777
  • 400
  • 6
  • 23
0
votes
1 answer

isSelect QSqlQuery not working as expected

I have the following code: QString req = QString( "dbo.create_bsk @sico = " ) + QString(current_sico.c_str()) + ", @dev_cod='" + local_ccy.c_str() +"'"; QSqlQuery query = db.exec(req); std::cout << req.toStdString() << std::endl; std::cout <<…
user2346536
0
votes
1 answer

How to filter QSqlRelationaltableModel with PyQt?

I am having the following code below based on the PyQt documentation: model = QSqlRelationalTableModel() model.setTable("employee") model.setRelation(2, QSqlRelation("city", "id", "name")) model.setRelation(3, QSqlRelation("country", "id",…
Moayyad Yaghi
  • 3,622
  • 13
  • 51
  • 67
0
votes
2 answers

How can I group products and then sort them by date desc in TSQL?

Here is the SQL but it gives me an error: select u.productId, count(ProductID) as total, p.Name from dbo.UserXProduct AS u INNER JOIN dbo.product AS p ON u.ProductID = p.ID group by productid, p.name having count(ProductID) > 5 order by…
Shuaib
  • 1,561
  • 3
  • 19
  • 28
0
votes
1 answer

Qt executeable crashes on another system

Application is compiled using Qt 4.8.1 msvc10 and i have copied every .dll needed still the application crashes before starting and the module causing the crash is qtsql4.dll although it works fine within my system how can i fix this error
Alireza Soori
  • 645
  • 9
  • 25
0
votes
1 answer

Qt - Trying mysql driver

I followed this tutorial to compile mysql driver with VS2010 : Qt - How to get|compile Mysql driver. The compilation fails with the error : LNK1123: failure during conversion to COFF: file invalid or corrupt I tried with with multiple versions of…
0
votes
3 answers

QtSql connection

I am trying to create a connection to a database and insert/delete/make queries to the database. I know SQL relatively well but I cannot seem to wrap my head around it in Qt. I used to program in Delphi. This is my code so far: QSqlDatabase…
Armand Maree
  • 488
  • 2
  • 6
  • 21
0
votes
2 answers

qt select not working with where statement

I'm using qt 4.8 and psql driver to connect to a postgres 9.1 database. I'm doing a generic library to connect and insert into the database; almost all methods are ready but in the last one, I need to do a select from a table to insert values into…
Edgar Sampere
  • 263
  • 4
  • 24
0
votes
2 answers

Qt SQL - Configuring Connection to Database

I have given up on trying to configure the MYSQL driver for the Qt 5.0 library, I am going to use the only driver currently available to me - "QSQLITE". I have been trying to get this working for quite some time and have tried everything mentioned…
Alex Hendren
  • 446
  • 1
  • 5
  • 18
0
votes
1 answer

why is my transaction not rolling back? Qt Mysql odbc driver

I'm using Qt 4.8.3 and MySQL ODBC 3.51 Driver. When my transaction fails because of a duplicate unique Id in the second table the insert in the first table is not rolled back. Can anyone spot the error? struct Property //see OMG's Property…
odinthenerd
  • 5,422
  • 1
  • 32
  • 61
0
votes
1 answer

Introduction to SQL for C++ programmer

I'm a C++ programmer who wants to expand his knowledge into SQL language because I'm dealing with QtSQL module and would like to understand it better. I would like to find a gentle introduction to SQL language for a C/C++ programmer. Can you suggest…
linello
  • 8,451
  • 18
  • 63
  • 109
0
votes
1 answer

How to use a variable as an int inside a query to a mssql db using qt?

I have built a quick app I'm trying to make to learn how I could implement dynamic fitment or category options list to a list of products(I.E. Make, Model, Year Search). I thought I found a simple way of doing this, but I have found it is harder…
Rob
  • 169
  • 4
  • 14
0
votes
3 answers

Do I need an SQL server to work with Qt's QtSql library?

I am a beginner with Qt, so my question might be a bit basic. My intention is to work with an ODBC database located in my hard drive. I have tried to open it with this code: QSqlDatabase db =…
DrD
  • 419
  • 4
  • 14
1 2 3
15
16