Yes you are confused becasue you don't know C++.
But we can't help you with that, or at least, I don't have the time for it.
Yes you are confused becasue you don't know C++.
But we can't help you with that, or at least, I don't have the time for it.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
So I have to work at classes subject in my book...Maybe I'll understand...
That is a good way to go about it.
You can ask specifc C++ questions that you don't understand in the General Programming section in this forum.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
And one more thing, in one of examples in C++ GUI Programming book, form was created by designer and one of command was groupBox->hide(); and it worked
what is the question?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
This is access to GUI element, as you said. My code (subclassing) looks almost the same, and it doesn't work, because I have wrong GUI element access.
p.s.
I changed contents of my main.cpp file (it was wrong code in it) and it works.
edit. I mean that it doesn't crash, window is displayed but with no functionality. If I added ui. prefix in refering to GUI element would it be ok?
yes - but then you will stumble on the next error, and you wont understand why.
This is no way to learn C++.
Do it properly from the start.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Sure, I'll read classes chapter in C++ Symphony (Symfonia C++)
But there still is a problem. I added .ui prefix in every reference to gui element e.g. ui.convertButton->hide(); instead of convertButton->hide(); But it still doesn't have functionality. Did I miss something?
Which is exactlxy what I said in my last post:But there still is a problem.
yes - but then you will stumble on the next error, and you wont understand why.
This is no way to learn C++.
Do it properly from the start.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Of course, you're right
![]()
Now I understand why do we have to use .ui prefix. Because in main cpp before creating dialog we define Ui:ialog ui; where ui is a variable of the class in which is setupUi so that we have to call ui prefix to refer content of setupUi class. Is that right?
Debugging an application that crashes on startup is more difficult with designer ui modules than when you make the forms yourself. The designer generates a lot of MOC able code that gets compiled.
When you are just starting to learn Qt (or C++ for that matter) you may be better off learning how to manually construct the form first (using the examples and tutorials in Qt). Make the smallest runnable code changes that compile clean. For instance, just make a form that has a group box or frame on it. When you get that small amount of code to work, then add other controls to the working code one at a time.
In this way you narrow the search for the bugs to just the code you added. It is much easier to debug a few lines of code than several hundred generated by the designer. Especially when you don't understand what it all does.
Hope this helps.
Sure, but one can safely assume that the code generated by the Designer is OK (which in fact means that you have less code to debug, if you use Designer). Although one shouldn't use a code generator, if he doesn't understand the generated code, so you are right, that it's better to start with learning how to create GUI in code.
Bookmarks