You are not logged in.

Search results

Search results 1-9 of 9.

Thursday, March 25th 2010, 7:49am

Author: innobleday

How to InsertRow Throught QSqlQueryModel ?

I did what was you suggested. Nothing added empty row when I use Source code 1 ui->tableView->update(); and also if I add the same model, because the new model replaces the previous one, it also delete the insetRow command. If you have another idea ? Thanks.

Wednesday, March 24th 2010, 4:46am

Author: innobleday

How to InsertRow Throught QSqlQueryModel ?

Hi All, I have a little problem with my QtCode, perhaps u guys can help me to solve the problem and I'll very appreciate. In my code, I aim to put an empty code to the QTableView whereas the query is get from QSqlQueryModel. I tried with sqlQueryModel->insertRow(0);, but nothing happend in the table. Completely the code looks like this Source code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 sqlQueryModel->setQuery("SELECT * FROM x=a, y=b where b.ID = 0AND (b.anotherid = a.anotherid )",sqlDatabase)...

Thursday, March 18th 2010, 8:16am

Author: innobleday

QSqlQuery and value(0).toString()

Quoted from "Manivannan_1984" Quoted query->exec(); What is the return value for this command? Is it return success? try this .. QSqlQuery *query = new QSqlQuery("databasename"); how if it returns false ?

Monday, March 15th 2010, 4:09am

Author: innobleday

How to append the next Record into QTableView without removing the previous record?

Hi All, I have a problem when I'm coding. I aim to add/append another record to my QTableView without removing previous record showed. The code below used to be like that. Have you any solution for me? Thanks a lot. Source code 1 2 3 4 5 6 7 8 model->setTable("Users"); model->setSort(User_Id, Qt::AscendingOrder); model->setHeaderData(User_Name,Qt::Horizontal,tr("Username")); model->setHeaderData(User_FirstName, Qt::Horizontal, tr("First name")); model->setHeaderData(User_LastName, Qt::Horizontal...

Friday, March 12th 2010, 7:23am

Author: innobleday

How to view in a QTableView from a different table called from current table ?

Hi All, How can I show/view several field (actually 3 field; name, address, and office) in a QTableView from a different table (that is an entity of SQL) that I call it from current table and both related by ID. Thanks a lot.

Friday, March 12th 2010, 7:20am

Author: innobleday

How to insert multiple record into QTableView ?

Hi All, I've a problem when I aim to insert more then one record into my QTableView. I've coded it with: Source code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 QSqlTableModel* modelTable = new QSqlTableModel(this,sqlDatabase); QSqlRecord record = modelTable->record(); record.setValue(Name,QVariant(tr("John"))); record.setValue(Address,QVariant(tr("Jakarta"))); record.setValue(Job,QVariant(tr("Accountant"))); modelTable->insertRecord(1,record); record.setValue(Name,QVariant(tr("Kim"))); record.setValue(Add...

Thursday, March 11th 2010, 3:35pm

Author: innobleday

How to insert record in QSqlTableModel with default values ?

you should define the record variable as a record of a model first. Source code 1 2 3 4 5 QSqlRecord record = modelTable->record(); record.setValue(1,QVariant(tr("hello1"))); record.setValue(2,QVariant("hei")); //tr("hello2"))); record.setValue(3,QVariant(tr("hello3"))); modelTable->insertRecord(1,record);

Tuesday, March 9th 2010, 7:25am

Author: innobleday

How to view in a QTableView from a different table (that is an entity of SQL) called it from current table

Hi All, How can I show/view several field (actually 3 field; name, address, and office) in a QTableView from a different table (that is an entity of SQL) that I call it from current table and both related by ID. Thanks a lot.

Wednesday, February 17th 2010, 12:42am

Author: innobleday

How getting checked items from the QListWidget ?

Hi all, I'm new to Qt so bear with me if the answer to this question seems fairly simple and sorry for my English, it's not good enough. I have a Qt4 GUI Application that allows the user to select items using a QDialog and the items should be set checkable. However I still can't get the selectedItems when the items is checked after the Dialog accepted. I've read all the docs, but can't seem to figure out how to solve it. I hope my question is clear enough and any help will be greatly appreciated...