Results 1 to 20 of 57

Thread: Record update windowd entered data saving

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Record update windowd entered data saving

    Quote Originally Posted by wysota
    Qt Code:
    1. rec.setValue("id", lineedit1->text());
    2. rec.setValue("name", lineedit2->text());
    3. rec.setValue("address", lineedit3->text());
    4.  
    5. //...
    6. model->insertRecord(-1, rec);
    To copy to clipboard, switch view to plain text mode 
    Ok, but how does Qt knows which table write to? Or, if i change the name of field with sql administrator, how to handle that kind of changes?
    Qt 5.3 Opensource & Creator 3.1.2

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

    Default Re: Record update windowd entered data saving

    Well your model knows. Don't they ?
    Your model1 should be some what like this
    Qt Code:
    1. model->setTable("employee");
    To copy to clipboard, switch view to plain text mode 
    We can't solve problems by using the same kind of thinking we used when we created them

  3. The following user says thank you to sunil.thaha for this useful post:

    fnmblot (1st August 2006)

  4. #3
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Record update windowd entered data saving

    Quote Originally Posted by sunil.thaha
    Well your model knows. Don't they ?
    Your model1 should be some what like this
    Qt Code:
    1. model->setTable("employee");
    To copy to clipboard, switch view to plain text mode 
    Ahaaaam, there is a connection, I see now. Thank you.
    Qt 5.3 Opensource & Creator 3.1.2

  5. The following user says thank you to MarkoSan for this useful post:

    fnmblot (1st August 2006)

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.