Install the QT development environment in Ubuntu

Source: Internet
Author: User
Tags qt designer
Although many people use RedHat or Fedora as the host computer operating system on the network, I think Ubuntu is the most convenient, because most of the required software packages can be installed through apt-get, instead of compiling the source code. It is not easy to compile the source code by yourself, because unexpected and inexplicable errors often occur during the compilation process. The operating system we use is Ubuntu8.04. The latest version of QT4.4.0 is simple to install.

Although many people use RedHat or Fedora as the host computer operating system on the network, I think Ubuntu is the most convenient, because most of the required software packages can be installed through apt-get, instead of compiling the source code. It is not easy to compile the source code by yourself, because unexpected and inexplicable errors often occur during the compilation process.

The operating system we use is Ubuntu 8.04. Using the latest version of QT 4.4.0 is simple to install. Just run the following command:

Sudo apt-get install qt4-dev-tools qt4-doc qt4-qtconfig qt4-demos

Note that in this version of the software package, the qt4-dev-tools contains tools such as Qt Assistant and Qt Linguist, so you do not need to install them separately. Others, qt4-doc is a help document that contains detailed descriptions of various class libraries in Qt and a wide range of example programs that can be opened using Qt Assistant tools. The qt4-qtconfig is a dialog box for configuring the Qt environment, which is usually the default and is rarely necessary to change. The qt4-demos contains many executable files and source code that can run. A qt4-designer is a designer used to design a GUI.

To connect to the MySQL database, install the MySQL DRIVER:

Sudo apt-get install libqt4-sql-mysql

It is much easier to install and configure the Qt MySQL driver in Windows. If you need other Qt libraries that are not installed by default, you can enter sudo apt-get install libqt4 in the command line and press the tab key to automatically complete the installation, all software packages starting with libqt4-are listed, as shown in:

Screen. width-461) window. open ('HTTP: // www.qtcn.org/bbs/attachment/mon_0807/26_42555_1a35a23af2e7ffc.png'); "src =" http://www.qtcn.org/bbs/attachment/Mon_0807/26_44055_1a35a23af2e7ffc.png "border = 0>

You can use a command to complete these operations without compiling the source code. It is a practical tips to use the tab key to list all optional software packages without knowing the name.

In my project, I also need to draw some data curves and statistical charts, which are provided by a third-party QWT library. Similarly, you only need one command to complete the installation:

Sudo apt-get install libqwt5-qt4 libqwt5-qt4-dev

Open Qt Designer and you will find that the "Qwt widgets" group is added to the left Widget list.

Finally, I think QDevelop is very good about the integrated development environment. It works well with Qt Designer and has the function of prompting class member functions. Run the following command to install:

Sudo apt-get install qdevelop

In this way, you can use Qdevelop to write code, compile and debug, and use Qt Designer to design the interface, which is highly efficient in development.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.