Can you see the changes if you update your database using the console (i.e. "mysql" program)?
Can you see the changes if you update your database using the console (i.e. "mysql" program)?
No
cant see the changes in the QDataTable even if i change the database from mysql prompt :
mysql>
i dont understand what is the problems.??
There are 10 kinds of people in this world. Those who understand binary, and those who dont.
regards
shamik
Do you start any transactions before reading data from the database?
i dont use any trasactions
just start mysql and start reading data or execute the exe which does the same.
no complex things are done with mysql. just reading and writing the data. no transactions are used. no committing is done either.
this i think is an exceptional case of mine.
There are 10 kinds of people in this world. Those who understand binary, and those who dont.
regards
shamik
What happens if you set a new cursor instead of invoking refresh()?
i have temporarily solved the problem
what i used to do is i was loading a login dioalog from main. then from login dialog i used to load the edit dialog which contained the QDataTable and hide the login dialog.
but now what i m doing is instead of loading the login dialog from main, i m directly loading the edit dialog which contains QDataTable. now i can easily see the changes made to the database either from mysql prompt or from another project's GUI in current QDataTable without unloading and loading. i.e. now the refresh() and update() functions are working fine.
i think this is not the optimum solution but still it satisfies my requirements.
anyways,
thanks allllllloooooooot to all of you who have helped me so far and contributed in solving my problem.
but the original problem is still as it is.
hope the posts will continue in this thread so that the problem may not be risen by somebody else.
remember : together we can and we will make the difference.![]()
There are 10 kinds of people in this world. Those who understand binary, and those who dont.
regards
shamik
In other words you had something like this?
Qt Code:
int main(...) { ... LoginDialog dialog; // modal dialog dialog.exec(); // dialog shows the main window and exec() returns when user closes that window ... return app.exec(); }To copy to clipboard, switch view to plain text mode
not exactly like that but somewhat similar.
my main.cpp is already there in the previous page. editfrm is the dialog that contains the QDataTable which gets loaded after loading the login dialog called loginfrm..
from main i used to do the following :
QApplication a(argc,argv);
loginfrm lfrm;
a.setMainWidget(&lfrm);
lfrm.show();
a.connect(......);
return a.exec();
( note that the main in the previous page directly loads editfrm. this i have written only for the ease of understanding. but original main is the one like above)
and from the loginfrm after satisfying the conditions of login name and password i used to do the following :
editfrm *efrm = new editfrm(this);
hide();
efrm.show();
this would hide the login dialog form and show the editfrm dialog which contains the QDataTable.
but unfortunately the datatable is not getting updated.
got the picture clear in the mind??
There are 10 kinds of people in this world. Those who understand binary, and those who dont.
regards
shamik
Bookmarks