Installation and getting started with first app

  • Hello team,

    I am newbie to the QT...i am very much impressed with the features of this.can somebody help me in getting all the required tools, IDE and compilers and their installation and set up processes one by one ?

    quick help will be really appreciated as I gotta start developing in the next week.

    Many many thanks in advance.


  • Hi,

    as a start, download the SDK (I suggest Qt SDK 1.1 Beta) from "this site": . Depending on the platform, choose the installer (for windows I use online installer, as I then only get what I really need, e.g. no meamo, meego, symbian).

    Then start reading QtCreator docs, it's part of the SDK, or read it "online":

  • For "getting started":, the Qt documentation contains some fine "tutorials": as well.

  • thatz really great...what a quick response...I have just started downloading those files you suggested..thanks a million


  • Hello Gerolf/Andre,

    Thomas again !!

    I have installed QT SDK 1.1 Beta yesterday without any problems and tried executing examples to understand the code flow and successfully executed on my Windows 7 professional desktop. I am really impressed with the simple coding style QT followed.

    Now my question is how can I run the same executable( say for example "Extension example from Dialogs") on Linux OS ?

    could you please explain me step by step now ?

    Thanks in advance.


  • You install the SDK for linux and build the executables there. Same procedure....

    Or you get a creoss compile environment, install it on windows, build for linux and copy, but I think, native building will be easier.

  • where can i get a cross compiler for QT and how can i make it for Linux? please help !!

  • I never cross compiled from windows to linux.
    Did you ask google?

  • If the customer is aiming at application which can be installed and executed on both Windows and Linux, how would we do that using our QT ?

    can you please guide me in a detailed manner Gerolf ??

  • I would build natively on windows and natively on linux. Especially as Linux != Linux (distribution).
    Use a seperate machine, virtual machines whatever and build on both.

  • lemme know if my understandings are correct…

    • develop the application on one OS using QT (windows or Linux).
    • Get the .exe file in Release mode on native OS (say Windows).
    • Run the same code on the other desired OS (say Linux which can be the other OS of my Dual OS system and has the same SDK) and get the .exe in release mode.
    • make an installable setup (write a script which can pick up the required ‘files and .exe’ by recognizing the OS during installation) which is installed and executed according to the customer specifications.
    • make the customer satisfied :-)

    …..i am right Gerolf ??

  • Yep, thats the way to go.
    If you use a version control system or some shared drives, you could also switch during developement (which never is bad for testing if everything really works).

  • million thanks Gerolf..please be with me while learning the coding..

  • Hello Gerolf,

    got a problem again..

    have downloaded the Qt SDK 1.1 Beta for Linux. Tried installing it and ended up with this error..

    ./ /usr/lib64/ version `GLIBCXX_3.4.9' not found (required by ./ :-((

    could you please help me in sorting this ?!

  • I don't use Linux, I always use windows, sorry.

  • try to install libstdc++.
    Question: which distro do you use? And do you have g++ installed already?

  • thanks for the response man..i am totally new to Linux..could you please lemme know how to fetch those info you asked ??

  • If you're on linux, you should already have that lib I'd say.

  • I have installed CentOS 5.5 yesterday and tried to install Qt..could you please gimme those commands to check if that lib is existing and its verson ??

  • For linux help, you're on the wrong channel. Sorry. This is not Qt related anymore.

  • I agree..but it happened while i tried to install Qt on is appreciated more

  • thanks amn..I will go through that link now..

    btw I have this compiler error when I compiled my demo app on windows using QTreeView which I am planning to display the SystemStorage info

    In file included from ..\IDT_Demo_UI\main.cpp:2:
    ..\IDT_Demo_UI/idt_mainwindow.h:23: error: ISO C++ forbids declaration of 'QSystemStorageInfo' with no type
    ..\IDT_Demo_UI/idt_mainwindow.h:23: error: expected ';' before '*' token

  • its say were you have to look!
    ĺine 23 of the file idt_mainwindow.h, you didnt end the line with ; or/and you didnt include QSystemStorageInfo

  • Or you only declared the type like
    class QSystemStorageInfo;
    and use it as member. This is not allowed. If you use it for pointers, declaration like above should work.

  • Gerolf...I have included
    #include <QSystemStorageInfo>

    and this is the complete compilation report

    Running build steps for project IDT_Demo_UI...
    Configuration unchanged, skipping qmake step.

    Starting: "C:\QtSDK\mingw\bin\mingw32-make.exe" -w

    mingw32-make: Entering directory `E:/Bose/Qt playground/IDT_Demo_UI-build-desktop'

    C:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug

    mingw32-make[1]: Entering directory `E:/Bose/Qt playground/IDT_Demo_UI-build-desktop'

    g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\QtSDK\Desktop\Qt\4.7.2\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.7.2\mingw\include\QtGui" -I"c:\QtSDK\Desktop\Qt\4.7.2\mingw\include" -I"c:\QtSDK\Desktop\Qt\4.7.2\mingw\include\ActiveQt" -I"debug" -I"." -I"..\IDT_Demo_UI" -I"." -I"c:\QtSDK\Desktop\Qt\4.7.2\mingw\mkspecs\win32-g++" -o debug\main.o ..\IDT_Demo_UI\main.cpp

    In file included from ..\IDT_Demo_UI\main.cpp:2:

    ..\IDT_Demo_UI/idt_mainwindow.h:4:30: error: QSystemStorageInfo: No such file or directory

    In file included from ..\IDT_Demo_UI\main.cpp:2:

    ..\IDT_Demo_UI/idt_mainwindow.h:23: error: ISO C++ forbids declaration of 'QSystemStorageInfo' with no type

    ..\IDT_Demo_UI/idt_mainwindow.h:23: error: expected ';' before '*' token

    mingw32-make[1]: Leaving directory `E:/Bose/Qt playground/IDT_Demo_UI-build-desktop'

    mingw32-make: Leaving directory `E:/Bose/Qt playground/IDT_Demo_UI-build-desktop'

    mingw32-make[1]: *** [debug/main.o] Error 1

    mingw32-make: *** [debug] Error 2

    The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.

    Error while building project IDT_Demo_UI (target: Desktop)

    When executing build step 'Make'

    and this is .h file

    #ifndef IDT_MAINWINDOW_H
    #define IDT_MAINWINDOW_H

    #include <QSystemStorageInfo>
    #include <QtGui>
    #include <QMainWindow>

    namespace Ui {
    class IDT_MainWindow;

    class IDT_MainWindow : public QMainWindow

    explicit IDT_MainWindow(QWidget *parent = 0);

    Ui::IDT_MainWindow *ui;

    QSystemStorageInfo *sti;


    #endif // IDT_MAINWINDOW_H


  • please wrap your code with @ tag

  • I am realy sorry vinb...I didn't get you !! how to rap with a tag ??

  • i dont think "QSystemStorageInfo" exist in Qt,

    If it is your own made you have to use "" instead of <>.

  • use @
    then your code and end with "@" without the ""

  • Your problem lies more in the beginning of your build output:

    ..\IDT_Demo_UI/idt_mainwindow.h:4:30: error: QSystemStorageInfo: No such file or directory

    where does QSystemStorageInfo come from?

    If I googled correctly, it's part of QtMobility, did you install that? did you add the needed include paths in the pro file?

  • ok...then which class should i use to get the system storage info if it is for desktop application ?

  • Afaik QtMobility may also be used on the Desktop. But you have to set your include paths.

  • please guide me how to set that ...

  • I said Afaik, not that I did it before ;-)

    I never used QtMobility

  • [quote author="Thomas Kennedy" date="1301490967"]ok...then which class should i use to get the system storage info if it is for desktop application ?[/quote]

    I don't know what info you want to get from QSystemStorageInfo, but maybe "QDesktopServices::storageLocation() ": provides what you need.

  • In order to use the QSystemStorageInfo class from Mobility, be sure that in your .pro file you have included the lines

    CONFIG += mobility
    MOBILITY += systeminfo

  • Thanks a lot...

    without changing .pro file I am trying with QDir::Drives()..I will update you soon about my results..before that I have another query...

    I have placed my controls on the main window by opening 'mainwindow.ui' in design would I create control variables for those controls in my code using QTCreator ?

  • "control variables"? You mean you need a pointer to them?

    m_ui->myCoolLineEdit->setText("I'm so cool!");

    works for me. myCoolLineEdit is of course the name you gave the widget in Designer, and m_ui is the member variable that holds the UI class you created.

  • i understood this part Andre..I have creaed a QTreeWidget on my MainWindow and coded like tihs..

    ui->treeWidgetDrives = new QTreeWidget();
    QStringList strlstHeaders;
    strlstHeaders<<tr("Storage Drives");

    ...when i run my code nothing is happened to my TreeWidget(no header is assigned)..instead it is showing the properties which i set from 'Edit Tree Widget' dialog !!!

    [EDIT: code formatting, please use @-tags, Volker]

Log in to reply