Qt Tutorial 2 : C++ Calculator

Поделиться
HTML-код
  • Опубликовано: 15 сен 2024
  • Get the Code : bit.ly/qt-tut2
    Best Qt Book : amzn.to/2KvFTsQ
    / derekbanas
    MY UDEMY COURSES ARE 87.5% OFF TIL January 16th ($9.99) One is FREE
    ➡️ Python Data Science Series for $9.99 : Highest Rated & Largest Python Udemy Course + 56 Hrs + 200 Videos + Data Science bit.ly/Master_...
    ➡️ C++ Programming Bootcamp Series for $9.99 : Over 23 Hrs + 53 Videos + Quizzes + Graded Assignments + New Videos Every Month bit.ly/C_Cours...
    ➡️ FREE 15 hour Golang Course!!! : bit.ly/go-tuto... (100 Available)
    The most requested next C++ app you guys asked for was a calculator, so here it is. We'll make a C++ GUI Calculator app in one video. Along the way we'll learn a lot! We'll cover a topic which confuses many people which is how to setup event handling with Signals and Slots. We'll also cover how to work with widgets in many ways, setting up an interface, stylesheets, casting, regular expressions and much more.
    Brought to you thanks to contributions from my Patreon subscribers such as perl6.org/

Комментарии • 259

  • @sebastianschimper5556
    @sebastianschimper5556 3 года назад +49

    In case anyone is following the tutorial with Qt6: QRegExp is depreciated. To spare you a look in the documentation, the interior of the "CangeNumberSign()" function can be re-written as follows:
    #include
    // [...]
    void Calculator::ChangeNumberSign() {
    QString displayVal = ui->Display->text();
    QRegularExpression reg("[-]?[0-9.]*");
    QRegularExpressionMatch match = reg.match(displayVal);
    if(match.hasMatch()) {
    double dblDisplayVal = displayVal.toDouble();
    double dblDisplayValSign = -1 * dblDisplayVal;
    ui->Display->setText(QString::number(dblDisplayValSign));
    }
    }

  • @ikramjmouhi4036
    @ikramjmouhi4036 Год назад +1

    in case someone needs the other functions here's how I did it :
    void Calculator::Memoire()
    {
    QString displayVal = ui->Display->text();
    MemoireVal = displayVal.toDouble();
    ui->Display->setText("");
    }
    void Calculator::MemoireCall()
    {
    ui->Display->setText(QString::number(MemoireVal));
    }
    void Calculator::MemoireClear()
    {
    MemoireVal = 0.0;
    }
    void Calculator::Clear()
    {
    ui->Display->setText("");
    }

  • @samweiss3248
    @samweiss3248 5 лет назад +5

    Hi Derek. Thanks for the helpful tutorial. For whomever it may help, I found a couple of bugs. First, numbers are tacked onto the end of the current display when number buttons are pressed. This is a problem once the display switches over to scientific notation. The numbers get appended to the exponent instead of the main number. This can easily be fixed by getting rid of newVal in the NumPressed method and replacing dblNewVal with "double dblNewVal = displayVal.toDouble() * 10 + butVal.toDouble();". So basically, you multiply the current display by 10 and add it to the currently entered digit. The second bug is that your regex excludes scientific notation numbers from being negated. Perhaps I am missing something, but it looks like there is no need for a regex at all. All of the input is limited to what you can press on the calculator, so regex seems like overkill. Maybe just get rid of the regex in ChangeNumberSign and replace the condition of the if statement with "QString::compare(displayVal, "") != 0". This way, if the +/- sign is pressed in between operations (when the screen is blank), nothing will happen to the sign. Also the setText call in the same method should use the 'g' flag again to switch to scientific notation after 16 digits.

  • @lekjov6170
    @lekjov6170 6 лет назад +3

    Thanks for everything you do and the time you spend on helping us. As someone whose main language is not English I can say that your voice is so unique that it can be understood perfectly without subtitles. Keep it up and wish you the best!

    • @derekbanas
      @derekbanas  6 лет назад +1

      Thank you very much :) That is great to know that so many people find these helpful

  • @akira1228
    @akira1228 6 лет назад +8

    At last, QT Tutorial, that's what I've waited for ages. Thank You :)

    • @derekbanas
      @derekbanas  6 лет назад +2

      I hope you find it useful :)

    • @KwabenaAmoah-ce3qj
      @KwabenaAmoah-ce3qj 2 месяца назад

      Hi can you teach me how he added button 7,0 1,3,4..

  • @kenfuciusfpv2800
    @kenfuciusfpv2800 5 лет назад +23

    Derek, I can sit down and do these things, but my biggest blocker is I never have the environment setup right. Can you go over some "how to setup your environment in one video" lessons, and maybe do it for several environments (pycharm, several C++ free environments, setting up one with maybe other editors like that popular one, sublime text, maybe one for Mac vs Windows users. These environment setups really stop me from doing a lot.) Thanks!

    • @huzaifaimran9468
      @huzaifaimran9468 4 года назад

      I too had this problem man
      Here's the link to a demo video
      ruclips.net/video/i_ONRqKLfQs/видео.html

  • @rodrigodasilva8404
    @rodrigodasilva8404 6 лет назад +44

    Some times I think. How can he knows all this things? Would you make a video teaching how to learn better?

    • @derekbanas
      @derekbanas  6 лет назад +33

      I'm working on it. It is a matter of having the right tools and breaking learning up into bite sized pieces through out the day

    • @amirhassan6549
      @amirhassan6549 3 года назад +1

      @@derekbanas Qt has a lot of things in his documentation.

    • @YoungMesrine
      @YoungMesrine 3 года назад +1

      @@amirhassan6549 too much things for real, they should show us the technics they use.

  • @chrisschick6054
    @chrisschick6054 6 лет назад +1

    (5 calculations into testing the app...) "THIS CALCULATOR HAS NO DECIMAL!!!" Super fun tutorial, can't wait to Qt it up some more.

    • @derekbanas
      @derekbanas  6 лет назад +1

      That's funny :) Either way I'm happy you liked it

  • @davidthompson3876
    @davidthompson3876 4 года назад +1

    The speed is just right. Thanks for a really great tutorial.

  • @zdspider6778
    @zdspider6778 5 месяцев назад

    Such a deceptively simple concept, _a calculator._ But you learn SO MUCH by adding functionality to it. Like period support, backspace support, keyboard input support (hint: the "*" and "/" keys are called "Qt::Key::Key_Asterisk" and "Qt::Key::Key_Slash", not "Qt::Key::Key_division" and "Qt::Key::Key_multiply").

  • @zdspider6778
    @zdspider6778 5 месяцев назад

    Thank you! This was incredibly educational.
    21:54 That 'if' condition doesn't make any sense. Because ".toDouble()" gives you a 'double'. Don't compare it to an 'int'. Both conditions are identical.
    27:09 "Qt::CaseInsensitive" seems unnecessary since there's no uppercase or lowercase there. Those are symbols.
    31:11 Don't just blindly divide... Check if you're dividing by zero first! I'm surprised it doesn't crash. Qt must be catching exceptions under the hood.

  • @adriengrzesiak598
    @adriengrzesiak598 3 года назад +1

    Really nice packaged tutorial. I'm being enjoying a lot of your other tutorials in C++. Thank you Derek.

  • @pijusmankus6838
    @pijusmankus6838 4 года назад +6

    I might be add some ClearButton function like:
    void colculator::on_Clear_clicked()
    {
    ui->Display->setText("0.0");
    }

    • @Vitonolable
      @Vitonolable 8 месяцев назад

      my version is:
      void Calculator::on_btn_Clear_released()
      {
      double calcVal = 0.0;
      ui->Display->setText("");
      }

  • @vivek3861
    @vivek3861 6 лет назад +8

    Best channel on RUclips and great teacher.......

    • @derekbanas
      @derekbanas  6 лет назад +2

      Thank you for the nice compliment :)

    • @skd1860
      @skd1860 6 лет назад +2

      Make tutorials on ai.

    • @derekbanas
      @derekbanas  6 лет назад +2

      I'm working on it

    • @developerninja619
      @developerninja619 4 года назад

      @@derekbanas can you please tell me is Qt good for mobile (I mean both Android and iOS) development?

  • @brock2k1
    @brock2k1 5 лет назад

    Spent hours trying to find out how to do some stuff before I found the answer here. Great video, thank you.

    • @derekbanas
      @derekbanas  5 лет назад

      Thank you :) I'm happy I could help

  • @cluelesssimmer5856
    @cluelesssimmer5856 3 года назад

    i've just started to learn C++ and QT. immensly helpful video. thank you

  • @arminized3210
    @arminized3210 6 лет назад +10

    thanks for this good tutorial.

    • @derekbanas
      @derekbanas  6 лет назад +1

      Thank you for watching it :)

  • @harikrishnanb.a.628
    @harikrishnanb.a.628 4 года назад +1

    Sir, your videos give learners a perfect headstart. Expecting more videos...

  • @dildgemckenzie8597
    @dildgemckenzie8597 6 лет назад +1

    This great Derek. Real use applications and learning.

    • @derekbanas
      @derekbanas  6 лет назад +1

      Thank you :) Many more are coming

  • @russellmcnamara6107
    @russellmcnamara6107 6 лет назад

    Derek I have been in jail for about a year and just got out I thought of you and your videos every single day I was in jail you are an inspiration to me everything about your videos is amazing

    • @derekbanas
      @derekbanas  6 лет назад +1

      Thank you very much :) I wish you all the best for your future

  • @revtube9294
    @revtube9294 2 года назад

    I don't know why but my program doesn't accept QRegExp but accepts QRegularExpression and again says Syntax Error.
    I added #Include and then nextline with reg.exactMatch, it says exactMatch is no member in QRegularExpression..
    Can you please help me???

  • @larrybishop5139
    @larrybishop5139 6 лет назад +4

    Derek thankyou for the amazing tutorial. Would you consider doing a C++ tutorial for Unreal Engine 4?

    • @derekbanas
      @derekbanas  6 лет назад +2

      I'll do anything if I get enough requests.

  • @danielmoisemontezima9098
    @danielmoisemontezima9098 4 года назад

    I don't fully understand the course yet. But I like the delivery. Thumbs up teacher!

  • @chinmaydas4053
    @chinmaydas4053 5 лет назад +1

    Thank you sir,we want lot of videos on different applications made by c++,qt.. it's possible by great like you sir...

    • @derekbanas
      @derekbanas  5 лет назад +1

      Thank you :) I'm happy I could help

  • @josbexerr5166
    @josbexerr5166 6 лет назад

    Excelente Mister Dereck..... , a ver si nos deja un ejemplo de Qt usando Golang que es mi lenguaje favorito

  • @DrCrowie
    @DrCrowie 5 лет назад +1

    Great tut as usual! Just one comment it might have been good to put your Math function triggers into a Container object like QList or QMap, it would have demonstrated some of the useful general purpose data types that come with Qt. It also would have meant a few less lines of code ;)

  • @qianbang_
    @qianbang_ 6 лет назад

    wow another Qt tutorial. I really need to learn C++ to enjoy these

    • @derekbanas
      @derekbanas  6 лет назад +2

      A bunch more are coming. Qt is great

  • @Astran0th
    @Astran0th 4 года назад +1

    Really, really good Tutorial! Thank you a lot for that, helped me greatly.

    • @derekbanas
      @derekbanas  4 года назад

      I'm happy I could help :)

  • @zdspider6778
    @zdspider6778 5 месяцев назад

    19:07 That's the OLD way of connecting, using the "SIGNAL" and "SLOT" macros. Newer way uses the name of the class function.
    *And don't use "released".*
    Use "clicked" instead. Meaning: _&QPushButton::clicked_
    Because with "released", you can click and, while holding down, drag away from the button, and it will register as clicked. 😐 You WANT the option to "cancel" a click by dragging away from it.

  • @safhardy8978
    @safhardy8978 6 лет назад

    From Bangladesh, thanks Derek for another wonderful video, you are amazing!

    • @derekbanas
      @derekbanas  6 лет назад

      You're very kind thank you :)

  • @firefox-zzz
    @firefox-zzz 3 года назад

    Some people *don't have the form file calculator.ui nor calculator.cpp nor calculator.h*
    It's because that class has a different name (I think it's because of Qt edition they changed the way to name classes)
    To solve this (for me it was mainwindow) just write *MainWindow::* instead of *Calculator::*
    I hope it's clear why this is the solution

  • @frik2688
    @frik2688 2 года назад

    Man, I had a problem here 16:20
    It says "no member named Display in Ui::Calculator"
    Some body may help me? I'm a kinda freaking here kkk

  • @nestorcolt
    @nestorcolt 6 лет назад

    Hey mate, a question: in Calculator::NumPressed() method, minute 22 -> why do you create a new QPushButton *button to get the sender ? is this not possible just by setting up a parameter in this method by default and sending the widget in the SLOT(NumPressed(widget)) ? . I come from PyQt this is why I'm asking this kind of question. thanks in advance

  • @jessicalaursen1790
    @jessicalaursen1790 6 лет назад

    Amazing! You make it look so simple and fun to do! Great video! I'll start and check this out for myself. Thanks Derek...continue making great videos!

    • @derekbanas
      @derekbanas  6 лет назад +1

      Thank you for the nice compliment :) Many more are coming

    • @KwabenaAmoah-ce3qj
      @KwabenaAmoah-ce3qj 2 месяца назад

      ​@@derekbanas
      Hi can you teach me how he added button 7,0 1,3,4..

  • @RobertWildling
    @RobertWildling 4 года назад +1

    Nice! Thank you very much! - But shouldn't a calculator have at least a comma button?

  • @parthmaurya3868
    @parthmaurya3868 4 года назад

    Hi at the run time this demo on Linux machine I am getting this warning: QObject::connect: Cannot connect (nullptr)::clicked() to Calculator::NumPressed()
    and during the pressing button nothing is happening ...

  • @Hejizo
    @Hejizo 4 года назад

    Hello< when i compile the program i got :
    Warning: QT_DEVICE_PIXEL_RATIO is deprecated. Instead use:
    QT_AUTO_SCREEN_SCALE_FACTOR to enable platform plugin controlled per-screen factors.
    QT_SCREEN_SCALE_FACTORS to set per-screen DPI.
    QT_SCALE_FACTOR to set the application global scale factor.
    i've used qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", QByteArray("1")); in the main but still the same

  • @mitchelldonnelly1971
    @mitchelldonnelly1971 6 лет назад +18

    Am I the only one horrified by the use of global variables?

    • @zenomat
      @zenomat 4 года назад +5

      Am I the only one horrified by the constant use of the word "aaaaanddd ... " ?

    • @ephestos2144
      @ephestos2144 4 года назад +2

      its not a problem for such small projects if one codes like he does in this video. Even less of a problem when using long meaningful names. For much bigger projects are definitely a minefield. I would not recommend their usage either, because a beginner is very likely to use short generic names where name clashing even in small code becomes a big issue and a big pain.

    • @jvapr27
      @jvapr27 Год назад

      Yeah. If he was teaching proper coding styles, I would agree with you. I feel like he isn't though. More like how to use qt.

    • @KwabenaAmoah-ce3qj
      @KwabenaAmoah-ce3qj 2 месяца назад

      Hi can you teach me how he added button 7,0 1,3,4..

  • @enescerrahoglu
    @enescerrahoglu 3 года назад +1

    'QRegExp' was not declared in this scope. I get this error

  • @bachandhakal5863
    @bachandhakal5863 3 года назад

    my PC
    2 GB ram
    1.8ghz cpu
    64 bit processor
    No graphic card
    Can qt run in my pc
    No then what are light framework or editor for app development.

  • @azizulkarim5619
    @azizulkarim5619 6 лет назад

    Thanks a lot for other good qt tutorial. Expecting more tutorials on qt.

    • @derekbanas
      @derekbanas  6 лет назад

      I'm happy you liked them :)

  • @reemashrestha9718
    @reemashrestha9718 3 года назад

    why are we redefining the global variables? why is it wrong if we don't do that? could you explain it a bit further?

  • @sanjaybhat4260
    @sanjaybhat4260 3 года назад

    Hey thats incomplete tutorial, how will u render the app and give it logo and all. do u need to open IDE everytime and run it

  • @FritsvanDoorn
    @FritsvanDoorn 6 лет назад

    Hi Derek, some years ago you made a series about refactoring. I think that this example will be a valuable cadidate for another splendid refactoring video. By the way, I found this video more interesting than the World Championship in Russia. :)

    • @derekbanas
      @derekbanas  6 лет назад +2

      Thank you :) Yes I plan on making a bigger algorithms and refactoring tutorial series for C++. When I made one for Java I cut them a bit short because at the time nobody was watching them. I would have loved to watch the World Cup because I'm a soccer coach, but I've been obsessed with learning Japanese for the last 2 months.

  • @2271masoud
    @2271masoud 6 лет назад

    I enjoyed watching this video
    Thanks Derek

  • @8010225325
    @8010225325 6 лет назад

    please don't stop here. Make more videos on Qt :)

    • @derekbanas
      @derekbanas  6 лет назад +1

      I'm planning at least 2 more

  • @jessj9877
    @jessj9877 5 лет назад

    Derek, how could we implement the buttons to activate with the keyboard as an optional input method?

  • @dharshikas458
    @dharshikas458 Год назад

    i need hmi program qt creator for converting (km/hr to m/s ) using labels(eg:pushbutton,label,lineedit)

  • @vishalghuman
    @vishalghuman 6 лет назад +1

    Derek please on html5
    With meta and division tags more covering

    • @derekbanas
      @derekbanas  6 лет назад +1

      Here is an HTML5 tutorial ruclips.net/video/kDyJN7qQETA/видео.html and CSS3 ruclips.net/video/CUxH_rWSI1k/видео.html

  • @Hidalgo_71
    @Hidalgo_71 4 года назад

    I have an error QObject::connect: Cannot connect (nullptr)::released() to MainWindow::numPressed()

  • @pranavlabdhe4657
    @pranavlabdhe4657 5 лет назад +1

    please help me i am getting this error
    warning: no previous extern declaration for non-static variable.

  • @kaushikyelne3256
    @kaushikyelne3256 4 года назад +1

    watching(#learning) the tutorial during #coronatime #covid19 #quarantine
    don't know when we'll be out of this...
    thanks for the tutorial !! :)
    -from India

    • @derekbanas
      @derekbanas  4 года назад +1

      I hope you and your family stay well :)

  • @meerawounders292
    @meerawounders292 3 года назад

    Actually I have a doubts the output should show like this (1+1+2*3/) how we get both numbers and operators in a display

  • @user-ql7pw7ld1n
    @user-ql7pw7ld1n 4 месяца назад

    fantastic loved it

  • @adamw4323
    @adamw4323 5 лет назад +1

    member acces into incomplete type 'class Ui::Calculator'
    I can't figure out what's wrong and why I am getting this error, anybody knows?

    • @firefox-zzz
      @firefox-zzz 3 года назад

      Your main ui file is not called Calculator.ui so you have instead mainwindows instead. Thus, you should use MainWindow:: everywhere he wrote Calculator::
      I guess it's because we have different editions so the classes' names were different from the tutorial
      gonna copy this comment outside also

  • @duyduy5595
    @duyduy5595 Год назад

    Can you make incremental search function?

  • @ahmadel-bobou276
    @ahmadel-bobou276 6 лет назад +1

    Hey, Derek! Thanks for creating these videos. Do you mind me asking how you learned Qt?

    • @derekbanas
      @derekbanas  6 лет назад +3

      I'm happy you liked it :) Mainly from the website

  • @amirhassan6549
    @amirhassan6549 3 года назад

    Please upload more and more projects
    Project building is a great way of learning.
    Most important thing is how will you deploy this as a software having DLL and exe files where we can easily start our software
    if you dont mind make a video on deployment of software.

  • @sealbatross
    @sealbatross 3 года назад

    thank you!

  • @conradpretorius_remaxjac
    @conradpretorius_remaxjac 2 года назад

    Hi Derek, should each widget have its own header file or each widget rather defined as a class in the .cpp?

  • @kenlaw3376
    @kenlaw3376 6 лет назад +1

    Thanks for the tutorial! Is there a reason you used if else instead of a switch statement?

    • @derekbanas
      @derekbanas  6 лет назад +1

      I'm happy it helped :) Personal preference was the reason

  • @hjw9347
    @hjw9347 3 года назад

    Really good Tutorial, thanks for posting

    • @derekbanas
      @derekbanas  3 года назад

      Thank you :) I'm happy I could help

  • @filipbehindmountain7427
    @filipbehindmountain7427 5 лет назад

    When i type "double calcVal = 0.0;" there appears an error:
    "no previous extern delcaration for non-static variable 'calcVal' ".
    I'm doing everything EXACTLY the same like on video. Can't really find any solution in the internet. Can someone help me?

    • @derekbanas
      @derekbanas  5 лет назад

      Put static in front of it and it will go away

  • @smileifyoupoopie9926
    @smileifyoupoopie9926 4 года назад

    duude you have many habits that are considered as "smelly" in Cpp. Global variables, complicated nested cs, deprecated casting style, not using modern features like auto keyword (which is boss in Qt5 btw) etc. Anyway that's a good work. Have a nice day!

  • @Steven-um9st
    @Steven-um9st 2 года назад

    But In qt 6 It will be go like that
    QString display=ui->label->text();
    QRegularExpression reg("[-]?[0-9.]*");
    QRegularExpressionMatch match=reg.match(display);
    if(match.hasMatch()){
    double dblDisplay=display.toDouble();
    double dblDisplayValSign=-1*dblDisplay;
    ui->label->setText(QString::number(dblDisplayValSign));
    }

  • @bubel40
    @bubel40 5 лет назад

    you are the best, thanks for this tutorial

  • @philipdressler7657
    @philipdressler7657 6 лет назад

    Can not seem to figure out why it wont run. here is the compile output with the error.
    \CalculatorTutorial.pro" -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
    ASSERT: "fileName.isEmpty() || isAbsolutePath(fileName)" in file C:/Users/qt/work/qt/qtbase/qmake/library/ioutils.cpp, line 53
    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.
    18:40:14: The process "C:\Qt\5.11.1\mingw53_32\bin\qmake.exe" exited with code 3.
    Error while building/deploying project CalculatorTutorial (kit: Desktop Qt 5.11.1 MinGW 32bit)
    When executing step "qmake"
    18:40:14: Elapsed time: 00:07.

  • @sabaudzilauri7307
    @sabaudzilauri7307 4 года назад

    Very talented teacher! thanks.

    • @derekbanas
      @derekbanas  4 года назад +1

      Thank you very much :)

  • @gloatsticks
    @gloatsticks 5 лет назад

    I get to 19:15 and I'm wondering where did you get the function release() from?
    I'm having a rough time setting up my onclick listener with slots.

    • @gloatsticks
      @gloatsticks 5 лет назад

      also up to this point, where do you specify the function of numPressed()? I apologize, I have a function written as a class in c++ and I can NOT for the life of my get it to activate when I press on a button.

  • @yolamontalvan9502
    @yolamontalvan9502 5 лет назад +1

    Can you make a video on How to Learn a Programming Language like you? or How to be like you?

    • @derekbanas
      @derekbanas  5 лет назад

      I mainly break things down into roman numeral lists and then memorize and maintain knowledge with a free program called Anki. Look for my Anki tutorial on youtube

  • @macinm97
    @macinm97 6 лет назад +2

    Could you create tutorial where you explain how to connect qml and c++? Maybe any bigger project? I think that it's good idea.
    Please consider my mind.

    • @derekbanas
      @derekbanas  6 лет назад +3

      Yes I plan on covering it

    • @macinm97
      @macinm97 6 лет назад

      When i can expect it? ;)

    • @derekbanas
      @derekbanas  6 лет назад +1

      Sorry I don't have a definite time frame. ASAP

  • @JustinZaf
    @JustinZaf 5 лет назад

    thanks for replying me back there and man you're like an idol too me,i just want to gain knowledge as much as you have i hope i can meet you someday can you please tell me how to get started into os development like a step by step approach ?

  • @MyOnlineSupportchannel
    @MyOnlineSupportchannel 4 года назад +1

    QT or RAD studio ?

  • @shoukatmulla9620
    @shoukatmulla9620 3 года назад

    Where we declared signal add

  • @frenchmike
    @frenchmike 4 года назад

    when I created the project, and got into Kit Selection, nothing was highlighted and I am not sure what to add, any help?

    • @angucbac2655
      @angucbac2655 4 года назад

      you should install the Qt again, i think the offline install is better.

  • @danielwilkowski5899
    @danielwilkowski5899 2 года назад

    The guy says that the style sheets are "very close to CSS", that's not entirely true since that's exactly CSS.

  • @gsniteesh3794
    @gsniteesh3794 6 лет назад

    what does namespace ui{
    class calculator;
    } mean ?
    Is it equal to declaring calculator class inside the namespace

    • @derekbanas
      @derekbanas  6 лет назад

      We use namespaces to avoid conflicts if other code uses a function of the same name.

  • @draoi99
    @draoi99 6 лет назад

    Very good tutorial thank you.

  • @saugatpaudel8777
    @saugatpaudel8777 6 лет назад

    How do you know so much man? I am amazed. Is there some way you learn or are you just that talented?

    • @derekbanas
      @derekbanas  6 лет назад +2

      I'm not that smart. I'm sure of that. I'm going to upload a video soon on how I study, but I think I basically do the same as everyone else. Flash cards, studying all day in short bursts when I'm not busy, exercise when I get stressed out by learning, etc.

    • @derekbanas
      @derekbanas  6 лет назад +2

      Here is a short day in my life.
      1. Wake up and study while I drink a smoothie and coffee (Flash cards or book) (1 hr)
      2. Shower and then work on regular job stuff (2 hrs)
      3. Run 30 minutes
      4. Work 1.5 hrs
      5. Lunch while studying (Flash cards or book) 30 minutes
      6. Work 2 hrs
      7. Run 45 minutes
      8. Study while drinking water (Flash cards or book) 30 minutes
      9. Make dinner while studying 1 hr
      10. After dinner I study or work during time remaining for the day
      I hope that helps

    • @saugatpaudel8777
      @saugatpaudel8777 6 лет назад

      Derek Banas I am quite sure I'll learn from that video as well..please upload as soon as possible.

  • @adharshrnair8284
    @adharshrnair8284 6 лет назад

    Please try to do a tutorial for creating DLL files in C++
    And keep up the good work

  • @GobblowGalaxyGamer
    @GobblowGalaxyGamer 6 лет назад

    Hey Derek! I'm going to be applying to some internships this year and I've heard that personal/side projects are a good way of increasing your chances of getting a job. What are some simple, easy, yet great personal coding projects to build that will look good on my resume? :)

    • @derekbanas
      @derekbanas  6 лет назад +1

      Yes most definitely. It needs to be a project you are passionate about. I got hired at Apple mainly because I made a VR system with a custom head mounted display and a hacked Nintendo power glove. It doesn't matter what the project is, but it should be big and something you love merged with programming or electronics.

    • @GobblowGalaxyGamer
      @GobblowGalaxyGamer 6 лет назад

      Wait you work at Apple? How come you never made a video called "What it's like working at Apple", or "How to get an interview at Apple?". I think a lot of people would love to see that.

  • @lulsec
    @lulsec 6 лет назад +1

    Just one question sir how do you learned so many programming languages 😫😌😅

  • @kyleb8211
    @kyleb8211 5 лет назад

    Please help! In the calculator.cpp at 15:14, my Qt says: allocation of incomplete type 'Ui::Calc'.
    How do I fix this?

    • @derekbanas
      @derekbanas  5 лет назад

      I have the code here for free www.newthinktank.com/2018/06/qt-tutorial-2-c-calculator/

    • @achabra7541
      @achabra7541 3 года назад

      I had this same problem, for me it was because while creating the project in the beginning I didn't rename Class Name from "MainWindow" to "Calculator". I then tried renaming it after the project was created and got that error.

  • @hakzhub
    @hakzhub 4 года назад

    Hey man I know am 2 years late and all but I am having a assembler message error can you please help

  • @8010225325
    @8010225325 6 лет назад

    Derek i read somewhere in one of your videos. You use xamarin for mobile app dev , how is it compared to Qt ?. Qt also allows mobile dev and which framework or tech stack you use for web dev ?

    • @derekbanas
      @derekbanas  6 лет назад

      Yes I use Xamarin and I much prefer it over Qt for mobile development

    • @8010225325
      @8010225325 6 лет назад

      Oh okay. I have only used Qt so far for mobile app dev, never tried Xamarin till now maybe i will give it a shot

  • @gopinathkrm58
    @gopinathkrm58 6 лет назад

    Very nice tutorial.

  • @navoiy17
    @navoiy17 4 года назад

    Cool! Elin dert gormesin, gardash! Ko'p yashang!

  • @daristotell
    @daristotell 6 лет назад

    Adobe animate tutorial?
    Also thank you for all your tutorials.
    Your hard work is appreciated.

    • @derekbanas
      @derekbanas  6 лет назад

      Thank you for watching :) Sorry I don't own AA

    • @daristotell
      @daristotell 6 лет назад

      No problem
      Can you do any adobe cc tutorial or is it out of question?

    • @derekbanas
      @derekbanas  6 лет назад

      Sorry I only have my outdated Adobe tutorials at the moment

    • @daristotell
      @daristotell 6 лет назад

      Derek Banas Don't worry sir.
      You don't have to do everything.

  • @arslansadiqe6615
    @arslansadiqe6615 4 года назад

    Hi,
    Can you tell me that, if I can do it like this:
    I have one button and I want to write in 2 different lineEdits. Like When I click on one lineEdits the buttons start writing on lineEdit1 if I click on lineEdit2 then it starts writing on linEdit2.
    Is there any solution for that?

  • @zugzwang4589
    @zugzwang4589 Год назад

    wtf it keeps giving me 0 when I press the equal button

  • @RadioRelax87
    @RadioRelax87 6 лет назад +5

    First comment, first like, without watching the full video :D.

  • @russelwebb8853
    @russelwebb8853 6 лет назад

    Thanks dude

    • @derekbanas
      @derekbanas  6 лет назад

      I'm happy to be of help :)

  • @gorgoneimpertinence4805
    @gorgoneimpertinence4805 6 лет назад

    Very nice Video please continue with common use cases using/read/write configs/files, create settings editor, control/execute/detect system apps python bash zsh

    • @derekbanas
      @derekbanas  6 лет назад

      Thank you :) I'll try to do my best

  • @vivek3861
    @vivek3861 6 лет назад

    Sir can you teach it with gtk library too which is also a cross platform gui library and it is free. Because some major applications like VLC media player is also built on it according to my knowledge.
    Please........................

  • @guillermo4472
    @guillermo4472 3 года назад

    What's that font? Looks cool

  • @texasaggie2378
    @texasaggie2378 6 лет назад +1

    Please do cmake next

  • @daanielacosta2395
    @daanielacosta2395 6 лет назад

    Thank you derek bananas :D

  • @coz_DS
    @coz_DS 5 лет назад

    Hello, I realize this was done about a year ago, however I just found it today. I think, for my taste, you forgot the decimal point. I would really like to learn to make a nice "big" calculator for my laptop touch screen. I use Fedora 30 Mate, QT Creator 4.9.1, and know very little to nothing about programming. Your video had me with great hopes until I didn't see the decimal point, unless I missed something. If I did, I apologize. However, I have not found any video or online stuff for building a calculator that fits what I need. But still, Many many thanks for as far as this video took me. If you have any suggestions, I would more than appreciate it.

    • @derekbanas
      @derekbanas  5 лет назад

      Sorry about the decimal. I made a JavaScript calculator with a decimal here and it would be easy to use that code as a guide to add that functionality ruclips.net/video/22QAmVctAMc/видео.html

  • @alexeyonufriev5767
    @alexeyonufriev5767 5 лет назад

    ui->Display
    this dont working, maybe ui->lineEdit ??

  • @fafamnzm3126
    @fafamnzm3126 6 лет назад

    Do you have any tutorials on how to setup a website? Like from scratch to the top. One that is practical. Whether with WordPress or without it.

    • @derekbanas
      @derekbanas  6 лет назад

      Do you mean the design? I have tutorials on all of the above.
      I make a whole site design here ruclips.net/video/9fHSbiCISOA/видео.html
      Wordpress design here ruclips.net/video/Ghnrxgk-jCc/видео.html
      I have other tutorials on my channel for PHP, MySQL, JavaScript, JQuery, etc....

    • @fafamnzm3126
      @fafamnzm3126 6 лет назад

      Derek Banas yeah, I saw them last night. Do you mean the one with designing a webpage and inkspace. I didn't get it how that designed the webpage, as it turned into a simple image. I mean like what is a host and setup a website from getting the domain and a host and how to connect a android app to the website. You teach very well and thank you.

    • @derekbanas
      @derekbanas  6 лет назад

      If you get an account at a place like Go Daddy, or any other they'll have a thing called the control panel in which you upload your code. If you want to use Wordpress you'll click on a link on the site and it will install Wordpress. Do a search for the hosting company and Wordpress and they'll show you everything step by step. I hope that helps

    • @fafamnzm3126
      @fafamnzm3126 6 лет назад

      Derek Banas ok, tnx. I also thought it would be a good topic to cover as the demand for it is at a high level and many people would enjoy it too. 😊🤗 or as a summary to all the topics related covered. Like build from scratch and update it using php or asp.net. thanks for your great channel ❤