Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
4.6.1
-
None
-
WIndows XP
Description
The code line that does this is in Qt to q3datatable.cpp: Q3Datatable::loadNextPage() method's third last row:
setNumRows( endIdx ? endIdx + 1 : 0 );
This row is different in Qt 3.3.8 which works ok.
#include <QtGui> #include <QtSql> #include <Q3DataTable> int main(int argc, char *argv[]) { QApplication app(argc, argv); QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); db.setDatabaseName(":memory:"); if (!db.open()) { QMessageBox::critical(0, qApp->tr("Cannot open database"), qApp->tr("Unable to establish a database connection.\n" "This example needs SQLite support. Please read " "the Qt SQL driver documentation for information how " "to build it.\n\n" "Click Cancel to exit."), QMessageBox::Cancel); return 1; } QSqlQuery query; query.exec("create table person (id int primary key, " "firstname varchar(20), lastname varchar(20))"); query.exec("insert into person values(101, 'Danny', 'Young')"); // query.exec("insert into person values(102, 'Christine', 'Holand')"); // query.exec("insert into person values(103, 'Lars', 'Gordon')"); // query.exec("insert into person values(104, 'Roberto', 'Robitaille')"); // query.exec("insert into person values(105, 'Maria', 'Papadopoulos')"); query.exec("create table offices (id int primary key," "imagefile int," "location varchar(20)," "country varchar(20)," "description varchar(100))"); Q3SqlCursor cursor("person", true, db); cursor.select(); Q3DataTable dataTable(&cursor, true); dataTable.show(); dataTable.refresh(); return app.exec(); }