Nominate our 2022 Qt Champions!

Looking for direction in data-management and QSql

  • Well so this is my first post in this place, after finally deciding to sign up for an account.

    I want to appologize in advance, in case I post this under the wrong topic or part of the forum. If so I would be glad for some direction and advice where to post questions like the following in the future.

    Recently I've started to work with C++ and found QT to be a handy solution to create a GUI, so now I'm trying to create something like a frontend-application for an SQL-Database System. I'm aiming to create an application so the user doesnt have to worry about how to string the SQL-commands together for new entries, or later on, queries. So far I've managed to establish a connection to the SQL-Database using QT and to read and insert some data.

    My actual question now is, where I can find some guidelines for handling data in C++ programing (preferably utilizing QT). For one general principles how to do this would be a great help, especially since I want to call various QT-forms and how to manage the data between those. Maybe to make it more clear where my problems hail from, would it be smart to define a list of my data-class in the MainWindow and pass it to forms that are going to be called later during the runtime by the user?

    As a matter of fact I do feel quite amateurish about those questions, but after trying to do some research on google and the forums I mostly got some examples for classes to manage data, but not how I do this smartly between different forms within a (more complex) program.

    I hope I got a general idea of what my problem is across and havent left those reading this with pure confusion. Again basically I'm just looking for a directions like links where I could start and that might help with my problem!

    Thanks in advance!

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    There are several concepts that might be involved in your question. Do you want to pass data from one form to the other like e.g. application settings ? Do you want to model your database table into object (i.e. DAO) ?

  • @SGaist Well since I'm still learning an overview over those different concepts would be quite helpful (if there is a "simple" overview available). The second part comes close to it though, I plan to make a class to hold my data and want to pass it between different forms. I have difficulties to organize and structur my program, but I gues that is a whole different problem to begin with.

    Gues I will do some more reading and try to make my problem more clear and the concept that might be involved.

    Thanks for the response though.

Log in to reply