[Interest] QSqlTableModel and QSqlRelationalTableModel busted for SQLite

2021-01-04 Thread Roland Hughes
All, Someone asked me to take a look at this and set up a nice little demo program using SQLite. I couldn't believe it when I tried this. void SQLiteModel::deleteRow(int rowNo) {     qDebug() << "removeRow called for " << rowNo << "\n";     bool rslt = removeRow(rowNo);     qDebug() << "result

Re: [Interest] QsqlTableModel

2015-02-18 Thread Graham Labdon
There are no other queries -Original Message- From: Jason H [mailto:jh...@gmx.com] Sent: 18 February 2015 14:07 To: Graham Labdon Cc: Interest@qt-project.org Subject: Re: [Interest] QsqlTableModel > From: "Graham Labdon" > > Hi > I am attempting to use QSqlTab

Re: [Interest] QsqlTableModel

2015-02-18 Thread Jason H
> From: "Graham Labdon" > > Hi > I am attempting to use QSqlTableModel to delete rows from an Sqlite database. > - > > model->select(); > bool b = model->removeRows(0,200); > model->submitAll(); > > The return value is false, so I thought I would get the last error using > >

[Interest] QsqlTableModel

2015-02-18 Thread Graham Labdon
Hi I am attempting to use QSqlTableModel to delete rows from an Sqlite database. - model->select(); bool b = model->removeRows(0,200); model->submitAll(); The return value is false, so I thought I would get the last error using QSqlError e = model->lastError(); However,

Re: [Interest] QSqlTableModel remove row

2014-02-16 Thread Oscar Kuchuk
Try delete row from model, view reacts accordingly El Viernes, 14 de febrero de 2014 15:42:57 Karl Ruetz escribió: > One possible way would be to connect the rowsRemoved signal for the model to > a slot that calls model.select() or some other function that resets the > model and updates the view.

Re: [Interest] QSqlTableModel remove row

2014-02-15 Thread Mark Brand
> On Feb 14, 2014, at 3:59 PM, > > wrote: > >> Hi. >> How to correctly remove row from QSqlTableModel? >> I’ve used removeRow() and removeRows() but they are half-worked. They >> remove row from the database table and in the view

Re: [Interest] QSqlTableModel remove row

2014-02-14 Thread Karl Ruetz
One possible way would be to connect the rowsRemoved signal for the model to a slot that calls model.select() or some other function that resets the model and updates the view. Karl On Feb 14, 2014, at 3:59 PM, wrote: > Hi. > > How to correctly remove row from QSqlTableModel? > > I’ve u

[Interest] QSqlTableModel remove row

2014-02-14 Thread igor.mironchik
Hi. How to correctly remove row from QSqlTableModel? I’ve used removeRow() and removeRows() but they are half-worked. They remove row from the database table and in the view I see that data is gone, but empty row in the view is still displayed...___ I

Re: [Interest] QSqlTableModel couldn't insert new record.

2014-02-14 Thread Mark Brand
On 02/14/2014 01:11 PM, igor.mironc...@gmail.com wrote: > I’m trying to insert new record to the table with: > QSqlRecord r; > r.setValue( 0, 0 ); > r.setValue( 1, QString() ); > r.setValue( 2, QString() ); > r.setValue( 3, QString() ); > if( !d->model->insertRecord( -1, r ) ) >

Re: [Interest] QSqlTableModel couldn't insert new record.

2014-02-14 Thread igor.mironchik
I’ve found the problem... The problem solved with: QSqlRecord r = d->model->record(); From: igor.mironc...@gmail.com Sent: Friday, February 14, 2014 2:07 PM To: interest@qt-project.org Subject: QSqlTableModel couldn't insert new record. Hi. I have the next SQLite table: QSqlQuery table( QLat

[Interest] QSqlTableModel couldn't insert new record.

2014-02-14 Thread igor.mironchik
Hi. I have the next SQLite table: QSqlQuery table( QLatin1String( "CREATE TABLE IF NOT EXISTS contacts ( " "marked INTEGER, contact TEXT, ""type TEXT, comment TEXT )" ) ); And the next QSqlTableModel: model = new QSqlTableModel( w, db );model->setTable( QLatin1Str

Re: [Interest] QSqlTableModel - table name issue in Postresql

2013-04-08 Thread Sergey Borovkov
SQL is not case sensitive unless you use quotes. So since you created tables with mixed lower and upper case there is no other choice but to quote them (or name your tables in lower case separated by underscores which is more common I believe). On Sat, Apr 6, 2013 at 4:30 PM, Muhammad Bashir Al-No

Re: [Interest] QSqlTableModel - table name issue in Postresql

2013-04-08 Thread Tony Rietwyk
gards, Tony From: interest-bounces+tony=rightsoft.com...@qt-project.org [mailto:interest-bounces+tony=rightsoft.com...@qt-project.org] On Behalf Of Muhammad Bashir Al-Noimi Sent: Tuesday, 9 April 2013 7:04 AM To: interest@qt-project.org Subject: Re: [Interest] QSqlTableModel - table

Re: [Interest] QSqlTableModel - table name issue in Postresql

2013-04-08 Thread Muhammad Bashir Al-Noimi
On 04/08/2013 03:00 AM, Tony Rietwyk wrote: Hi Muhammad, I don't know Postgresql at all. I believe it is based on Oracle. Oops!! you don't know Postgresql!!! It's not related to Oracle https://en.wikipedia.org/wiki/Postgresql Your problem sounds like the table name was quoted in the crea

Re: [Interest] QSqlTableModel - table name issue in Postresql

2013-04-07 Thread Tony Rietwyk
unces+tony=rightsoft.com...@qt-project.org] On Behalf Of M. Bashir Al-Noimi Sent: Monday, 8 April 2013 1:44 AM To: Sviatoslav Feshchenko; interest@qt-project.org Subject: Re: [Interest] QSqlTableModel - table name issue in Postresql Some how this issue is related but not directly. Does any one has an i

Re: [Interest] QSqlTableModel - table name issue in Postresql

2013-04-07 Thread M. Bashir Al-Noimi
Some how this issue is related but not directly. Does any one has an idea how to pass table name directly as string? On Sat, Apr 6, 2013 at 3:58 PM, Sviatoslav Feshchenko < sviatos...@outlook.com> wrote: > See if your issue is related to > QTBUG-30076

[Interest] QSqlTableModel - table name issue in Postresql

2013-04-06 Thread Muhammad Bashir Al-Noimi
Hi All, Recently I noticed that I’ve to add double quotes to table’s name for calling Postgresql’s table while it’s not required for MySQL or SQLite tables!! how can I make QSqlTableModel works in same way for three types of SQL databases? Posgtresql: p_tableModel->setTable("\"Persons\"

Re: [Interest] QSqlTableModel::setFilter()

2013-03-16 Thread Sviatoslav Feshchenko
That does it! Thank you! Date: Sat, 16 Mar 2013 17:12:32 +0400 From: dmitrii.volosn...@gmail.com To: interest@qt-project.org Subject: Re: [Interest] QSqlTableModel::setFilter() Have you tried to call QSqlTableModel::setFilter() with empty string? Regards,Dmitrii

Re: [Interest] QSqlTableModel::setFilter()

2013-03-16 Thread Dmitrii Volosnykh
Have you tried to call QSqlTableModel::setFilter() with empty string? Regards, Dmitrii. ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest

[Interest] QSqlTableModel::setFilter()

2013-03-15 Thread Sviatoslav Feshchenko
Dear Qt community, Please excuse if you consider this to be a basic question, admittedly I am not a Qt expert, tasked with my first Qt application. Could someone recommend to me please the best way to remove, or clear, a filter set with QSqlTableModel::setFilter() function? There doesn't appear t

Re: [Interest] QSqlTableModel and transactions

2013-01-05 Thread Petric Frank
Hello Mark, Am Freitag, 4. Januar 2013, 13:23:59 schrieb Petric Frank: > > > NB.: If i do a revert or select call on QSqlDatabase having > > > un-submitted data after the rollback i get a 'Vector index out of > > > range' trap from inside the qt-lib. This might be a coding error of > > > me. But i

Re: [Interest] QSqlTableModel and transactions

2013-01-04 Thread Petric Frank
Hello Mark, Am Freitag, 4. Januar 2013, 12:03:22 schrieb Mark Brand: > > i ran into an issue using transactions together with QSqlTableModel. > > > > Whenever i do a "QSqlDatabase::rollback ()" the QSqlTableModel internal > > buffer is not updated to reflect this. So it still shows the data befor

Re: [Interest] QSqlTableModel and transactions

2013-01-04 Thread Mark Brand
Petric Frank wrote: > Hello, > > i ran into an issue using transactions together with QSqlTableModel. > > Whenever i do a "QSqlDatabase::rollback ()" the QSqlTableModel internal buffer > is not updated to reflect this. So it still shows the data before the > rollback. I'm not sure whether your "i

[Interest] QSqlTableModel and transactions

2013-01-03 Thread Petric Frank
Hello, i ran into an issue using transactions together with QSqlTableModel. Whenever i do a "QSqlDatabase::rollback ()" the QSqlTableModel internal buffer is not updated to reflect this. So it still shows the data before the rollback. Is there a signal or other method to detect a rollback ? Thi

Re: [Interest] QSqlTableModel -- best approach for simple database application?

2012-05-24 Thread Mark Brand
>> Qt 5 has many improvements for QSqlTableModel, so if it's feasible for you, >> consider using Qt 5. With any luck, Qt 5.0 will be released before your >> application. > I could be game for that. > > A couple of questions about Qt 5.0: > > Would I expect any significant compatibility issues with

Re: [Interest] QSqlTableModel -- best approach for simple database application?

2012-05-24 Thread K. Frank
Hi Mark! I appreciate you comments. On Thu, May 24, 2012 at 11:22 AM, Mark Brand wrote: > >> I've started browsing the SQL Table Model example in the 4.8 documentation >> (sql/tablemodel/tablemodel.cpp), but I seem to recall some discussions >> suggesting that QSqlTableModel has some limitations

Re: [Interest] QSqlTableModel -- best approach for simple database application?

2012-05-24 Thread Mark Brand
> I've started browsing the SQL Table Model example in the 4.8 documentation > (sql/tablemodel/tablemodel.cpp), but I seem to recall some discussions > suggesting that QSqlTableModel has some limitations or problems that > might make it not the best choice. Qt 5 has many improvements for QSqlTabl

[Interest] QSqlTableModel -- best approach for simple database application?

2012-05-21 Thread K. Frank
Hi List! I'm looking to build a simple database utility application. The main goal is to have a tool for conveniently viewing and editing some pre-defined tables. (This is indeed related to my previous post about SQLite -- I am planning to use SQLite as the database, barring advice to the contra