QT C++ Integration
-
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.
-
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.
-
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.
-
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.
-
I used tutorias of Bryan Cairns on youtube.
https://www.youtube.com/watch?v=6KtOzh0StTc&list=PL2D1942A4688E9D63
-
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.
@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 theQObject
-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):
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 ]
-
@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 theQObject
-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):
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 ]
@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
-
@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
@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 ownQString
class which provides some nice features and blends in perfectly into the rest of Qt's API.
But there is nothing wrong with usingstd::string
in your Qt app.
Most Qt functions will return and work with theQ....
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.
-
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()
-
@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
@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 namedstackedWidget
. It is regular C++ syntax to access the member variable ofui
viaui->stackedWidget
. In the same way it is standard C++ to call the member functionsetCurrentIndex
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 usingSIGNAL(...)
andSLOT(...)
. This is also how you can reuse some of your old code: You want toconnect
signals likeQPushButton::clicked
to your own member function which does a specific action.