Do you mean that if a connection and datatable object created through the QT designer code will not work?
Could not get you 
Anyway,
Suppose you have made the connection in the designer. Thne that connection will only be used by with the designer. And no information about the connection gets written in the ui file. Onlt the information about the data-aware widgets are stored
So when you actually run the application, the uic does not generate a code to connect to the database. Instead we should make a connection to the database. and then things will work fine. Normally, in the main function we will call a connectToDatabase function
int main( ... ) {
// create a connection
if( ! connectToDatabase() ){
return 0;
}
// Creare and show the Window with dataaware widget and
// Hope things will work fine ^-^
return app.exec();
}
int main( ... ) {
QApplication app( .. );
// create a connection
if( ! connectToDatabase() ){
return 0;
}
// Creare and show the Window with dataaware widget and
// Hope things will work fine ^-^
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks