Results 1 to 7 of 7

Thread: Console application beginning

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Console application beginning

    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Mar 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Smile Re: Console application beginning

    I managed to create a simple console "hello world" with QT Creator

    used creator 2.4.1 and QT 4.8.0 on windows 7

    two ways to do this

    Plain C++

    do the following

    File- new file project
    under projects select : other Project
    select "Plain C++ Project"
    enter project name 5.Targets select Desktop 'tick it'
    project managment just click next
    you can use c++ commands as normal c++
    or

    QT Console

    File- new file project
    under projects select : other Project
    select QT Console Application
    Targets select Desktop 'tick it'
    project managment just click next
    add the following lines (all the C++ includes you need)
    add "#include 'iostream' "
    add "using namespace std; "
    after QCoreApplication a(int argc, cghar *argv[]) 10 add variables, and your program code..
    example: for QT console "hello world"

    file - new file project 'project name '

    other projects - QT Console Application

    Targets select 'Desktop'

    project management - next

    code:

    #include <QtCore/QCoreApplication>
    #include <iostream>
    using namespace std;
    int main(int argc, char *argv[])
    {
    QCoreApplication a(argc, argv);
    cout<<" hello world";
    return a.exec();
    }
    ctrl -R to run

    compilers used for above MSVC 2010 (QT SDK) , and minGW(QT SDK)

    hope this helps someone

    As I have just started to use QT recently and also searched the Www for info and examples to get started with simple examples still searching...

Similar Threads

  1. Replies: 8
    Last Post: 28th January 2015, 09:45
  2. about console application
    By jirach_gag in forum Qt Programming
    Replies: 2
    Last Post: 5th January 2012, 11:39
  3. Debugging a console application
    By Lorthirk in forum Qt Tools
    Replies: 1
    Last Post: 26th September 2009, 11:49
  4. Exiting a Qt Console Application
    By nbetcher in forum Qt Programming
    Replies: 4
    Last Post: 23rd March 2009, 21:03
  5. libGL using memory in console application
    By neuron in forum Qt Programming
    Replies: 0
    Last Post: 11th March 2009, 15:52

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.