0% found this document useful (0 votes)
1K views13 pages

QT Creator 1

Uploaded by

Vishwas N Prasad
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views13 pages

QT Creator 1

Uploaded by

Vishwas N Prasad
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Qt Creator is a complete integrated development environment (IDE) for creating applications with the Qt application framework.

Qt is designed for developing applications and user interfaces once and deploying them across several desktop and mobile operating systems. This paper provides an introduction to Qt Creator and the features it provides to developers.

Qt Creator Whitepaper

2009 Nokia Corporation and/or its subsidiary(-ies)

1.

Introduction
Qt Creator is a complete integrated development environment (IDE) for creating applications with the Qt application framework. Qt is designed for developing applications and user interfaces once and deploying them across several desktop and mobile operating systems.

The main inspirations for Qt Creator have been the development needs of Qt developers, looking for simplicity, usability, productivity, extendibility and openness, while aiming to lower the barrier of entry for newcomers to Qt. The key features of Qt Creator aid the application developer in the following ways: Quick and easy start of Qt application development with a project wizard, and quick access to recent projects and sessions. Easy access to information with the context-sensitive, integrated Qt Help system. Develop applications with the advanced C++ code editor and integrated Qt Designer. Enjoy new powerful features for navigating between project files, functions and classes quickly. Debug with the GNU and CDB debuggers using a graphical user interface with increased awareness of Qt class structures. Build and execute Qt projects with the qmake cross-platform build tool. Experimental support for creation of Qt applications for Symbian-based devices. Qt Creator does not compete with the Qt plugins for Eclipse or MicrosoftVisual Studio, but rather complements Qt tools offering by providing a complete development environment for Qt that is easy and quick to start using, and facilitates the use of Qt-specific features. In general, Qt Creator runs on every desktop platform supported by Qt. Pre-built binaries are available for Microsoft Windows, Mac OS X, and Linux. Qt Creator can be run other platforms, but that requires the compilation of the publicly available source code. Building and running Qt Creator from source code may require a separate installation of Qt on your computer. The easiest way to get started is the Qt SDK (Software Development Kit). It is a single package that contains both Qt Creator and the latest version of Qt application framework for creating applications. Qt SDK is available for Microsoft Windows, Mac OS X, and Linux from the following location: http://qt.nokia.com/downloads For more information, please see the Qt whitepaper and datasheet: http://qt.nokia.com/products/les/pdf/qt-4.6-whitepaper http://qt.nokia.com/products/les/pdf/qt-cross-platform-application-framework-datasheet

Qt Creator Whitepaper

2009 Nokia Corporation and/or its subsidiary(-ies)

2.

Working with Qt Creator


Qt Creator meets its design goals of simplicity, ease-of-use, and productivity by relying on the concept of modes. These adapt the user interface to the different application development tasks encountered.

Each mode has its own view that shows only the information required for performing a given task and provides only the most relevant features and functions related to it. As a result, the majority of the Qt Creator window area is always dedicated to actual application development tasks. To illustrate this, Figure 1 presents the key parts of Qt Creators user interface (UI).

Figure 1: The main parts of Qt Creator user interface in Edit mode.

To swap between modes quickly, Qt Creator has a Mode Selector on the left of the window. With the aid of selector, or using a set of keyboard shortcuts, the user can access one of the following modes at a time: Welcome to load recent sessions or specific projects. Edit to modify the active project and its source files. Debug to inspect the state of the program while debugging. Projects to configure how the projects are built and executed. Help to view documentation, such as the Qt reference documentation and the Qt Creator documentation. Output enables examining various data in detail, for instance, build issues, compilation and application output. 2

Qt Creator Whitepaper

2009 Nokia Corporation and/or its subsidiary(-ies)

Figure 2: The advanced C++ code editor of Qt Creator.

Beneath the Mode Selector are command buttons for executing, starting debugging, and building the current project. In the Edit and Debug modes, the Sidebar is shown. This displays all the files that belong to the active project. These modes display and provide access to the currently open files in a bar on the top of the window. The bar also displays a Symbol Overview which displays the symbols related to the current file, as well as the symbol at the current location inside the file. The Locator below the Sidebar enables the user to quickly locate a file, or access information from the files in the project. Next to the Locator are controls for showing one of the four different Output panes in the bottom of the window: Build issues displays the warnings and errors related to the current build. Search results shows the results of global searches within current document, files, or projects. Application output shows the status of the application during the execution as well as debug information when debugging the application. Compile output displays all the output provided by the compiler. The use of these special purpose panes together with specialized views for each mode, makes Qt Creator intuitive to use and encourages task-oriented development.

Qt Creator Whitepaper

2009 Nokia Corporation and/or its subsidiary(-ies)

2.1.

A Project Wizard for Qt Projects

Setting up a new project in Qt Creator is aided by a wizard that guides the user step-by-step through the project creation process. In the first step, the user selects the type of the project from the categories: Qt console application, Qt GUI (Graphical User Interface) application, or Qt library. Next, the user can select a location for the project, Qt specific settings (such as select the needed modules), before specifying the details of the first class of the application. When the steps have been completed, Qt Creator will automatically generate the project with required headers, source files, user interface descriptions and project files, as defined by the wizard. Not only does the wizard help new users get up and running quickly, it also enables more experienced users to streamline their workflow for the creation of new projects. The convenient user interface makes it easier to ensure that a project begins with the correct configuration and dependencies.

2.2.

Advanced C++ Code Editor

Writing, editing and navigating in source code are core tasks in application development. Therefore, the C++ code editor is one of the key components of Qt Creator. Figure 2 shows an example of the Edit view, where the editor fills most of the window area. As can be seen in Figure 2, the C++ editor offers a number of features that help developers maintain readability and coding style: Syntax highlighting for keywords, symbols, and macros. Code completion for class members, methods and function arguments, accessible through a keyboard shortcut, supporting both Qt classes and the users own classes in the current project. Live marking (wavy underlining in red) of errors while editing, making it unnecessary to use compilation simply as a way to find typos and syntax errors. Auto-indentation for source code layout. The ability to collapse and expand functions in the source code (code folding). In addition to these features, the editor has other useful features, such as: Incremental search that highlights the matching strings in the window while typing. Line numbering and current line highlighting. Easy commenting and uncommenting of code. Quick switching between method definition and function declaration. Bookmarks for easier navigation in the code. In addition to this, the C++ code editor supports different keyboard shortcuts for faster editing. It is possible to work without using the mouse at all, allowing the developer to keep their hands on the keyboard and work more productively. 4

Qt Creator Whitepaper

2009 Nokia Corporation and/or its subsidiary(-ies)

Figure 3: The integrated Qt Designer tool in action.

2.3.

Integrated Qt Designer

When in the Edit mode, Qt Creator provides a fully integrated Qt Designer for editing user interface files. This presents the developer with an intuitive drag-and-drop interface for composing new user interfaces. The user interfaces that are designed with Qt Designer are fully functional and can be previewed immediately to ensure that the design is as intended. There is no need to recompile the entire project to test out a new design. Figure 3 shows integrated Qt Designer being used to edit a simple form. Figure 3 shows how Qt Designer is integrated into Qt Creator. The center of the view is used for the construction of the user interface, with the available UI components (widgets) kept in the container on the left side of the window. Other tools are positioned around the edge of the working area. These include the Object Inspector (top-right), which shows the hierarchy of the objects in the current user interface, and the Property Editor (right), used to configure the currently selected widget. In addition, the user can use the integrated Qt Designer for many other tasks, such as connecting signals and slots, creating actions for toolbars and menus, and setting the tab order. The Qt Designer integration also includes project management and code completion. Qt Designer and related Qt features are described in more detail in the Qt whitepaper.

Qt Creator Whitepaper

2009 Nokia Corporation and/or its subsidiary(-ies)

Figure 4: Displaying context sensitive Qt Help information.

2.4.

Integrated Qt Help

From time to time, application developers may need further information about a certain class, function, or other part of the Qt API. All of Qts documentation and examples are accessible via Qt Help plugin in Qt Creator. To view the documentation, the Help mode is used, where most of the window is devoted to the help text. While working with source code in Edit mode, the user can access context sensitive help by moving the text cursor to a Qt class or function and then press the F1 key. The documentation will be displayed within a panel on the right side of the code editor, as shown in Figure 4. It is also possible to add external documentation to Qt Creator, complementing or replacing the existing documentation as required.

2.5.

Build System Support

As well as providing support for qmake, Qts own build tool, Qt Creator also comes with support for CMake, a popular alternative. CMake is a cross-platform configuration and build tool that works with the native compiler toolchains on Windows, Mac OS X, Linux and other platforms that the tool supports. Qt Creator also supports generic projects, where developers either use an unsupported build system, or do not want to associate a build system with their project at all. In cases like these, Qt Creator works as a code editor, and build settings can be manually specified in the projects configuration.

Qt Creator Whitepaper

2009 Nokia Corporation and/or its subsidiary(-ies)

Figure 5: The Locator navigation tool for quick access to files and information.

2.6.

Locator for Navigating between Files and Information

While editing source code, the developer often needs to move between different files, and to access multiple sources of information. The Locator tool (Figure 5) is designed to make navigation more efficient for the user by introducing a set of keystrokes as shortcuts to information sources. When the user starts typing a text string in the Locator, it shows the files whose name contains the string in a pop-up list. As the user continues typing, the list is updated automatically. The wildcard characters (* and ?) can be used in search queries. The user can narrow down searches by adding a prefix character followed by space before the search string. A set of standard prefixes are available, enabling developers to search all files, search files in the current project, search all open documents, locate classes and methods, open help topics, and navigate to a certain line in the current document. Developers can add custom filters to restrict the results to those from certain files. This makes it more convenient for developers who spend most of their time working with specific libraries or projects.

2.7.

Version Control Systems

Qt Creator supports a number of version controls systems, integrating their use into the working environment. Supported systems include Git, Subversion, CVS and Perforce. Configuration is straightforward, with common settings for version control located together and features for specific version control systems located in Tools sub-menus. Output for each system is shown in the Version Control output pane. User interface elements for displaying commits and managing repositories are also provided for certain systems.

Qt Creator Whitepaper

2009 Nokia Corporation and/or its subsidiary(-ies)

3.

Compiling and debugging

Currently, Qt Creator supports the GCC compiler and GDB debugger from the GNU Compiler Collection as well as the Microsoft Visual Studio compiler and debugger (cl and cdb). Qt Creator provides a debugging mode that provides a graphical user interface for the debugger you use for your project. Figure 6 shows Qt Creator in Debug mode with the debugging tools pane below the code editor. In this mode, the developer can perform common debugging tasks, including the following: Interrupt program execution. Step through the program line-by-line or instruction-by-instruction. Set breakpoints. Examine call stack contents, watchers, and local and global variables. The debugger is aware of the structure of many Qt classes, thus increasing its ability to display Qts data clearly. In addition, Qt Creator displays the raw information from GDB in a clear and concise manner. The developer can select a set of tools to display debugging information in the debugging pane. Although the most frequently used panels are shown by default, it is possible to change them to suit your preferences. It is also possible to change the panels positions and sizes, and use the new configuration in future sessions. Breakpoints can be set at a specific line or at a specific function. A red marker next to the line number on the left in the code editor shows a breakpoint set at a specific line in the source code (Figure 6). When the program execution is stopped during the debugging, the Call Stack lists all the frames, which represent the nested function calls leading to the current position. For each function in call stack, Qt Creator tries to retrieve its location (the name of source code file and the related line number) and present it in the Stack view. However, as shown in Figure 6, some functions in call stack may not have any debug information available. These frames are then shown as grayed out. The top stack call frame (or the selected), is displayed in the Locals and Watchers view. The view itself shows the function and the local variables. An example of this can be seen in Figure 6 where the compound variables are displayed as an expandable tree. The figure also shows Qt Creators comprehensive display of data inside instances of Qts core classes, which is one features that makes the Qt Creator debugger more powerful than other alternatives for developing Qt applications.

Qt Creator Whitepaper

2009 Nokia Corporation and/or its subsidiary(-ies)

Figure 6: The debug mode of Qt Creator showing a breakpoint in the editor view, and call stack view and a watch view.

Qt Creator Whitepaper

2009 Nokia Corporation and/or its subsidiary(-ies)

4.

Summary

Qt Creator offers a complete development environment for Qt application creation. It is a lightweight tool with a strict focus on Qt application developer-specific needs, productivity, and usability. Key features are the advanced C++ code editor and a graphical user interface for debugging. Integrating Qt Designer, Qt Help, and the Locator tool for quick navigation, makes Qt Creator the ideal environment developing Qt applications. Qt Creators mode-centric way of working helps developers to focus on the task at hand by presenting only relevant user interface features to them. Support for cross-platform build systems and version control software ensures that Qt Creator can be integrated fully into a development teams working environment. Qt Creator is available from http://qt.nokia.com/products/developer-tools/developer-tools.

10

Nokia, the Nokia logo, Qt, and the Qt logo are trademarks of Nokia Corporation and/or its subsidiary(-ies) in Finland and other countries. Additional company and product names are the property of their respective owners and may be trademarks or registered trademarks of the individual companies and are respectfully acknowledged. For its Qt products, Nokia operates a policy of continuous development. Therefore, we reserve the right to make changes and improvements to any of the products described herein without prior notice. All information contained herein is based upon the best information available at the time of publication. No warranty, express or implied, is made about the accuracy and/or quality of the information provided herein. Under no circumstances shall Nokia Corporation be responsible for any loss of data or income or any direct, special, incidental, consequential or indirect damages whatsoever. Copyright 2009 Nokia Corporation and/or its subsidiary(-ies).

This document is licensed under the Creative Commons Attribution-Share Alike 2.5 license. For more information, see http://creativecommons.org/licenses/by-sa/2.5/legalcode for the full terms of the license.

You might also like