Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Newbie at Qt looking for some advice
QtWS25 Last Chance

Newbie at Qt looking for some advice

Scheduled Pinned Locked Moved Unsolved General and Desktop
newbiehelpc++qtcreator
23 Posts 7 Posters 8.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    joeshmo
    wrote on 17 Nov 2015, 17:19 last edited by joeshmo
    #1

    Hi everyone,

    I have started using Qt and C++ quite recently in order to complete my project for my final year of computing at college. As I am new, I am a bit unsure on what I can do, cant do and sometimes how to do it.

    I am using Qt creator and, at the moment, SQLite Manager as I need to use a database in my project but don't have MS access.

    I don't have any examples, but I was wondering if anyone may be able to answer some of my questions, or could show me where to go in order to find the answers I need.

    Any help with either SQLite or Qt would be very much appreciated!

    Thanks very much!

    A L 2 Replies Last reply 17 Nov 2015, 17:24
    0
    • J joeshmo
      17 Nov 2015, 17:19

      Hi everyone,

      I have started using Qt and C++ quite recently in order to complete my project for my final year of computing at college. As I am new, I am a bit unsure on what I can do, cant do and sometimes how to do it.

      I am using Qt creator and, at the moment, SQLite Manager as I need to use a database in my project but don't have MS access.

      I don't have any examples, but I was wondering if anyone may be able to answer some of my questions, or could show me where to go in order to find the answers I need.

      Any help with either SQLite or Qt would be very much appreciated!

      Thanks very much!

      A Offline
      A Offline
      asif_cse
      wrote on 17 Nov 2015, 17:24 last edited by
      #2

      @joeshmo
      I am also a newbie, and working with qt around three weeks. I am following tutorials on youtube!

      J 1 Reply Last reply 17 Nov 2015, 17:29
      0
      • A asif_cse
        17 Nov 2015, 17:24

        @joeshmo
        I am also a newbie, and working with qt around three weeks. I am following tutorials on youtube!

        J Offline
        J Offline
        joeshmo
        wrote on 17 Nov 2015, 17:29 last edited by
        #3

        @asif_cse cool, any chance you could suggest which ones?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 17 Nov 2015, 22:57 last edited by
          #4

          Hi and welcome to devnet,

          For Qt + SQLite, you can take a look at Qt's documentation, examples and demos more specifically the Qt Sql module and the SQL Programming chapter. You already have there a valuable source of information to get started.

          For other questions, you should be more specific e.g. what's your project purpose, your application purpose etc.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          J 1 Reply Last reply 18 Nov 2015, 10:55
          0
          • T Offline
            T Offline
            TheBadger
            wrote on 18 Nov 2015, 05:17 last edited by
            #5

            For a more powerful database consider PostgreSQL or MySQL, both are free and Qt have drivers for both. For simple databases SQLite is good enough.

            I recently stumbled upon this youtube channel, perhaps you will find some useful tutorials there.


            Check out my SpellChecker Plugin for Qt Creator @ https://github.com/CJCombrink/SpellChecker-Plugin

            J 1 Reply Last reply 18 Nov 2015, 10:44
            0
            • T TheBadger
              18 Nov 2015, 05:17

              For a more powerful database consider PostgreSQL or MySQL, both are free and Qt have drivers for both. For simple databases SQLite is good enough.

              I recently stumbled upon this youtube channel, perhaps you will find some useful tutorials there.

              J Offline
              J Offline
              joeshmo
              wrote on 18 Nov 2015, 10:44 last edited by
              #6

              @TheBadger
              Thanks, I've found the same channel and think he's pretty good.

              Thanks for the recommendations, I'll check them out.
              I would like to link tables in relationships (1 to many etc) like in access, are the 2 you suggested able to do this?

              T 1 Reply Last reply 18 Nov 2015, 10:51
              0
              • J joeshmo
                18 Nov 2015, 10:44

                @TheBadger
                Thanks, I've found the same channel and think he's pretty good.

                Thanks for the recommendations, I'll check them out.
                I would like to link tables in relationships (1 to many etc) like in access, are the 2 you suggested able to do this?

                T Offline
                T Offline
                TheBadger
                wrote on 18 Nov 2015, 10:51 last edited by
                #7

                @joeshmo said:

                I would like to link tables in relationships (1 to many etc) like in access

                Both are relational databases so if I understand your requirement correctly then yes both should be able to work.

                I prefer PostgreSQL but only because I have much more experience with it.

                I do not have experience with access (at least can't remember anything about access)


                Check out my SpellChecker Plugin for Qt Creator @ https://github.com/CJCombrink/SpellChecker-Plugin

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 18 Nov 2015, 10:54 last edited by
                  #8

                  If you don't need a centralized database server I would suggest to use SQLite as it is much easier to use (no need to set up a database server).

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • S SGaist
                    17 Nov 2015, 22:57

                    Hi and welcome to devnet,

                    For Qt + SQLite, you can take a look at Qt's documentation, examples and demos more specifically the Qt Sql module and the SQL Programming chapter. You already have there a valuable source of information to get started.

                    For other questions, you should be more specific e.g. what's your project purpose, your application purpose etc.

                    J Offline
                    J Offline
                    joeshmo
                    wrote on 18 Nov 2015, 10:55 last edited by
                    #9

                    @SGaist Thanks for the link, will check it out!

                    In terms of being mroe specific I would like to be able to have a database with tables linked in 1 to many. From this, in Qt, I would like to be able to create records of the many database tied to the information in the 1 database.

                    If this is clearer, is this something I can realistically achieve?

                    M 1 Reply Last reply 18 Nov 2015, 21:06
                    0
                    • J joeshmo
                      18 Nov 2015, 10:55

                      @SGaist Thanks for the link, will check it out!

                      In terms of being mroe specific I would like to be able to have a database with tables linked in 1 to many. From this, in Qt, I would like to be able to create records of the many database tied to the information in the 1 database.

                      If this is clearer, is this something I can realistically achieve?

                      M Offline
                      M Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on 18 Nov 2015, 21:06 last edited by
                      #10

                      @joeshmo said:
                      Hi Could you try to tell a bit about what project is
                      and what the info represent and how info will be
                      tied to other info?

                      While creating links between different tables in same DB, is easy,
                      creating links between different tables in different databases are pretty advanced and
                      I do wonder what you are trying to do.

                      So if you forget a moment about databases and tell us that project is about and what it will do, then you are much more likely to get real good advice from all the clever people here :)

                      J 1 Reply Last reply 19 Nov 2015, 17:55
                      0
                      • M mrjj
                        18 Nov 2015, 21:06

                        @joeshmo said:
                        Hi Could you try to tell a bit about what project is
                        and what the info represent and how info will be
                        tied to other info?

                        While creating links between different tables in same DB, is easy,
                        creating links between different tables in different databases are pretty advanced and
                        I do wonder what you are trying to do.

                        So if you forget a moment about databases and tell us that project is about and what it will do, then you are much more likely to get real good advice from all the clever people here :)

                        J Offline
                        J Offline
                        joeshmo
                        wrote on 19 Nov 2015, 17:55 last edited by joeshmo
                        #11

                        Hi @mrjj , thanks for offering to help!

                        My project is to create a program that will allow the heads of faculty to easier write reviews for the members of staff they supervise (usually 8 members of staff). The reviews are Quality Assurance and lesson observations (I can just work on 1 for the time being, and add the other if it works well and I have time). I am making this so that the reviews can be easily written, viewed and edited in the same program so they cannot get lost.

                        Both the reviews are usually written on a template printed off which has fields that need filling in to make sure the review covers what the school want it to.

                        (I will only talk about the observation review, as I can focus on the other after I have this one completed)

                        So far I have thought that having a table with the fields needed to be filled in for each lesson observation such as focus of the lesson, evidence of this context etc.

                        Over all, heads of faculty can add, edit, remove or select members of staff from the program and then write reviews (observation or QA) for the member of staff following the template that I will implement into the GUI (labels, etc). The reviews will then be able to be opened later and edited or just to be viewed from the same program. The program should also be able to show information about each member of staff the head of faculty supervises such as teacher code, name etc.

                        Hope this makes sense, I am more than happy to clear up any confusion as to specific parts, or talk about how the database may work, as I wrote this quite quickly!

                        Thanks very much!

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on 19 Nov 2015, 18:33 last edited by mrjj
                          #12

                          hi, its pretty good description.
                          One important question is.
                          Will more than one "head" make reviews at the same time ?
                          That is - multiple copies of the program run on different computers and access and change that
                          data at the same time?
                          If yes, you (might) need a database server.

                          How good are you with SQL ? (if I may ask)

                          J 1 Reply Last reply 19 Nov 2015, 21:59
                          0
                          • M mrjj
                            19 Nov 2015, 18:33

                            hi, its pretty good description.
                            One important question is.
                            Will more than one "head" make reviews at the same time ?
                            That is - multiple copies of the program run on different computers and access and change that
                            data at the same time?
                            If yes, you (might) need a database server.

                            How good are you with SQL ? (if I may ask)

                            J Offline
                            J Offline
                            joeshmo
                            wrote on 19 Nov 2015, 21:59 last edited by
                            #13

                            Hi,

                            The was I was planning it is that it would be 1 "head" per computer. This means the program will not be pre-made, as such, with any information in it and the "head" will fill in the information for the members of staff they supervise the first time they open the program. Because of this, each head will have a the same program on their computer but they will not share data and will each be filled in with different members of staff's information.

                            In the class we briefly touched on some SQL , probably very basic stuff, so I'm quite new to that as well. I made notes on it, and I'm sure there will be some tutorials out there somewhere I can use but I wouldn't say I'm confident.

                            As an extra, I finally got my head around why I would like the tables to be linked relationally:
                            1 member of staff record (parent) will be linked to all observation/QA records on separate (child) tables that involve them so. This hopefully makes sense, but we can cross that bridge in a bit.

                            I really appreciate your willing to help me, as I am at quite a confused loss!

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 19 Nov 2015, 23:04 last edited by
                              #14

                              Doing so you are going to run into data duplication (e.g. multiple copies of the same user with all the problems that come with entering the same names multiple times) and also problem of synchronization, retrieval of data etc.

                              Even if it's not the easiest path, you should consider the use of a SQL server (PostgreSQL, MySQL or MariaDB) It's not overly complicated to setup though.

                              If you have one at hand, you should talk with a DB admin, he can help you get the database schema correctly.

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              J 1 Reply Last reply 20 Nov 2015, 11:50
                              0
                              • S SGaist
                                19 Nov 2015, 23:04

                                Doing so you are going to run into data duplication (e.g. multiple copies of the same user with all the problems that come with entering the same names multiple times) and also problem of synchronization, retrieval of data etc.

                                Even if it's not the easiest path, you should consider the use of a SQL server (PostgreSQL, MySQL or MariaDB) It's not overly complicated to setup though.

                                If you have one at hand, you should talk with a DB admin, he can help you get the database schema correctly.

                                J Offline
                                J Offline
                                joeshmo
                                wrote on 20 Nov 2015, 11:50 last edited by
                                #15

                                @SGaist Thanks for the suggestions.

                                My program will not have Head of faculty information stored, so will only be teacher information and observation records. Because of this, I hopefully will result in 1 user per instance of the program and (if I understand your previous comment correctly, sorry if I didn't) then does not have any of the problems you mentioned.

                                I'm starting to understand what I will need to do for the project, but I'm still not confident.

                                I would like to make a start and see where it gets me so I will use ms access instead of SQLite manager, but cannot find how to link Qt to the access database. I keep hearing about the ODBC driver, but that means nothing to me. Any chance you know a good explanation for this you could send me?

                                Thanks very much!

                                1 Reply Last reply
                                0
                                • M Offline
                                  M Offline
                                  mrjj
                                  Lifetime Qt Champion
                                  wrote on 20 Nov 2015, 15:33 last edited by mrjj
                                  #16

                                  Hi.
                                  If you are really really sure the heads do not expect to share staff info and
                                  the project is a personal tool for each and no reports is shared then you can
                                  make it a single user app. but beware of all what @SGaist mentions as you will get
                                  these problems if the heads try to share any of the data.

                                  Before digging into what data base to use. May I suggest you write up all
                                  information you wish to record. spend some time thinking about what you need to store.
                                  write it all up. You are going to need this a lot for creating the database. so
                                  don't start coding before you have full list of what data.

                                  ODBC driver.
                                  This is a common driver that give the same set of functions to talk to a database system.
                                  Normally, each system has its on functions. BUt if it support ODBC, it means its
                                  able to be handled the same regardless of the actual database.
                                  https://en.wikipedia.org/wiki/Open_Database_Connectivity

                                  Last time i used ACCESS database, it was very slow over network.

                                  So find out if you want single user or multiuser.
                                  then choose DB system.
                                  Most likely the heads expects to share staff info.
                                  So multi user. and u need something like PostgreSQL

                                  J 1 Reply Last reply 20 Nov 2015, 17:26
                                  0
                                  • M mrjj
                                    20 Nov 2015, 15:33

                                    Hi.
                                    If you are really really sure the heads do not expect to share staff info and
                                    the project is a personal tool for each and no reports is shared then you can
                                    make it a single user app. but beware of all what @SGaist mentions as you will get
                                    these problems if the heads try to share any of the data.

                                    Before digging into what data base to use. May I suggest you write up all
                                    information you wish to record. spend some time thinking about what you need to store.
                                    write it all up. You are going to need this a lot for creating the database. so
                                    don't start coding before you have full list of what data.

                                    ODBC driver.
                                    This is a common driver that give the same set of functions to talk to a database system.
                                    Normally, each system has its on functions. BUt if it support ODBC, it means its
                                    able to be handled the same regardless of the actual database.
                                    https://en.wikipedia.org/wiki/Open_Database_Connectivity

                                    Last time i used ACCESS database, it was very slow over network.

                                    So find out if you want single user or multiuser.
                                    then choose DB system.
                                    Most likely the heads expects to share staff info.
                                    So multi user. and u need something like PostgreSQL

                                    J Offline
                                    J Offline
                                    joeshmo
                                    wrote on 20 Nov 2015, 17:26 last edited by
                                    #17

                                    @mrjj That makes a lot of sense, thanks :)

                                    Is it possible for the data to be printed, ie the whole gui page showing the reviews to be printed?

                                    If not, then I will probably look into the PostgreSQL and making the program multi user

                                    In regards to the information I want to record, I have already done that for the teacher info, Observations and QA just incase I am going to use both. Because of this, I am quite ready to start coding, but thanks for checking that I had that :)

                                    Any idea where I should start looking if I want to use PostgreSQL and can that link tables relationally?

                                    (Sorry if I'm sounding a bit obsessed with linking tables!)

                                    Thank you all very much!

                                    M 1 Reply Last reply 20 Nov 2015, 17:37
                                    0
                                    • J joeshmo
                                      20 Nov 2015, 17:26

                                      @mrjj That makes a lot of sense, thanks :)

                                      Is it possible for the data to be printed, ie the whole gui page showing the reviews to be printed?

                                      If not, then I will probably look into the PostgreSQL and making the program multi user

                                      In regards to the information I want to record, I have already done that for the teacher info, Observations and QA just incase I am going to use both. Because of this, I am quite ready to start coding, but thanks for checking that I had that :)

                                      Any idea where I should start looking if I want to use PostgreSQL and can that link tables relationally?

                                      (Sorry if I'm sounding a bit obsessed with linking tables!)

                                      Thank you all very much!

                                      M Offline
                                      M Offline
                                      mrjj
                                      Lifetime Qt Champion
                                      wrote on 20 Nov 2015, 17:37 last edited by
                                      #18

                                      @joeshmo
                                      1: Is it possible for the data to be printed, ie the whole gui page showing the reviews to be printed?
                                      well yes, you can render controls to a paper page but normally you would create a pdf or
                                      print out the data in some other way. like a report.
                                      Else print will be like a screenshot. But possible.

                                      2: Any idea where I should start looking if I want to use PostgreSQL and can that link tables relationally?
                                      this is good first start
                                      https://forum.qt.io/topic/33926/postgresql-and-trying-to-connect-using-qt/20
                                      Note: version are bit older, so adjust names.
                                      and also
                                      https://www.youtube.com/watch?v=3XE2bKUAxfw

                                      3:(Sorry if I'm sounding a bit obsessed with linking tables!)
                                      Its ok. you will need that a lot.
                                      When you reference something from one table to another you use
                                      keys. that is your linking.
                                      http://www.tutorialspoint.com/sql/sql-foreign-key.htm

                                      How much time do you have for the project?

                                      J 1 Reply Last reply 21 Nov 2015, 19:16
                                      0
                                      • M mrjj
                                        20 Nov 2015, 17:37

                                        @joeshmo
                                        1: Is it possible for the data to be printed, ie the whole gui page showing the reviews to be printed?
                                        well yes, you can render controls to a paper page but normally you would create a pdf or
                                        print out the data in some other way. like a report.
                                        Else print will be like a screenshot. But possible.

                                        2: Any idea where I should start looking if I want to use PostgreSQL and can that link tables relationally?
                                        this is good first start
                                        https://forum.qt.io/topic/33926/postgresql-and-trying-to-connect-using-qt/20
                                        Note: version are bit older, so adjust names.
                                        and also
                                        https://www.youtube.com/watch?v=3XE2bKUAxfw

                                        3:(Sorry if I'm sounding a bit obsessed with linking tables!)
                                        Its ok. you will need that a lot.
                                        When you reference something from one table to another you use
                                        keys. that is your linking.
                                        http://www.tutorialspoint.com/sql/sql-foreign-key.htm

                                        How much time do you have for the project?

                                        J Offline
                                        J Offline
                                        joeshmo
                                        wrote on 21 Nov 2015, 19:16 last edited by joeshmo
                                        #19

                                        @mrjj I have until about easter time 2016 for the project to be completed.

                                        I have written work relating to the project too, so it does not need to be top of the range, just something that is easy to navigate and does what I want it to do.

                                        M 1 Reply Last reply 21 Nov 2015, 19:48
                                        0
                                        • J joeshmo
                                          21 Nov 2015, 19:16

                                          @mrjj I have until about easter time 2016 for the project to be completed.

                                          I have written work relating to the project too, so it does not need to be top of the range, just something that is easy to navigate and does what I want it to do.

                                          M Offline
                                          M Offline
                                          mrjj
                                          Lifetime Qt Champion
                                          wrote on 21 Nov 2015, 19:48 last edited by
                                          #20

                                          @joeshmo
                                          Ok. well you should have time to make it multi user if needed then.

                                          If the project are really going to be used multiuser,you need a pc that can act as server.

                                          Have you considered a web service instead of qt client application. ?
                                          something like
                                          https://www.djangoproject.com/start/overview/

                                          If you really need to make it a real multi user app.
                                          That way maintenance etc is lighter.

                                          1 Reply Last reply
                                          0

                                          7/23

                                          18 Nov 2015, 10:51

                                          topic:navigator.unread, 16
                                          • Login

                                          • Login or register to search.
                                          7 out of 23
                                          • First post
                                            7/23
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved