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. Easy app that can count in Qt and C++
Forum Updated to NodeBB v4.3 + New Features

Easy app that can count in Qt and C++

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.0k Views 1 Watching
  • 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.
  • B Offline
    B Offline
    Bundas
    wrote on last edited by
    #1

    Hello. I am fourteen and i'm from the czech republic so sorry for my english please.

    my problem:
    I don't know how to write easy app in c++ and qt.

    in TUI can look such as this:

    @#include <iostream>
    using namespace std;
    int main(){
    int a,b;
    cout << "please write first number: ";
    cin >> a;
    cout << endl
    << "please write second number: ";
    cin >> b;
    cout << endl;
    cout << "answer is: " << a+b << endl;
    return 0;
    }@

    how it may look in Qt?

    thank you for answer!

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      welcome to devnet

      The example code you are giving is simple C++ code. There are different ways to do it with Qt. Since you are looking for an example to start off with Qt I would suggest to start with the "tutorials":http://qt-project.org/doc/qt-5.0/qtdoc/qtexamplesandtutorials.html and some examples. The "example code":http://qt-project.org/doc/qt-5/all-examples.html should be installed together with the Qt libs.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Fahmy
        wrote on last edited by
        #3

        In Qt Creater, create a New Project.
        Select Applications in Projects sidebar.
        Then, Qt Console Application.
        Click Choose and give Project a name.
        After Wizard dialog finished, you can use the code above in main.cpp file.
        Click Run (green arrow icon) to compile and run.

        Stay hungry, stay foolish.

        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