PDA

View Full Version : problem with QDataTable



zlatko
26th April 2006, 11:16
HI all
I create QDataTable obj from designer,so i select needed correct connection and table that i want to see. But after showing this widget i have next message in console


QSqlCursor::setName: unable to build record, does 'departments' exist?


My answer - yes it exist....data table wizard give me this table in db tables list....
Where is my problem?

jacek
26th April 2006, 14:44
Where do you show that widget? In the Designer?

zlatko
26th April 2006, 14:49
#include <qapplication.h>
#include "inc/qformeditobjbase.h"

int main( int argc, char ** argv )
{
QApplication a( argc, argv );

// widget with one data table
QFormEditObjBase frmObjEditBase;
a.setMainWidget(&frmObjEditBase);
frmObjEditBase.show();

a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
}

jacek
26th April 2006, 15:31
You must connect to the database yourself. Connections that you define in Qt Designer are only used internally --- they aren't stored in a .ui file.