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. QT C++ Integration

QT C++ Integration

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 6 Posters 714 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.
  • A Offline
    A Offline
    ahiaaan
    wrote on last edited by
    #1

    I am new in this qt , I have to create an app in this semester I chose Qt for this project but tbh I do not know how to do it , I know how to do it in c++ but do not know how can i do it in qt. so could you guys please tell me what should I do to create a bank management system using qt. I have used qstackedwidget to create pages for different functionalities but now it is time to integrate the design with my c++ code . I have the source code for the bank management system as I had to create a console application in the last semester so this time I am really confused about how to do this , how can I code in this, do I have to know any qt syntaxex or is it possible that I can code in c++ in the qt creator. (I designed every page in the QT creator app using the drag and drop options. I have to use templates , multiple inheritance , inheritance and probably exceptions and also I have to save the account information in the text file . If I understand how to make the app I will try to make it even better . Is there any video or something that can teach me how to use it or is there anyone what could help me in this. I would be so grateful.

    Thank you so much.

    I want to know how to use QT and integrate the c++ code , I do not know anything about QT as I am new.

    Pl45m4P 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Qt is written in c++ so there's no problem for you to use your code likely with some tweaks to make it usable from a GUI.

      As for information, go through the Qt documentation and examples. There's already quite a lot there to get started. There's also the Qt Academy that you can check.

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

      A 1 Reply Last reply
      2
      • SGaistS SGaist

        Hi and welcome to devnet,

        Qt is written in c++ so there's no problem for you to use your code likely with some tweaks to make it usable from a GUI.

        As for information, go through the Qt documentation and examples. There's already quite a lot there to get started. There's also the Qt Academy that you can check.

        A Offline
        A Offline
        ahiaaan
        wrote on last edited by
        #3

        @SGaist Hello, So , I have to learn the qt syntaxex. and is it enough to only read the documentation and see examples ?

        Thank you so much. I thought no one would answer my question as I am new and my question might look stupid.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          As written, Qt is C++. There are some extra macros but it's not a new language. Just take your time and dive in. There's really a lot of material and examples to get started.

          Everybody here had to start at some point, don't be afraid.

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

          1 Reply Last reply
          3
          • piervalliP Offline
            piervalliP Offline
            piervalli
            wrote on last edited by
            #5

            I used tutorias of Bryan Cairns on youtube.

            https://www.youtube.com/watch?v=6KtOzh0StTc&list=PL2D1942A4688E9D63

            1 Reply Last reply
            1
            • A ahiaaan

              I am new in this qt , I have to create an app in this semester I chose Qt for this project but tbh I do not know how to do it , I know how to do it in c++ but do not know how can i do it in qt. so could you guys please tell me what should I do to create a bank management system using qt. I have used qstackedwidget to create pages for different functionalities but now it is time to integrate the design with my c++ code . I have the source code for the bank management system as I had to create a console application in the last semester so this time I am really confused about how to do this , how can I code in this, do I have to know any qt syntaxex or is it possible that I can code in c++ in the qt creator. (I designed every page in the QT creator app using the drag and drop options. I have to use templates , multiple inheritance , inheritance and probably exceptions and also I have to save the account information in the text file . If I understand how to make the app I will try to make it even better . Is there any video or something that can teach me how to use it or is there anyone what could help me in this. I would be so grateful.

              Thank you so much.

              I want to know how to use QT and integrate the c++ code , I do not know anything about QT as I am new.

              Pl45m4P Offline
              Pl45m4P Offline
              Pl45m4
              wrote on last edited by
              #6

              @ahiaaan said in QT C++ Integration:

              I want to know how to use QT and integrate the c++ code

              Like @SGaist said before, Qt is a C++ framework/collection of libraries... there is nothing "special" about it...
              ok, maybe the QObject-architecture and the MOC/UIC system... but other than that... it's just the C++ classes/modules.

              Just curious, as you are definitely not the first/only one:
              What does make you think that there is this magical "Qt"-language or whatever it might be?!

              create a bank management system using qt

              Depending on what your app should look like and do, you find examples for almost everything here (sorted by module):

              • https://doc.qt.io/qt-6/qtexamplesandtutorials.html

              Maybe there's even an example which is fitting your case and you can built upon that.

              I have the source code for the bank management system as I had to create a console application in the last semester

              If you know nothing about Qt and have an existing console application which you want to transform into a GUI app, you better start from scratch for your GUI app and probably just re-use some code snippets.
              It's even harder to migrate from console logic to a proper GUI...

              I have to create an app in this semester I chose Qt for this project

              and as this is a project for your school/university class, nobody there expects you to be a software engineer and to create the best app in the world [ I hope so :D ]


              If debugging is the process of removing software bugs, then programming must be the process of putting them in.

              ~E. W. Dijkstra

              A 1 Reply Last reply
              1
              • Pl45m4P Pl45m4

                @ahiaaan said in QT C++ Integration:

                I want to know how to use QT and integrate the c++ code

                Like @SGaist said before, Qt is a C++ framework/collection of libraries... there is nothing "special" about it...
                ok, maybe the QObject-architecture and the MOC/UIC system... but other than that... it's just the C++ classes/modules.

                Just curious, as you are definitely not the first/only one:
                What does make you think that there is this magical "Qt"-language or whatever it might be?!

                create a bank management system using qt

                Depending on what your app should look like and do, you find examples for almost everything here (sorted by module):

                • https://doc.qt.io/qt-6/qtexamplesandtutorials.html

                Maybe there's even an example which is fitting your case and you can built upon that.

                I have the source code for the bank management system as I had to create a console application in the last semester

                If you know nothing about Qt and have an existing console application which you want to transform into a GUI app, you better start from scratch for your GUI app and probably just re-use some code snippets.
                It's even harder to migrate from console logic to a proper GUI...

                I have to create an app in this semester I chose Qt for this project

                and as this is a project for your school/university class, nobody there expects you to be a software engineer and to create the best app in the world [ I hope so :D ]

                A Offline
                A Offline
                ahiaaan
                wrote on last edited by
                #7

                @Pl45m4 said in QT C++ Integration:

                Just curious, as you are definitely not the first/only one:
                What does make you think that there is this magical "Qt"-language or whatever it might be?!

                I dont know man, I am so confused about how do I integrate my c++ code in the code. and I see online that there is QString instead of string and things like that and when I try to drag and drop something there is a lot of things in the source files like If I use qwidget and then create different pages for different functionalities and want to change the page on the click of a button , I saw on the internet I have to use ui-> stackedWidget ->setCurrentIndex(int index) . I thought there would be another language . but as you told me I will follow the link and try to learn that and know the differences so that I can clear my doubts about Qt, I will just start by creating a normal app this semester and then I will try to make a better app.

                Thank you so much for your time and telling me what to do. I really appreciate it

                Pl45m4P S 2 Replies Last reply
                0
                • A ahiaaan

                  @Pl45m4 said in QT C++ Integration:

                  Just curious, as you are definitely not the first/only one:
                  What does make you think that there is this magical "Qt"-language or whatever it might be?!

                  I dont know man, I am so confused about how do I integrate my c++ code in the code. and I see online that there is QString instead of string and things like that and when I try to drag and drop something there is a lot of things in the source files like If I use qwidget and then create different pages for different functionalities and want to change the page on the click of a button , I saw on the internet I have to use ui-> stackedWidget ->setCurrentIndex(int index) . I thought there would be another language . but as you told me I will follow the link and try to learn that and know the differences so that I can clear my doubts about Qt, I will just start by creating a normal app this semester and then I will try to make a better app.

                  Thank you so much for your time and telling me what to do. I really appreciate it

                  Pl45m4P Offline
                  Pl45m4P Offline
                  Pl45m4
                  wrote on last edited by
                  #8

                  @ahiaaan said in QT C++ Integration:

                  I see online that there is QString instead of string and things like that

                  Not instead of...
                  Qt uses its own QString class which provides some nice features and blends in perfectly into the rest of Qt's API.
                  But there is nothing wrong with using std::string in your Qt app.
                  Most Qt functions will return and work with the Q.... types but you can convert them back and forth quite easily.

                  std::string foo = "HelloWorld";
                  QString moo = QString::fromStdString(foo);
                  qDebug() << moo;
                  

                  Prints:

                  "HelloWorld"
                  

                  See how QString is defined:

                  QString stores a string of 16-bit QChars, where each QChar corresponds to one UTF-16 code unit.

                  ( https://doc.qt.io/qt-6/qstring.html#details )


                  If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                  ~E. W. Dijkstra

                  1 Reply Last reply
                  0
                  • hskoglundH Online
                    hskoglundH Online
                    hskoglund
                    wrote on last edited by
                    #9

                    Qt's QString is kind of a vanguard for std::string, for example std::string now has starts_with which is inspired by QString::startsWith()

                    1 Reply Last reply
                    3
                    • hskoglundH Online
                      hskoglundH Online
                      hskoglund
                      wrote on last edited by
                      #10

                      And I see now that std::string in the upcoming c++23 standard gets the contains() boolean function, guess who has this function already...

                      1 Reply Last reply
                      3
                      • piervalliP Offline
                        piervalliP Offline
                        piervalli
                        wrote on last edited by piervalli
                        #11

                        QString is the best class in the world :-)

                        1 Reply Last reply
                        1
                        • A ahiaaan

                          @Pl45m4 said in QT C++ Integration:

                          Just curious, as you are definitely not the first/only one:
                          What does make you think that there is this magical "Qt"-language or whatever it might be?!

                          I dont know man, I am so confused about how do I integrate my c++ code in the code. and I see online that there is QString instead of string and things like that and when I try to drag and drop something there is a lot of things in the source files like If I use qwidget and then create different pages for different functionalities and want to change the page on the click of a button , I saw on the internet I have to use ui-> stackedWidget ->setCurrentIndex(int index) . I thought there would be another language . but as you told me I will follow the link and try to learn that and know the differences so that I can clear my doubts about Qt, I will just start by creating a normal app this semester and then I will try to make a better app.

                          Thank you so much for your time and telling me what to do. I really appreciate it

                          S Offline
                          S Offline
                          SimonSchroeder
                          wrote on last edited by
                          #12

                          @ahiaaan said in QT C++ Integration:

                          I saw on the internet I have to use ui-> stackedWidget ->setCurrentIndex(int index)

                          ui is a generated class from your drag&drop GUI you created. In this example it has a QStackedWidget object named stackedWidget. It is regular C++ syntax to access the member variable of ui via ui->stackedWidget. In the same way it is standard C++ to call the member function setCurrentIndex on the stacked widget. You don't have to learn a new language, but you have to learn a new library. This will happen a lot when you are programming.

                          There is one particular thing about Qt which is new, which is the signal/slot syntax. There are some bad and some old tutorials out there. Avoid using automatic connections like on_pushButton_clicked and avoid the old syntax using SIGNAL(...) and SLOT(...). This is also how you can reuse some of your old code: You want to connect signals like QPushButton::clicked to your own member function which does a specific action.

                          1 Reply Last reply
                          1
                          • A Offline
                            A Offline
                            ahiaaan
                            wrote on last edited by
                            #13

                            Thank you so much guys for all of your replies . I really got what it is.

                            1 Reply Last reply
                            0

                            • Login

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