Results 1 to 3 of 3

Thread: Problem while inserting the data into database

  1. #1
    Join Date
    Aug 2008
    Posts
    84
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Problem while inserting the data into database

    Hi,

    I am using Qt4.4 and SQLITE for database. I got a problem while inserting the data into database.While inserting continuously if I open any dialog then the entire application is breaking . I have attached my application in which it contains two buttons, one is for inserting the data continuously and another one is to open a dialog .If I click once insert button, data will keep on inserting into database ,at that time if I click on another button to open a dialog then the application breaks.
    So help me to solve this problem

    With Regards,
    Sudheer
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2008
    Posts
    142
    Thanks
    3
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem while inserting the data into database

    It looks like your application halts because you are showing a modal dialog. Try this instead:
    Qt Code:
    1. void datapro::on_pushButton_2_clicked()
    2. {
    3. dig dialod(this);
    4. dialod.show();
    5. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem while inserting the data into database

    The crash is due to the fact that for some (bad) reason you insert the adress of a local (stack!) variable into your QVector (the one in your class). That adress is invalid, when inst() is left. When you access that again, you are like to crash.

    Replace that (I seem to remember having suggested that to you in another thread) by QList<QStringList> and you are safe.

    HTH

Similar Threads

  1. problem in doing database program
    By wei243 in forum Qt Programming
    Replies: 0
    Last Post: 4th April 2007, 12:01
  2. Oracle Database Problem
    By magikalpnoi in forum Qt Programming
    Replies: 3
    Last Post: 27th September 2006, 21:19
  3. Problem inserting in QTableWidget
    By DPinLV in forum Qt Programming
    Replies: 2
    Last Post: 2nd August 2006, 00:10
  4. Replies: 16
    Last Post: 7th March 2006, 15:57
  5. Problem with inserting text into QTextEdit
    By xorrr in forum Qt Programming
    Replies: 0
    Last Post: 6th February 2006, 11:45

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.