[Qt-interest] Q3SqlCursor

RZ rz at razfazz.at
Sun May 17 22:56:10 CEST 2009


Hi all,

I'm experiencing a strange problem after having ported my application 
from Qt3(.3.8) to Qt4(.5.1).

The following code worked in Qt3:

     addColumn("usrName", tr("usrName"));
     addColumn("usrType", tr("usrType"));

     QSqlDatabase MyConnection = QSqlDatabase::database("MyDB");

     Q3SqlCursor* cursor = sqlCursor();
     if (!cursor)
     {
	cursor = new Q3SqlCursor("Users", true, MyConnection);
	if (isReadOnly())
	{
	    cursor->setMode(Q3SqlCursor::ReadOnly);
	}
	setSqlCursor(cursor, false, true);
     }
     if (!cursor->isActive())
     {
	refresh(Q3DataTable::RefreshAll);
     }

But leads an empty resultset (no lines are shown) in Qt4.

Thx for any help,

RZ



More information about the Qt-interest-old mailing list