SlideShare uma empresa Scribd logo
1 de 19
Introduction to Qt
 The IDE for C++
THE QT STORY

   Haavard Nord and Eirik Chambe-Eng (the original
    developers of Qt and the CEO and President, respectively, of
    Trolltech) began development of "Qt" in 1991, three years
    before the company was incorporated as Quasar
    Technologies, then changed the name to Troll Tech and then
    to Trolltech.
   Qt is developed by an open source project, the Qt Project,
    involving both individual developers as well as developers
    from Nokia, Digia, and other companies interested in the
    development of Qt.
   The Qt toolkit is a multi-platform C++ GUI toolkit (class library) that has
    been developed over a 6 year period.
   The company Troll Tech AS was founded in 1994 to secure future
    development of Qt.
   On May 20, 1995, Qt was made available under commercial and non-
    commercial GNU licenses. The non-commercial license grants any
    developer the right to use Qt to develop software for the free software
    community.
   It was ten months before the first commercial license was purchased.
    The European Space Agency purchased the second.
   Around 1997, Qt was chosen as the code basis for the KDE linux
    desktop environment.
   Qt 3.0 was released in 2001 with Windows, Unix, Linux, Embedded
    Linux, and Mac OS X libraries.
WHY CROSS-PLATFORM GUI TOOLKITS

 Increases target market.
 May provides the same look-and-feel across
  platform. Reduces training and documentation
  costs.
STATEGIES FOR IMPLEMENTING CROSS-PLATFORM GUIS


   API Layering – Mapping one API to many others
     Example – wxWindows – Win32 API on top of Motif or
      Xt API under Unix.
     Advantages – easy to write, 100% compatible native
      look and feel.
     Disadvantages –
         slower

         problems  mapping to vastly different API architectures
         Lowest common denominator – i.e. no pop-up help anywhere

         Objects required a C++ wrapper to work with them in C++
QT ASSISTANT
   All documentation is
    available through the
    trolltech web site.
   Qt Assistant is a Qt help
    browser that runs under
    Windows.
   It has with search and
    indexing features that make
    it quicker and easier than the
    web.
`QT DESIGNER
   Widgets and forms
    created with Qt Designer
    integrated seamlessly
    with programmed
    code, using Qt's signals
    and slots
    mechanism, that lets you
    easily assign behavior to
    graphical elements. All
    properties set in Qt
    Designer can be changed
    dynamically within the
    code.
    Furthermore, features like
    widget promotion and
    custom plugins allow you
    to use your own
    components with Qt
    Designer.
A SIMPLE EXAMPLE
/* HELLOWORLD.CPP */



   1   #include <qapplication.h>
   2   #include <qlabel.h>
   3
   4   int main(int argc, char **argv) {
   5
   6        QApplication myapp(argc, argv);
   7
   8        Qlabel *mylabel = new Qlabel(“Hello World”, 0);
   9        mylabel->resize(100, 200);
  10
  11        myapp.setMainWidget(mylabel);
  12        mylabel->show();
  13        return myapp.exec();
  14   }
LINE-BY-LINE
1 #include <qapplication.h>
2 #include <qlabel.h>
Always #include any Q types referenced in code.

6 QApplication myapp(argc, argv);
Creates an object to manage application-wide resources. Passes
argc and argv because Qt supports a few command line arguments of
its own.

8Qlabel *mylabel = new Qlabel(“Hello World”, 0);
Creates a QLabel widget on the heap. A widgets is any visual
element in a user interface. Widgets can contain other widgets. For
example a window may contain a QMenuBar, QToolBar, QStatusBar,
and other widgets. The 0 parameters says that that the label is a
stand-alone window, is not inside another window.
LINE-BY-LINE
9 mylabel->resize(100, 200);
Invokes the resize() member function.

11 myapp.setMainWidget(mylabel);
Make the label the main application widget. This means that closing the label windows
closes the application.

12 mylabel->show();
Invoke the show() member function to make the label visible. All widgets are created
invisible so that their properties can be manipulated without flickering. For example,
you would show a widget and then change its size and color. You would change the size
and color first, and then show the widget.

13 return myapp.exec();
Passes control of the application to Qt. At this point the application goes into “event-
driven” mode. It will just sit there until the user does something to create an even. This
is the same concept as Word. Word starts and waits for the user to do something.
EVENT HANDLING
   QT's new approach: signals and slots
     A widget sends out various signals
     Object methods can be declared as slots
     Compatible signals and slots can be connected or
      plugged together like a telephone switchboard
      (parameter types must match)
   Strict separation
     This strict separation between UI components and
      program elements lends itself to component-based
      programming
     Goal: separate UI from program logic
SIGNALS AND SLOTS




                    clicked_method()
QMAKE
   The qmake utility is typically invoked with the following three
    commands]

qmake –project
qmake
make (or nmake under Windows)

   Rules:
        Be sure to place code in its own directory.
        qmake scans all subdirectories for dependencies. Do not place archive
         version under a “save” subdirectory.
        If you reorganize your files, like adding a new .h, delete all the .pro and other
         working files, then start over.
DEFINING SIGNALS AND SLOTS
   New C++ syntax for defining signals and
    slots, added to public, private, etc.
    class myClass : public Qobject {
    Q_OBJECT          //required macro, no semicolon
    …
    signals:
       void somethingHappened();
    …
    public slots:
       void slotDoSomething();
    …
    private slots:
       void slotDoSomethingInternal();
    …
    };
EVENTS
   Signals: emit events
     declare as signals, otherwise normal member functions
     You don't implement them. Rather, you send them with
      the (new) keyword emit
     E.g. emit(sliderChanged(5))
   Slots: receive and handle events
       Normal member functions declared as slots
   Connect: must connect signals to slots
       QObject::connect( mymenu, SIGNAL(activated(int)),
        myobject, SLOT(slotDoMenuFunction(int)) );
   moc: meta object compiler (preprocessor) converts
    these new keywords to real C++
WIDGETS
 Base class for all UI widgets
 Properties
       width, height, backgroundColor, font, mouseTracking,
        backgroundPixmap, etc.
   Slots
       repaint, show, hide, move, setGeometry,
        setMainWidget, etc.
   Signals:
       mouseMoveEvent, keyPressEvent, resizeEvent,
        paintEvent, enterEvent, leaveEvent, etc.
QT, A GUI TOOLKIT
   Events processed with signals and slots
    signal generates an event, e.g., button push
    slot processes the event, e.g., pop up a file dialog box
QPushButton * quitB = new QPushButton(“Quit”,...,...);
   connect (quitB, SIGNAL(clicked()), qApp, SLOT(quit());
       qApp is a global variable, of type QApplication
            one QApplication per program defined first in main()
       main returns qApp.exec()
       SIGNAL and SLOT are macros, expanded by a meta-object
   compiler (moc)
       moc generates .cpp files from user-defined Qt subclasses
OTHER FEATURES OF QT
   The Qt Paint Engine
   QPainter is highly optimized and contains several       caching mechanisms
    to speed up drawing. Under X11,         it caches GCs (graphics
    contexts), which often make it     faster than native X11 programs.
   QPainter contains all the functionality one would expect from a professional
    2D graphics library. The coordinate system of a QPainter can be
    transformed using the standard 2D transformations (translate, scale, rotate
    and shear).
   Qt supports Open GL for 3D graphics.
   Qt also contains a set of general purpose classes and a number of
    collection-classes to ease the development of multi-platform applications.
   Qt has platform independent support for the operating system dependent
    functions, such as time/date, files/directories and TCP/IP sockets.
Anupam Kumar Srivastava
Software Engineer
Burl Software Pvt. Ltd
E-mail: anupam.933@gmail.com

Mais conteúdo relacionado

Mais procurados

Convert Your Legacy OpenGL Code to Modern OpenGL with Qt
Convert Your Legacy OpenGL Code to Modern OpenGL with QtConvert Your Legacy OpenGL Code to Modern OpenGL with Qt
Convert Your Legacy OpenGL Code to Modern OpenGL with QtICS
 
Qt for Beginners Part 3 - QML and Qt Quick
Qt for Beginners Part 3 - QML and Qt QuickQt for Beginners Part 3 - QML and Qt Quick
Qt for Beginners Part 3 - QML and Qt QuickICS
 
Qt for beginners part 2 widgets
Qt for beginners part 2   widgetsQt for beginners part 2   widgets
Qt for beginners part 2 widgetsICS
 
Gtk development-using-glade-3
Gtk development-using-glade-3Gtk development-using-glade-3
Gtk development-using-glade-3caezsar
 
Building the QML Run-time
Building the QML Run-timeBuilding the QML Run-time
Building the QML Run-timeJohan Thelin
 
A Brief Introduction to the Qt Application Framework
A Brief Introduction to the Qt Application FrameworkA Brief Introduction to the Qt Application Framework
A Brief Introduction to the Qt Application FrameworkZachary Blair
 
Optimizing Performance in Qt-Based Applications
Optimizing Performance in Qt-Based ApplicationsOptimizing Performance in Qt-Based Applications
Optimizing Performance in Qt-Based Applicationsaccount inactive
 
Qt for beginners part 1 overview and key concepts
Qt for beginners part 1   overview and key conceptsQt for beginners part 1   overview and key concepts
Qt for beginners part 1 overview and key conceptsICS
 
QThreads: Are You Using Them Wrong?
QThreads: Are You Using Them Wrong? QThreads: Are You Using Them Wrong?
QThreads: Are You Using Them Wrong? ICS
 
Building Cross-Platform Apps using Qt and Qyoto
Building Cross-Platform Apps using Qt and QyotoBuilding Cross-Platform Apps using Qt and Qyoto
Building Cross-Platform Apps using Qt and QyotoJeff Alstadt
 
Petri Niemi Qt Advanced Part 2
Petri Niemi Qt Advanced Part 2Petri Niemi Qt Advanced Part 2
Petri Niemi Qt Advanced Part 2NokiaAppForum
 

Mais procurados (20)

Convert Your Legacy OpenGL Code to Modern OpenGL with Qt
Convert Your Legacy OpenGL Code to Modern OpenGL with QtConvert Your Legacy OpenGL Code to Modern OpenGL with Qt
Convert Your Legacy OpenGL Code to Modern OpenGL with Qt
 
Qt for S60
Qt for S60Qt for S60
Qt for S60
 
Treinamento Qt básico - aula I
Treinamento Qt básico - aula ITreinamento Qt básico - aula I
Treinamento Qt básico - aula I
 
Qt for Beginners Part 3 - QML and Qt Quick
Qt for Beginners Part 3 - QML and Qt QuickQt for Beginners Part 3 - QML and Qt Quick
Qt for Beginners Part 3 - QML and Qt Quick
 
Qt for beginners part 2 widgets
Qt for beginners part 2   widgetsQt for beginners part 2   widgets
Qt for beginners part 2 widgets
 
Open gl introduction
Open gl introduction Open gl introduction
Open gl introduction
 
G T K+ 101
G T K+ 101G T K+ 101
G T K+ 101
 
Qt 5 - C++ and Widgets
Qt 5 - C++ and WidgetsQt 5 - C++ and Widgets
Qt 5 - C++ and Widgets
 
Gtk development-using-glade-3
Gtk development-using-glade-3Gtk development-using-glade-3
Gtk development-using-glade-3
 
Building the QML Run-time
Building the QML Run-timeBuilding the QML Run-time
Building the QML Run-time
 
Open gl
Open glOpen gl
Open gl
 
A Brief Introduction to the Qt Application Framework
A Brief Introduction to the Qt Application FrameworkA Brief Introduction to the Qt Application Framework
A Brief Introduction to the Qt Application Framework
 
Optimizing Performance in Qt-Based Applications
Optimizing Performance in Qt-Based ApplicationsOptimizing Performance in Qt-Based Applications
Optimizing Performance in Qt-Based Applications
 
Qt for beginners part 1 overview and key concepts
Qt for beginners part 1   overview and key conceptsQt for beginners part 1   overview and key concepts
Qt for beginners part 1 overview and key concepts
 
Programming with OpenGL
Programming with OpenGLProgramming with OpenGL
Programming with OpenGL
 
QThreads: Are You Using Them Wrong?
QThreads: Are You Using Them Wrong? QThreads: Are You Using Them Wrong?
QThreads: Are You Using Them Wrong?
 
Treinamento Qt básico - aula III
Treinamento Qt básico - aula IIITreinamento Qt básico - aula III
Treinamento Qt básico - aula III
 
Building Cross-Platform Apps using Qt and Qyoto
Building Cross-Platform Apps using Qt and QyotoBuilding Cross-Platform Apps using Qt and Qyoto
Building Cross-Platform Apps using Qt and Qyoto
 
Open gl basics
Open gl basicsOpen gl basics
Open gl basics
 
Petri Niemi Qt Advanced Part 2
Petri Niemi Qt Advanced Part 2Petri Niemi Qt Advanced Part 2
Petri Niemi Qt Advanced Part 2
 

Semelhante a Qt

Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfDeveloping and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfPrabindh Sundareson
 
Qt for beginners part 4 doing more
Qt for beginners part 4   doing moreQt for beginners part 4   doing more
Qt for beginners part 4 doing moreICS
 
Untitled presentation(4)
Untitled presentation(4)Untitled presentation(4)
Untitled presentation(4)chan20kaur
 
Qt Technical Presentation
Qt Technical PresentationQt Technical Presentation
Qt Technical PresentationDaniel Rocha
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarICS
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarJanel Heilbrunn
 
Native Application Development With Qt
Native Application Development With QtNative Application Development With Qt
Native Application Development With Qtrahulnimbalkar
 
Qt quick at Cybercom Developer Day 2010 by Alexis Menard 7.9.2010
Qt quick at Cybercom Developer Day 2010 by Alexis Menard 7.9.2010Qt quick at Cybercom Developer Day 2010 by Alexis Menard 7.9.2010
Qt quick at Cybercom Developer Day 2010 by Alexis Menard 7.9.2010CybercomChannel
 
IBM Rational Rhapsody and Qt Integration
IBM Rational Rhapsody and Qt IntegrationIBM Rational Rhapsody and Qt Integration
IBM Rational Rhapsody and Qt Integrationgjuljo
 
Intro to gui, cross platform and qt
Intro to gui, cross platform and qtIntro to gui, cross platform and qt
Intro to gui, cross platform and qtMuhammad Sabry
 
Qt Automotive Suite - under the hood // Qt World Summit 2017
Qt Automotive Suite - under the hood // Qt World Summit 2017Qt Automotive Suite - under the hood // Qt World Summit 2017
Qt Automotive Suite - under the hood // Qt World Summit 2017Johan Thelin
 
Andreas Jakl Software Development on Nokia Deviceswith Qt
Andreas Jakl Software Development on Nokia Deviceswith QtAndreas Jakl Software Development on Nokia Deviceswith Qt
Andreas Jakl Software Development on Nokia Deviceswith QtNokiaAppForum
 
Dessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudDessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudMassimiliano Dessì
 
Come costruire una Platform As A Service con Docker, Kubernetes Go e Java
Come costruire una Platform As A Service con Docker, Kubernetes Go e JavaCome costruire una Platform As A Service con Docker, Kubernetes Go e Java
Come costruire una Platform As A Service con Docker, Kubernetes Go e JavaCodemotion
 
Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Daker Fernandes
 

Semelhante a Qt (20)

Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfDeveloping and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
 
Qt for beginners part 4 doing more
Qt for beginners part 4   doing moreQt for beginners part 4   doing more
Qt for beginners part 4 doing more
 
Untitled presentation(4)
Untitled presentation(4)Untitled presentation(4)
Untitled presentation(4)
 
Qt coin3d soqt
Qt coin3d soqtQt coin3d soqt
Qt coin3d soqt
 
Qt for beginners
Qt for beginnersQt for beginners
Qt for beginners
 
PyQt.pptx
PyQt.pptxPyQt.pptx
PyQt.pptx
 
Qt Technical Presentation
Qt Technical PresentationQt Technical Presentation
Qt Technical Presentation
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
 
The caQtDM powerpoint (ICALEPCS 2013)
The caQtDM powerpoint (ICALEPCS 2013)The caQtDM powerpoint (ICALEPCS 2013)
The caQtDM powerpoint (ICALEPCS 2013)
 
The caQtDm paper (ICALEPCS 2013)
The caQtDm paper (ICALEPCS 2013)The caQtDm paper (ICALEPCS 2013)
The caQtDm paper (ICALEPCS 2013)
 
Native Application Development With Qt
Native Application Development With QtNative Application Development With Qt
Native Application Development With Qt
 
Qt quick at Cybercom Developer Day 2010 by Alexis Menard 7.9.2010
Qt quick at Cybercom Developer Day 2010 by Alexis Menard 7.9.2010Qt quick at Cybercom Developer Day 2010 by Alexis Menard 7.9.2010
Qt quick at Cybercom Developer Day 2010 by Alexis Menard 7.9.2010
 
IBM Rational Rhapsody and Qt Integration
IBM Rational Rhapsody and Qt IntegrationIBM Rational Rhapsody and Qt Integration
IBM Rational Rhapsody and Qt Integration
 
Intro to gui, cross platform and qt
Intro to gui, cross platform and qtIntro to gui, cross platform and qt
Intro to gui, cross platform and qt
 
Qt Automotive Suite - under the hood // Qt World Summit 2017
Qt Automotive Suite - under the hood // Qt World Summit 2017Qt Automotive Suite - under the hood // Qt World Summit 2017
Qt Automotive Suite - under the hood // Qt World Summit 2017
 
Andreas Jakl Software Development on Nokia Deviceswith Qt
Andreas Jakl Software Development on Nokia Deviceswith QtAndreas Jakl Software Development on Nokia Deviceswith Qt
Andreas Jakl Software Development on Nokia Deviceswith Qt
 
Dessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloudDessi docker kubernetes paas cloud
Dessi docker kubernetes paas cloud
 
Come costruire una Platform As A Service con Docker, Kubernetes Go e Java
Come costruire una Platform As A Service con Docker, Kubernetes Go e JavaCome costruire una Platform As A Service con Docker, Kubernetes Go e Java
Come costruire una Platform As A Service con Docker, Kubernetes Go e Java
 
Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13
 

Último

Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Me
Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near MeBook Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Me
Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Meanamikaraghav4
 
(KRITI) Pimpri Chinchwad Call Girls Just Call 7001035870 [ Cash on Delivery ]...
(KRITI) Pimpri Chinchwad Call Girls Just Call 7001035870 [ Cash on Delivery ]...(KRITI) Pimpri Chinchwad Call Girls Just Call 7001035870 [ Cash on Delivery ]...
(KRITI) Pimpri Chinchwad Call Girls Just Call 7001035870 [ Cash on Delivery ]...ranjana rawat
 
Call Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
Call Girl Nashik Amaira 7001305949 Independent Escort Service NashikCall Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
Call Girl Nashik Amaira 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Kolkata Call Girl Howrah 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Howrah 👉 8250192130 ❣️💯 Available With Room 24×7Kolkata Call Girl Howrah 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Howrah 👉 8250192130 ❣️💯 Available With Room 24×7Riya Pathan
 
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment BookingCall Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Bookingnoor ahmed
 
College Call Girl in Rajiv Chowk Delhi 9634446618 Short 1500 Night 6000 Best ...
College Call Girl in Rajiv Chowk Delhi 9634446618 Short 1500 Night 6000 Best ...College Call Girl in Rajiv Chowk Delhi 9634446618 Short 1500 Night 6000 Best ...
College Call Girl in Rajiv Chowk Delhi 9634446618 Short 1500 Night 6000 Best ...perfect solution
 
↑Top Model (Kolkata) Call Girls Rajpur ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Rajpur ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Rajpur ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Rajpur ⟟ 8250192130 ⟟ High Class Call Girl In...noor ahmed
 
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur EscortsCall Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Verified Call Girls Esplanade - [ Cash on Delivery ] Contact 8250192130 Escor...
Verified Call Girls Esplanade - [ Cash on Delivery ] Contact 8250192130 Escor...Verified Call Girls Esplanade - [ Cash on Delivery ] Contact 8250192130 Escor...
Verified Call Girls Esplanade - [ Cash on Delivery ] Contact 8250192130 Escor...anamikaraghav4
 
Beyond Bar & Club Udaipur CaLL GiRLS 09602870969
Beyond Bar & Club Udaipur CaLL GiRLS 09602870969Beyond Bar & Club Udaipur CaLL GiRLS 09602870969
Beyond Bar & Club Udaipur CaLL GiRLS 09602870969Apsara Of India
 
GV'S 24 CLUB & BAR CONTACT 09602870969 CALL GIRLS IN UDAIPUR ESCORT SERVICE
GV'S 24 CLUB & BAR CONTACT 09602870969 CALL GIRLS IN UDAIPUR ESCORT SERVICEGV'S 24 CLUB & BAR CONTACT 09602870969 CALL GIRLS IN UDAIPUR ESCORT SERVICE
GV'S 24 CLUB & BAR CONTACT 09602870969 CALL GIRLS IN UDAIPUR ESCORT SERVICEApsara Of India
 
1681275559_haunting-adeline and hunting.pdf
1681275559_haunting-adeline and hunting.pdf1681275559_haunting-adeline and hunting.pdf
1681275559_haunting-adeline and hunting.pdfTanjirokamado769606
 
Call Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
Call Girl Nashik Saloni 7001305949 Independent Escort Service NashikCall Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
Call Girl Nashik Saloni 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...noor ahmed
 
Contact:- 8860008073 Call Girls in Karnal Escort Service Available at Afforda...
Contact:- 8860008073 Call Girls in Karnal Escort Service Available at Afforda...Contact:- 8860008073 Call Girls in Karnal Escort Service Available at Afforda...
Contact:- 8860008073 Call Girls in Karnal Escort Service Available at Afforda...Apsara Of India
 
👙 Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
👙  Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service👙  Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
👙 Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Serviceanamikaraghav4
 
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...noor ahmed
 
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...aamir
 
VIP Call Girls in Gulbarga Aarohi 8250192130 Independent Escort Service Gulbarga
VIP Call Girls in Gulbarga Aarohi 8250192130 Independent Escort Service GulbargaVIP Call Girls in Gulbarga Aarohi 8250192130 Independent Escort Service Gulbarga
VIP Call Girls in Gulbarga Aarohi 8250192130 Independent Escort Service GulbargaRiya Pathan
 

Último (20)

Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Me
Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near MeBook Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Me
Book Call Girls in Panchpota - 8250192130 | 24x7 Service Available Near Me
 
(KRITI) Pimpri Chinchwad Call Girls Just Call 7001035870 [ Cash on Delivery ]...
(KRITI) Pimpri Chinchwad Call Girls Just Call 7001035870 [ Cash on Delivery ]...(KRITI) Pimpri Chinchwad Call Girls Just Call 7001035870 [ Cash on Delivery ]...
(KRITI) Pimpri Chinchwad Call Girls Just Call 7001035870 [ Cash on Delivery ]...
 
Call Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
Call Girl Nashik Amaira 7001305949 Independent Escort Service NashikCall Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
Call Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
 
Kolkata Call Girl Howrah 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Howrah 👉 8250192130 ❣️💯 Available With Room 24×7Kolkata Call Girl Howrah 👉 8250192130 ❣️💯 Available With Room 24×7
Kolkata Call Girl Howrah 👉 8250192130 ❣️💯 Available With Room 24×7
 
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment BookingCall Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
 
College Call Girl in Rajiv Chowk Delhi 9634446618 Short 1500 Night 6000 Best ...
College Call Girl in Rajiv Chowk Delhi 9634446618 Short 1500 Night 6000 Best ...College Call Girl in Rajiv Chowk Delhi 9634446618 Short 1500 Night 6000 Best ...
College Call Girl in Rajiv Chowk Delhi 9634446618 Short 1500 Night 6000 Best ...
 
↑Top Model (Kolkata) Call Girls Rajpur ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Rajpur ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Rajpur ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Rajpur ⟟ 8250192130 ⟟ High Class Call Girl In...
 
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur EscortsCall Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
 
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Verified Call Girls Esplanade - [ Cash on Delivery ] Contact 8250192130 Escor...
Verified Call Girls Esplanade - [ Cash on Delivery ] Contact 8250192130 Escor...Verified Call Girls Esplanade - [ Cash on Delivery ] Contact 8250192130 Escor...
Verified Call Girls Esplanade - [ Cash on Delivery ] Contact 8250192130 Escor...
 
Beyond Bar & Club Udaipur CaLL GiRLS 09602870969
Beyond Bar & Club Udaipur CaLL GiRLS 09602870969Beyond Bar & Club Udaipur CaLL GiRLS 09602870969
Beyond Bar & Club Udaipur CaLL GiRLS 09602870969
 
GV'S 24 CLUB & BAR CONTACT 09602870969 CALL GIRLS IN UDAIPUR ESCORT SERVICE
GV'S 24 CLUB & BAR CONTACT 09602870969 CALL GIRLS IN UDAIPUR ESCORT SERVICEGV'S 24 CLUB & BAR CONTACT 09602870969 CALL GIRLS IN UDAIPUR ESCORT SERVICE
GV'S 24 CLUB & BAR CONTACT 09602870969 CALL GIRLS IN UDAIPUR ESCORT SERVICE
 
1681275559_haunting-adeline and hunting.pdf
1681275559_haunting-adeline and hunting.pdf1681275559_haunting-adeline and hunting.pdf
1681275559_haunting-adeline and hunting.pdf
 
Call Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
Call Girl Nashik Saloni 7001305949 Independent Escort Service NashikCall Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
Call Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
 
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
 
Contact:- 8860008073 Call Girls in Karnal Escort Service Available at Afforda...
Contact:- 8860008073 Call Girls in Karnal Escort Service Available at Afforda...Contact:- 8860008073 Call Girls in Karnal Escort Service Available at Afforda...
Contact:- 8860008073 Call Girls in Karnal Escort Service Available at Afforda...
 
👙 Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
👙  Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service👙  Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
👙 Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
 
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
 
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
 
VIP Call Girls in Gulbarga Aarohi 8250192130 Independent Escort Service Gulbarga
VIP Call Girls in Gulbarga Aarohi 8250192130 Independent Escort Service GulbargaVIP Call Girls in Gulbarga Aarohi 8250192130 Independent Escort Service Gulbarga
VIP Call Girls in Gulbarga Aarohi 8250192130 Independent Escort Service Gulbarga
 

Qt

  • 1. Introduction to Qt The IDE for C++
  • 2. THE QT STORY  Haavard Nord and Eirik Chambe-Eng (the original developers of Qt and the CEO and President, respectively, of Trolltech) began development of "Qt" in 1991, three years before the company was incorporated as Quasar Technologies, then changed the name to Troll Tech and then to Trolltech.  Qt is developed by an open source project, the Qt Project, involving both individual developers as well as developers from Nokia, Digia, and other companies interested in the development of Qt.
  • 3. The Qt toolkit is a multi-platform C++ GUI toolkit (class library) that has been developed over a 6 year period.  The company Troll Tech AS was founded in 1994 to secure future development of Qt.  On May 20, 1995, Qt was made available under commercial and non- commercial GNU licenses. The non-commercial license grants any developer the right to use Qt to develop software for the free software community.  It was ten months before the first commercial license was purchased. The European Space Agency purchased the second.  Around 1997, Qt was chosen as the code basis for the KDE linux desktop environment.  Qt 3.0 was released in 2001 with Windows, Unix, Linux, Embedded Linux, and Mac OS X libraries.
  • 4. WHY CROSS-PLATFORM GUI TOOLKITS  Increases target market.  May provides the same look-and-feel across platform. Reduces training and documentation costs.
  • 5. STATEGIES FOR IMPLEMENTING CROSS-PLATFORM GUIS  API Layering – Mapping one API to many others  Example – wxWindows – Win32 API on top of Motif or Xt API under Unix.  Advantages – easy to write, 100% compatible native look and feel.  Disadvantages –  slower  problems mapping to vastly different API architectures  Lowest common denominator – i.e. no pop-up help anywhere  Objects required a C++ wrapper to work with them in C++
  • 6. QT ASSISTANT  All documentation is available through the trolltech web site.  Qt Assistant is a Qt help browser that runs under Windows.  It has with search and indexing features that make it quicker and easier than the web.
  • 7. `QT DESIGNER  Widgets and forms created with Qt Designer integrated seamlessly with programmed code, using Qt's signals and slots mechanism, that lets you easily assign behavior to graphical elements. All properties set in Qt Designer can be changed dynamically within the code. Furthermore, features like widget promotion and custom plugins allow you to use your own components with Qt Designer.
  • 8. A SIMPLE EXAMPLE /* HELLOWORLD.CPP */ 1 #include <qapplication.h> 2 #include <qlabel.h> 3 4 int main(int argc, char **argv) { 5 6 QApplication myapp(argc, argv); 7 8 Qlabel *mylabel = new Qlabel(“Hello World”, 0); 9 mylabel->resize(100, 200); 10 11 myapp.setMainWidget(mylabel); 12 mylabel->show(); 13 return myapp.exec(); 14 }
  • 9. LINE-BY-LINE 1 #include <qapplication.h> 2 #include <qlabel.h> Always #include any Q types referenced in code. 6 QApplication myapp(argc, argv); Creates an object to manage application-wide resources. Passes argc and argv because Qt supports a few command line arguments of its own. 8Qlabel *mylabel = new Qlabel(“Hello World”, 0); Creates a QLabel widget on the heap. A widgets is any visual element in a user interface. Widgets can contain other widgets. For example a window may contain a QMenuBar, QToolBar, QStatusBar, and other widgets. The 0 parameters says that that the label is a stand-alone window, is not inside another window.
  • 10. LINE-BY-LINE 9 mylabel->resize(100, 200); Invokes the resize() member function. 11 myapp.setMainWidget(mylabel); Make the label the main application widget. This means that closing the label windows closes the application. 12 mylabel->show(); Invoke the show() member function to make the label visible. All widgets are created invisible so that their properties can be manipulated without flickering. For example, you would show a widget and then change its size and color. You would change the size and color first, and then show the widget. 13 return myapp.exec(); Passes control of the application to Qt. At this point the application goes into “event- driven” mode. It will just sit there until the user does something to create an even. This is the same concept as Word. Word starts and waits for the user to do something.
  • 11. EVENT HANDLING  QT's new approach: signals and slots  A widget sends out various signals  Object methods can be declared as slots  Compatible signals and slots can be connected or plugged together like a telephone switchboard (parameter types must match)  Strict separation  This strict separation between UI components and program elements lends itself to component-based programming  Goal: separate UI from program logic
  • 12. SIGNALS AND SLOTS clicked_method()
  • 13. QMAKE  The qmake utility is typically invoked with the following three commands] qmake –project qmake make (or nmake under Windows)  Rules:  Be sure to place code in its own directory.  qmake scans all subdirectories for dependencies. Do not place archive version under a “save” subdirectory.  If you reorganize your files, like adding a new .h, delete all the .pro and other working files, then start over.
  • 14. DEFINING SIGNALS AND SLOTS  New C++ syntax for defining signals and slots, added to public, private, etc. class myClass : public Qobject { Q_OBJECT //required macro, no semicolon … signals: void somethingHappened(); … public slots: void slotDoSomething(); … private slots: void slotDoSomethingInternal(); … };
  • 15. EVENTS  Signals: emit events  declare as signals, otherwise normal member functions  You don't implement them. Rather, you send them with the (new) keyword emit  E.g. emit(sliderChanged(5))  Slots: receive and handle events  Normal member functions declared as slots  Connect: must connect signals to slots  QObject::connect( mymenu, SIGNAL(activated(int)), myobject, SLOT(slotDoMenuFunction(int)) );  moc: meta object compiler (preprocessor) converts these new keywords to real C++
  • 16. WIDGETS  Base class for all UI widgets  Properties  width, height, backgroundColor, font, mouseTracking, backgroundPixmap, etc.  Slots  repaint, show, hide, move, setGeometry, setMainWidget, etc.  Signals:  mouseMoveEvent, keyPressEvent, resizeEvent, paintEvent, enterEvent, leaveEvent, etc.
  • 17. QT, A GUI TOOLKIT  Events processed with signals and slots signal generates an event, e.g., button push  slot processes the event, e.g., pop up a file dialog box QPushButton * quitB = new QPushButton(“Quit”,...,...);  connect (quitB, SIGNAL(clicked()), qApp, SLOT(quit());  qApp is a global variable, of type QApplication  one QApplication per program defined first in main()  main returns qApp.exec()  SIGNAL and SLOT are macros, expanded by a meta-object  compiler (moc)  moc generates .cpp files from user-defined Qt subclasses
  • 18. OTHER FEATURES OF QT  The Qt Paint Engine  QPainter is highly optimized and contains several caching mechanisms to speed up drawing. Under X11, it caches GCs (graphics contexts), which often make it faster than native X11 programs.  QPainter contains all the functionality one would expect from a professional 2D graphics library. The coordinate system of a QPainter can be transformed using the standard 2D transformations (translate, scale, rotate and shear).  Qt supports Open GL for 3D graphics.  Qt also contains a set of general purpose classes and a number of collection-classes to ease the development of multi-platform applications.  Qt has platform independent support for the operating system dependent functions, such as time/date, files/directories and TCP/IP sockets.
  • 19. Anupam Kumar Srivastava Software Engineer Burl Software Pvt. Ltd E-mail: anupam.933@gmail.com