Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

Portal:Desktop: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Added section about IDEs)
 
(15 intermediate revisions by 3 users not shown)
Line 6: Line 6:
First of all you need to install a suitable operating system (OS) on your development machine. From now on we'll call that development machine the ''host machine'' and the OS it runs we'll call the '''host platform'''. The choice for a suitable host platform depends on what we'll call the '''target platform'''. The target platform is the OS on which the applications you are going to develop will run on.
First of all you need to install a suitable operating system (OS) on your development machine. From now on we'll call that development machine the ''host machine'' and the OS it runs we'll call the '''host platform'''. The choice for a suitable host platform depends on what we'll call the '''target platform'''. The target platform is the OS on which the applications you are going to develop will run on.


In simple words:
<u>In simple words:</u>
* If you want to write programs that run on '''Linux''' then for development you'll need a computer that also runs '''Linux'''.
* If you want to write programs that run on '''Linux''' then for development you'll need a computer that also runs '''Linux'''.
* If you want to write programs that run on '''Windows''' then for development you'll need a computer that also runs '''Windows'''.
* If you want to write programs that run on '''Windows''' then for development you'll need a computer that also runs '''Windows'''.
Line 14: Line 14:


=== Choosing a Suitable Compiler ===
=== Choosing a Suitable Compiler ===
Qt is a C++ framework and works will all standard compliant C++ compilers. It's up to you which one you want to use. If you don't have any special demands then do this:
Qt is a C++ framework and works with all standard compliant C++ compilers. It's up to you which one you want to use. <u>If you don't have any special demands then do this:</u>


* On '''Linux''', use the '''GCC''' compiler that comes with your Linux distribution.
* On '''Linux''', use the '''GCC''' compiler that comes with your Linux distribution.
Line 22: Line 22:
GCC and Clang are free software.
GCC and Clang are free software.


MSVC is not free software. You'll need a developer license to use MSVC. Luckily it is available as a free of charge "community edition". Consult Microsoft for license details.
MSVC is not free software. You'll need a developer license to use MSVC. Luckily it is available as a free of charge "community edition". Consult Microsoft for licensing details.


If you can't or don't want to use MSVC ''and'' your host platform is Windows 7 or Windows 8.1, but ''not'' Windows 10, then you can instead use the GCC port for Windows, called '''MinGW'''.
=== Choosing an IDE ===
 
First of all, you don't have to use an IDE (integrated development environment) at all. You can just write your software with your favorite text editor and compile your programs on the command line. Also, if you want to use an IDE, the choice which one you want to use is up to you. If you're already familiar with development on Windows then you'll probably also familiar with Microsoft Visual Studio. If you're an OS X developer then you'll most likely know Apple Xcode. Qt comes with its own IDE, Qt Creator. As you might already have guessed, Qt Creator was written specifically for software development with Qt. Thus it has all the stuff integrated you'll need: Intelligent code completion, syntax highlighting, help system, interactive GUI designers, and much more.
 
<u>In simple words:</u> '''Unless you know better use Qt Creator.'''
 
=== Choosing a Version Control System ===
 
If you're completely new to software development just skip this for now and come back to this in the future. Just for your information: Of course you can use any version control system with Qt. And of course you don't have to use one. But using a VCS should be just as normal to you as regularly making backups of your data. Qt Creator has integration for all common VCSs, e.g. [https://git-scm.com Git]. There are many VCSs available today with Git beeing the most advanced and most common in use. Furthermore, with services like [https://github.com Github] or [https://gitlab.com Gitlab] you can collaborate with other developers online and have a backup of all your software versions "in the cloud".
 
<u>In simple words:</u> '''Unless you know better use Git.'''


=== Choosing an IDE ===
=== Choosing a Qt Version ===


First of all, you don't have to use an IDE (integrated development environment) at all. You can just write your software with your favorite text editor and compile your programs on the command line. Also, if you want to use an IDE, the choice which one you want to use is up to you. If you're already familiar with development on Windows then you'll probably also familiar with Microsoft Visual Studio. If you're an OS X developer then you'll most likely know Apple Xcode. Qt comes with its own IDE, Qt Creator. As you might already have guessed, Qt Creator was written specifically for software development with Qt. Thus it has all all the stuff integrated you'll need: Intelligent code completion, syntax highlighting, help system, interactive GUI designers, and much more.  
Here you've got three choices:
* First choice is about the license. Qt is available as free software with most parts under the LGPL and other parts under GPL or BSD-like licenses. If you're fine with using Qt under these licensing terms then you can use the Qt Open Source Edition. If you're not fine with these terms you can buy a commercial license from The Qt Company that also comes with professional support.
* Second choice is about the release. Qt is constantly evolving. From time to time a new version is released. As of today two "main lines" exist: The old Qt 4 series and the current Qt 5 series. Although Qt 4 is no longer officially supported, as it was a very successful product, it is still widely used in many industries. See the [[Main#Quick Access (Portal)|table on the main page]] for the latest, recommended iteration of the Qt 5 series. Usually you will want to use this most recent version.
* Third choice is binary vs. source. You can get pre-compiled binaries of the Qt libraries and tools from our [https://www.qt.io/download download page]. But you can also [http://code.qt.io/cgit/ download the sources] and compile it by yourself. There are cases when you want to do the latter but in most cases you're better off using the pre-compiled libraries and tools. To make things even more complicated most Linux distributions offer their own pre-compiled versions of Qt. But these aren't always up to date.


In simple words: '''Unless you know better use Qt Creator.'''
<u>In simple words:</u>
* '''If you want to make money with your software buy a commercial license from The Qt Company. Otherwise use the Qt Open Source Edition.'''
* '''Unless you know better use the online installer from our [https://www.qt.io/download download page] to get the latest pre-compiled Qt release.'''


=== All Choices Made. Let's Go! ===


The actual situation is a bit more complex. Have a look at [[Supported Platforms]].
* See the [http://doc.qt.io/qt-5/supported-platforms.html Officially Supported Platforms] page to double check that your choice on a host platform and compiler is correct.
* Install the compiler of your choice and all the other basic requirements. Check out [[Basic Requirements Help]] to see how to do this.
* Do you want to use Git right from the start? Go to [https://www.git-scm.com their website], read the beginners tutorial and install Git on your host machine. Also visit services like [https://www.github.com Github] and [https://www.gitlab.com Gitlab] and see if you want to sign up.
* Read the [http://www.qt.io/faq/ Licensing FAQ] to double check that your choice on a Qt license is correct.
* Go to our [https://www.qt.io/download download page], download the online installer and use it to install the Qt libraries. The online installer will also install the Qt Creator IDE and all the other Qt tools you'll need. See [[Online Installer Help]] for guidance.


== Deployment ==
== Deployment ==
Line 42: Line 62:
* [[Build Standalone Qt Application for Windows]]
* [[Build Standalone Qt Application for Windows]]
* [[Set-Installed-File-Permissions-for-Linux]]
* [[Set-Installed-File-Permissions-for-Linux]]
* [[MesaLlvmpipe]]


== Installing / Building Qt ==
== Installing / Building Qt ==
Line 50: Line 71:
* [[Building_Qt_Desktop_for_Windows_with_MinGW]]
* [[Building_Qt_Desktop_for_Windows_with_MinGW]]
* [[Building Qt Desktop for Windows with MSVC]]
* [[Building Qt Desktop for Windows with MSVC]]
* [[Static_Qt_Build_for_Windows_with_GCC]]
* [[How to build a static Qt version for Windows with gcc]]
* [[Building a static Qt for Windows using MinGW]]
* [[Building a static Qt for Windows using MinGW]]
* [[Compiling-ICU-with-MSVC]]
* [[Compiling-ICU-with-MSVC]]
Line 84: Line 105:
* [[10 secret Ninja weapons for Qt Quick QML developers]]
* [[10 secret Ninja weapons for Qt Quick QML developers]]
* [[Connect a complex signal from QML to Qt]]
* [[Connect a complex signal from QML to Qt]]
* [[Creating-a-property-binding-from-JavaScript]]
* [[Drag and Drop within a GridView]]
* [[Drag and Drop within a GridView]]
* [[How to Bind a QML Property to a C++ Function]]
* [[How to Bind a QML Property to a C++ Function]]
Line 108: Line 128:


== Database ==
== Database ==
* [[Building the MySQL Plugin]]
* [[General Database Connection Dialog]]
* [[How to Store and Retrieve Image on SQLite]]
* [[How to Store and Retrieve Image on SQLite]]
* [[How to Use a QSqlQueryModel in QML]]
* [[How to Use a QSqlQueryModel in QML]]
Line 129: Line 147:
* [[WinRTBuild]]
* [[WinRTBuild]]
* [[WinRT TP1 deployment]]
* [[WinRT TP1 deployment]]
== OS X ==
* [[How to use OS X Notification Center]]


== Other ==
== Other ==
Line 144: Line 165:
* [[Handling CSV]]
* [[Handling CSV]]
* [[Handling Microsoft Excel file format]]
* [[Handling Microsoft Excel file format]]
* [[Handling OpenDocument Spreadsheet]]
* [[How to Use QSettings]]
* [[How to Use QSettings]]
* [[How to create a library with Qt and use it in an application]]
* [[How to create a library with Qt and use it in an application]]
Line 153: Line 173:
* [[Porting from GTK]]
* [[Porting from GTK]]
* [[Iterators]] / [[Performance Tip Optimizing Iteration]]
* [[Iterators]] / [[Performance Tip Optimizing Iteration]]
* [[Mixing C and ObjectiveC Code]]
* [[QFlags_tutorial]]
* [[QFlags_tutorial]]
* [[QVariant_Internals]]
* [[QVariant_Internals]]

Latest revision as of 11:23, 11 November 2016

En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh

Setting up Your Computer for Application Development

Choosing a Suitable Operating System

First of all you need to install a suitable operating system (OS) on your development machine. From now on we'll call that development machine the host machine and the OS it runs we'll call the host platform. The choice for a suitable host platform depends on what we'll call the target platform. The target platform is the OS on which the applications you are going to develop will run on.

In simple words:

  • If you want to write programs that run on Linux then for development you'll need a computer that also runs Linux.
  • If you want to write programs that run on Windows then for development you'll need a computer that also runs Windows.
  • If you want to write programs that run on OS X then for development you'll need a computer that also runs OS X.

Now, let's say your computer already runs operating system A but you want to write programs for operating system B. If you want to stay with A you can. You don't have to wipe your harddrive. You can install B in a virtual machine. So if your computer is a Mac you can install Linux and Windows in virtual machines and you're ready to target all three platforms with a single computer.

Choosing a Suitable Compiler

Qt is a C++ framework and works with all standard compliant C++ compilers. It's up to you which one you want to use. If you don't have any special demands then do this:

  • On Linux, use the GCC compiler that comes with your Linux distribution.
  • On Windows, use Microsoft Visual Studio Compiler 2015 (MSVC 2015).
  • On OS X, use the Clang compiler provided by Apple.

GCC and Clang are free software.

MSVC is not free software. You'll need a developer license to use MSVC. Luckily it is available as a free of charge "community edition". Consult Microsoft for licensing details.

Choosing an IDE

First of all, you don't have to use an IDE (integrated development environment) at all. You can just write your software with your favorite text editor and compile your programs on the command line. Also, if you want to use an IDE, the choice which one you want to use is up to you. If you're already familiar with development on Windows then you'll probably also familiar with Microsoft Visual Studio. If you're an OS X developer then you'll most likely know Apple Xcode. Qt comes with its own IDE, Qt Creator. As you might already have guessed, Qt Creator was written specifically for software development with Qt. Thus it has all the stuff integrated you'll need: Intelligent code completion, syntax highlighting, help system, interactive GUI designers, and much more.

In simple words: Unless you know better use Qt Creator.

Choosing a Version Control System

If you're completely new to software development just skip this for now and come back to this in the future. Just for your information: Of course you can use any version control system with Qt. And of course you don't have to use one. But using a VCS should be just as normal to you as regularly making backups of your data. Qt Creator has integration for all common VCSs, e.g. Git. There are many VCSs available today with Git beeing the most advanced and most common in use. Furthermore, with services like Github or Gitlab you can collaborate with other developers online and have a backup of all your software versions "in the cloud".

In simple words: Unless you know better use Git.

Choosing a Qt Version

Here you've got three choices:

  • First choice is about the license. Qt is available as free software with most parts under the LGPL and other parts under GPL or BSD-like licenses. If you're fine with using Qt under these licensing terms then you can use the Qt Open Source Edition. If you're not fine with these terms you can buy a commercial license from The Qt Company that also comes with professional support.
  • Second choice is about the release. Qt is constantly evolving. From time to time a new version is released. As of today two "main lines" exist: The old Qt 4 series and the current Qt 5 series. Although Qt 4 is no longer officially supported, as it was a very successful product, it is still widely used in many industries. See the table on the main page for the latest, recommended iteration of the Qt 5 series. Usually you will want to use this most recent version.
  • Third choice is binary vs. source. You can get pre-compiled binaries of the Qt libraries and tools from our download page. But you can also download the sources and compile it by yourself. There are cases when you want to do the latter but in most cases you're better off using the pre-compiled libraries and tools. To make things even more complicated most Linux distributions offer their own pre-compiled versions of Qt. But these aren't always up to date.

In simple words:

  • If you want to make money with your software buy a commercial license from The Qt Company. Otherwise use the Qt Open Source Edition.
  • Unless you know better use the online installer from our download page to get the latest pre-compiled Qt release.

All Choices Made. Let's Go!

  • See the Officially Supported Platforms page to double check that your choice on a host platform and compiler is correct.
  • Install the compiler of your choice and all the other basic requirements. Check out Basic Requirements Help to see how to do this.
  • Do you want to use Git right from the start? Go to their website, read the beginners tutorial and install Git on your host machine. Also visit services like Github and Gitlab and see if you want to sign up.
  • Read the Licensing FAQ to double check that your choice on a Qt license is correct.
  • Go to our download page, download the online installer and use it to install the Qt libraries. The online installer will also install the Qt Creator IDE and all the other Qt tools you'll need. See Online Installer Help for guidance.

Deployment

Installing / Building Qt

Widgets

QtQuick

2D

Database

Guidelines

WinRT

OS X

Other