Results 1 to 20 of 26

Thread: Refresh QDataTable

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2006
    Posts
    102
    Qt products
    Qt3
    Platforms
    Unix/X11
    Thanks
    5

    Default Re: Refresh QDataTable

    i opened the console and typed mysql
    then mysql prompt appeared. do you mean this as mysql console??

    now i typed the select query on that particular table. now the table is shown on the console.
    keeping that open, i ran the exe of the project through which i want to change the database content. i made the changes from its GUI. but the sql table in the console showed the same result (it is obvious). to see the changes i have to write the query in the console again. then i can see the changes.

    this is the case with the original project too. the qdatatable widget doesnt reflect the changes as it should be. but whenever i hide it and show other dialog and then again i hide the second dialog and show the original dialog with qdatatable widget then i can see the changes. (hiding and showing is implemented with the help of necessary functions inside the code like show(), hide() ).


    if u call opening mysql from console which gives u mysql prompt like this-->
    mysql>

    then it is obvious that it wil show the changes in the database only if u write the query again after changing it from the GUI.

    if u r talking of any other MYSQL console then please tell me how to open it and how to work on it. i'll try on that also.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Refresh QDataTable

    Quote Originally Posted by shamik View Post
    but whenever i hide it and show other dialog and then again i hide the second dialog and show the original dialog with qdatatable widget then i can see the changes. (hiding and showing is implemented with the help of necessary functions inside the code like show(), hide() ).
    Can you see the changes if you keep that QDataTable shown for more than 5 seconds (i.e. long enough for the timer to emit the signal)?

  3. #3
    Join Date
    Sep 2006
    Posts
    102
    Qt products
    Qt3
    Platforms
    Unix/X11
    Thanks
    5

    Default Re: Refresh QDataTable

    no.

    no changes are seen in the qdatatable no matter howlong i keep the timer going on

  4. #4
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    76
    Thanked 37 Times in 32 Posts

    Default Re: Refresh QDataTable

    It might be possible that the changes you make to the database from the client are not commited !!

    So, You can try comitting the changes to database.
    One more thing, Hope you are setting the interval as 3000 for 3 Sec
    We can't solve problems by using the same kind of thinking we used when we created them

  5. #5
    Join Date
    Sep 2006
    Posts
    102
    Qt products
    Qt3
    Platforms
    Unix/X11
    Thanks
    5

    Default Re: Refresh QDataTable

    i have treid commiting the database after every record change but still it isnt working. the timer time can b anything, may be 3, 5, 7 sec etc. that is not a problem.
    after the database is changed the timer may go on to even ticking 40 times still there is no change in the QDataTable.

    even if the QDataTable is kept shown for say 5 mins then also there is no change in it. i.e. the updated values are not shown.

    is there anything that v m missing ? i donno why does this simple one takes too much of time.
    please help me

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Refresh QDataTable

    Can you see the changes if you update your database using the console (i.e. "mysql" program)?

  7. #7
    Join Date
    Sep 2006
    Posts
    102
    Qt products
    Qt3
    Platforms
    Unix/X11
    Thanks
    5

    Default Re: Refresh QDataTable

    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

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Refresh QDataTable

    Do you start any transactions before reading data from the database?

  9. #9
    Join Date
    Sep 2006
    Posts
    102
    Qt products
    Qt3
    Platforms
    Unix/X11
    Thanks
    5

    Default Re: Refresh QDataTable

    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

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Refresh QDataTable

    What happens if you set a new cursor instead of invoking refresh()?

  11. #11
    Join Date
    Sep 2006
    Posts
    102
    Qt products
    Qt3
    Platforms
    Unix/X11
    Thanks
    5

    Default Re: Refresh QDataTable

    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

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Refresh QDataTable

    Quote Originally Posted by shamik View Post
    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.
    In other words you had something like this?
    Qt Code:
    1. int main(...) {
    2. QApplication app(...);
    3. ...
    4. LoginDialog dialog; // modal dialog
    5. dialog.exec(); // dialog shows the main window and exec() returns when user closes that window
    6. ...
    7. return app.exec();
    8. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. row QDataTable
    By cristiano in forum Qt Programming
    Replies: 1
    Last Post: 18th November 2006, 18:07
  2. Replies: 9
    Last Post: 7th November 2006, 16:10
  3. QDataTable Inserts and Updates
    By ederbs in forum Qt Programming
    Replies: 2
    Last Post: 27th October 2006, 00:23
  4. displaying any table on a qdatatable
    By Philip_Anselmo in forum Newbie
    Replies: 4
    Last Post: 9th May 2006, 23:12
  5. Refreshing QDataTable
    By zlatko in forum Qt Programming
    Replies: 5
    Last Post: 2nd May 2006, 17:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.