A database app

  • Hi,

    It will be the first time I'm going to be familiar with creating a database app. (If I'm correct by calling it this way!)

    I'm trying to practice this section of that book, the Adapting Data section without the proxy part of it.

    What kind of project (classes and templates) should I use for making the example work please?

  • Moderators


    I suggest that you have a look to the SQL examples as part of Qt distrbutions. Since they are typically ready for direct use, you can start with them and adapt to examples, if you still have the desire to do so.

  • @tomy
    I would prefer you to refer the book examples itself, there you will get step by step database control flow.

  • Qt Champions 2017

    I can highly recommend
    for looking into the db, running sql on it and learn sqlite.

  • @Venkatesh-V maybe I'm wrong but it looks there's no examples for

    I'm trying to practice this section of that book

    have you tried them yourself?

  • @koahnig
    They are too advanced, not good for a beginner of that. But thanks. By the way, it doesn't show what template/classes are to be used.

  • Qt Champions 2017

    You can just use a default widget GUI project.
    The samples are just fragments. Not complete samples. Just shows how to hook
    up model to a view.
    To learn more, read docs for each class

    QSqlDatabase db

  • @tomy and what about reading this SQL programming guide from Qt?

  • @mrjj
    It seems great but I don't want to go into the details to the DB world. It seems also advanced. I wanted to have a simple db program, or better to say, I just want to practice the example of the book. I'm not interested in db, at east, for now. And since it's part of that book I wanted that.
    Now if possible please tell me the kind of project for the book's example. Would Qt Widgets Applications be right to use for that.

    By the way, I will read the link properly. I may need it for the program I'm involving it (spreadsheet).

  • I appreciate all of you, but for this step, I'd like to make the example of the book run. And follow the book. Thanks.

  • Qt Champions 2017

    @tomy said in A database app:

    a simple db program

    Well unless you know what a table is, SQL and a little bit of db structure, its not going to be fun.
    If you dont want to learn about DB, there is no reason to read about Qt DB classes.
    They help you do DB stuff and if you skip that part, it best just to skip it all.

  • @mrjj

    If you dont want to learn about DB, there is no reason to read about Qt DB classes.

    I don't want to say I don't like to learn DB, because I will certainly need it in near/far future. what I say is "at this stage", or for this time.
    first I need to learn how to run the example (I pointed to at my first post of this thread) and follow the book and some time latter start reading about DB. I'm sure those links offered here are very useful.

  • Qt Champions 2017


    ok. but unless you make a table with data, it will be impossible to see if it works as nothing would be shown. :)

    Also , those samples are incomplete as it seems to be from some other part.
    the variables are not defined there, only shown so there will be extra work to make it run
    unless there is the rest of it.

  • OK and thank you. So I skip that section.

  • @tomy Please don't forget to mark your post as "Solved" if you're done with the DB topic...

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.