這是歷史版本頁面 — 看 Qt (32-bit) 最新版本

Qt 到底能做什麼,寫桌面程式一定要用它嗎

Qt (32-bit) 軟體圖示 Qt (32-bit) 5.14.0 (32-bit) 資料更新 2019-12-12 閱讀約 6 分鐘

寫桌面程式的人大概都遇過這種時刻:你已經會寫 C++ 或 Python,想做出一個有視窗、有按鈕、能輸入文字的應用程式,但打開編輯器之後卻不知道從哪裡開始。用 Windows 內建的工具寫,介面陽春又綁死系統;上網找範例,套件裝了一堆還是跑不起來。你只是想讓程式有個像樣的介面,卻卡在「框架怎麼選」這一步,連第一行程式碼都還沒寫。

一般人遇到這種狀況,直覺是去找「最熱門」的解決方案,但熱門不代表適合。用網頁技術包裝的框架雖然上手快,跑起來卻又肥又慢;用微軟自家的方案,換到別的系統就要重寫。這類工具的切入點其實很簡單:讓你把介面和邏輯寫一次,就能在 Windows、macOS、Linux 甚至手機上跑,不用為每個平台各寫一套。問題是,這種「寫一次到處跑」的承諾,實際用起來到底划不划算,才是你真正該關心的。

01Qt 到底是做什麼用的?

它是一套跨平台的應用程式開發框架,主要用途是建立圖形介面(GUI)應用程式。你用它寫的程式可以編譯後在 Windows、macOS、Linux、Android 和 iOS 上執行。核心語言是 C++,另外可以透過 PyQt 或 PySide 綁定用 Python 開發。它提供現成的 UI 元件、網路、資料庫、多媒體等功能,不用自己從零刻。

02用這套軟體寫程式,一定要會 C++ 嗎?

不一定。官方支援的主要語言是 C++,但 Python 開發者可以透過 PyQt 或 PySide 綁定來使用,JavaScript 開發者則可以用 QML 這種宣告式腳本語言。也就是說,如果你只會 Python,還是能做出有圖形介面的應用程式,只是底層運作還是 C++ 引擎,你寫的是綁定層的程式碼。

03它能不能拿來寫手機 App?

可以。官方資料明確指出它支援 Android 和 iOS 開發,主要透過 Qt Quick 和 QML 來設計手機介面。不過要注意,這不是那種「寫一次直接轉成原生 App」的方案,你還是要針對手機的螢幕尺寸和操作習慣調整介面,而且手機端的效能和桌面端不能一概而論。

04介面可以做成什麼樣子?

有兩條路:Qt Widgets 和 Qt Quick。Qt Widgets 是傳統桌面風格,像 Windows 那種視窗、按鈕、選單的樣式,適合工具型軟體;Qt Quick 用 QML 語言,可以做出流暢、有動畫的現代化介面,適合需要客製化視覺效果的應用。兩者可以混用,但學習路徑不同,Widgets 比較直覺,QML 需要另外學一套語法。

05它除了做介面,還有什麼內建功能?

內建模組涵蓋網路程式設計(TCP/IP)、SQL 資料庫連線、多媒體影音處理、OpenGL 3D 圖形、感測器存取、WebView 網頁顯示等。也就是說,你不必為了連資料庫或開網路連線另外找套件,框架本身就提供對應的 API。另外還有 Qt Creator 這個整合開發環境,包含語法標記、除錯器和即時設計預覽。

06什麼樣的人適合用這套軟體?

適合已經會 C++ 或 Python、想寫跨平台桌面應用的人,尤其是你的目標是 Windows 和 macOS 都要跑、但不想維護兩套程式碼的狀況。也適合做嵌入式系統或車用介面的開發者,官方資料有提到 IoT 和汽車產業的應用。如果你本來就熟悉 C++,這套框架的學習曲線會比從零學新語言平緩很多。

07我只會 Python,用這套會不會很吃力?

會比直接用 C++ 輕鬆,但不會完全無痛。PyQt 和 PySide 綁定讓你可以用 Python 語法呼叫 Qt 的功能,但官方文件很多範例是 C++ 寫的,你要自己轉換。而且 QML 這套宣告式語言還是要另外學。如果你只是要一個簡單的視窗工具,Python 搭配這套綁定是可行的;但如果你要的是高效能或複雜介面,建議還是補一下 C++ 基礎。

08什麼情況不該選這套軟體?

如果你要寫高效能遊戲,官方自己都說它比較適合一般應用程式,不適合跟 Unity 或 Unreal 那種專門的遊戲引擎比。如果你只鎖定 Windows 平台、而且用 C#,那微軟自家的 .NET 方案(WPF、WinForms、MAUI)整合度更高。另外,如果你很在意安裝檔大小,官方資料承認它做出來的應用程式比原生 Windows UI 框架肥大。

09它是免費的嗎?

有開源版本,採用 GPL 和 LGPL 授權,非商業用途可以免費使用。但如果你要開發不開源的商業軟體,就要買商業授權,官方說價格依需求而異,沒有公開定價。這點要特別注意:用開源版寫商業軟體,你的程式碼可能被迫以 GPL 授權公開,不想這樣就得付費。

10這套軟體對電腦配備的要求高嗎?

官方列出的系統需求是 Windows 10 或 11 的 64 位元系統、Intel Core i3 以上處理器、至少 4GB 記憶體(建議 8GB)、5GB 硬碟空間,以及支援 OpenGL 的顯示卡。要注意的是,官方系統需求寫的是 64 位元,你看到的這個 32 位元版本可能不是官方目前主力支援的對象,安裝前最好確認你的環境符合需求。

11它跟 Qt Creator 有什麼關係?

Qt 是框架本身,Qt Creator 是官方提供的整合開發環境(IDE),兩者是不同東西。資料裡把它們列為「功能相近」的比較對象,但實際上 Qt Creator 是用來開發 Qt 應用程式的工具,內建專案管理、程式碼編輯、除錯和 UI 設計功能。你裝 Qt 的時候可以一併安裝 Qt Creator,也可以選擇用 Visual Studio 搭配官方提供的 Add-in 外掛來開發。

12這套軟體還有人在維護嗎?

有,而且更新算頻繁。資料顯示它收錄了 48 個版本,最近 12 個月內更新了 7 次,最近 24 個月內更新了 15 次,表示開發團隊持續在維護。另外官方也推出了 AI 輔助功能,可以自動產生測試案例、文件和 QML 程式碼,支援多種 LLM 模型,顯示這個專案不是放著不管的狀態。

下載與官方連結

前往官方網站 下載 Qt (32-bit)

qt-opensource-windows-x86-5.14.0.exe · 2.5 GB · 連結指向軟體原廠

版本紀錄

再看 5 筆

看完整版本清單

這一版改了什麼

What's new in this version:

- New Features (within existing modules)
- Qt 3D
- Threading architecture overhaul (removal of aspect thread)
- Frontend/Backend node sync overhaul
- QTransform now has access to the world matrix
- Introduction of Scene3DView
- Scene3D is now in sync with QtQuick
- Scene3D can now render as an underlay without FBO

Qt Bluetooth:
- [QTBUG-40698] Optional win32 backend to support Windows 7 and 8. Backend is not built by default and not part of the prebuild packages though.
- QLowEnergyController: Introduce AuthorizationError
- [QTBUG-76615] Ability to have multiple manufacturer data per manufacturer ID

Qt Core:
- QCalendar adds support for Calendars other than Gregorian, by implementation of suitable back-ends
- Back-ends to implement the Gregorian, Jalali (Persian), Islamic Civil, Milankovic, and Julian calendars. We look forward to other contributions
- [QTBUG-14150] Qt is now relocatable, i.e. it's possible to move the Qt installation without breaking functionality or loading of plugins

Qt GUI:
- QColorConstants provide constexpr QColor instances that don't cost any runtime overhead
- Updated High-DPI support
- Applications can now opt-in to use non-integer scale factors, for example Windows at 150%. Use QGuiApplication::highDpiScaleFactorRoundingPolicy or QT_SCALE_FACTOR_ROUNDING_POLICY to set the rounding policy
- Added the QT_ENABLE_HIGHDPI_SCALING environment variable which enables high-dpi scaling based on display DPI. Replaces QT_AUTO_SCREEN_SCALE_FACTOR (now deprecated), and corresponds to the Qt::AA_EnableHighDpiScaling application attribute
- The QT_FONT_DPI environment variable is now supported cross-platform, for the purpose of developing and testing with specific DPI values
- Color-space support for images. Reading and writing color-spaces from JPEG, PNG, WebP and TIFF images, and performing color-space transformation on images
- QTextDocument/QTextTable now support per-edge border styling via QTextTableCellFormat border-collapse mode HTML table style import (partial) and export
- QTextDocument supports reading and writing Markdown format, as an alternative to HTML. If you read HTML and write Markdown, or vice-versa, the formatting should be preserved to the extent that the CommonMark and GitHub specs allow (including headings, tables, bullet lists, block quotes and code blocks); but we don't guarantee all cases yet, because it's thinly tested so far

Qt Location:
- Qt Multimedia
- Added QVideoFrame::Format_YUV422P
- Introduced support of GStreamer OpenGL plugin

Qt Network:
- HTTP/2 configuration API
- Network connectivity monitoring
- [QTBUG-1538] Support Kerberos Proxy Authentication

Qt QML:
- Added qmlRegisterSingletonInstance function. This allows to expose a QObject as a singleton to QML, without having to create a factory function as required by qmlRegisterSingletonType. It is meant as a type safe replacement of setContextProperty in common usages
- Added qmlRegisterAnonymousType as a replacement for qmlRegisterType. It allows to specify the URI and major version, which enables better tooling support.
qmllint gained an experimental -U option. If run with it, it warns about accesses to unqualified identifiers

Qt Quick:
- Added the first preview of the graphics API independent scenegraph renderer as an opt-in feature. This allows running qualifying Qt Quick applications on top of Vulkan, Metal, or Direct3D 11 instead of OpenGL. The supported platforms are currently Windows 10, Linux with X11 (xcb), macOS with MoltenVK, or Android 7.0+ for Vulkan, macOS for Metal, Windows 10 for D3D
- Text and TextEdit now support Markdown format (CommonMark and GitHub dialects) as an alternative to HTML
- Includes the GitHub checklist extension, such that you can click to toggle checkboxes in a TextEdit
- TextEdit uses an I-beam cursor by default, and a pointing-hand cursor when hovering a checkbox or a link. You can still override the default cursor, though
- Added WheelHandler, an Event Handler for the mouse wheel, and optionally for emulated mouse wheel events coming from a trackpad
- Added BoundaryRule in Qt.labs.animation: a PropertyValueInterceptor that restricts the range of values a numeric property can have, applies "resistance" when the value is overshooting, and provides the ability to animate it back within range. It's particularly useful in combination with WheelHandler, to provide similar physics as Flickable has
- Event Handler base classes such as QQuickSinglePointHandler and QQuickMultiPointHandler have private implementation, while the classes themselves are suitable for subclassing, and are exported. They do not have supported public C++ API yet, but we encourage you to experiment with subclassing them anyway using the private API. They are intended to become public at some point in Qt 6 (and we can continue to iterate the API until then, especially to keep up with upcoming changes to the QEvent classes in Qt 6)
- Image and BorderImage now have the same currentFrame and frameCount properties that AnimatedImage has; this allows choosing an individual icon from an .ICO file that contains multiple icons, for example. In the future it's intended to support other multi-page formats such as PDF, TIFF and WEBP
- Added PathPolyline and PathMultiline as additional ways of drawing and/or filling arbitrary polygons and sets of polygons with Qt Quick Shapes

Qt Quick Controls 2:
Qt SerialBus
- Added operators to compare QCanBusDevice::Filter for equality or inequality
- Added the QCanBusDevice::OperationError and QCanBusDevice::TimeoutError codes to signal wrong operation respectively timeout errors
- Added the function QCanBusDevice::busStatus() to query the CAN bus status from the CAN bus device
- Added the function QCanBusDevice::resetController() to reset a CAN controller from bus off state
- SocketCAN: Added the configuration parameter QCanBusDevice::ProtocolKey to use another protocol inside the protocol family PF_CAN
- SocketCAN: If libsocketcan is available, the CAN bus bitrate can be get and set at runtime
- PeakCAN: Added support for PCAN-USB devices on macOS by using the MacCAN library
- Expose the underling QIODevice used for Modbus communication, e.g. for setting the serial port hardware flow control (RTS/CTS)

Qt Test:
- initMain() method to perform any initialization that needs to happen before QApplication exists
- Qt Wayland Compositor

Qt WebEngine:
- Updated to be based on Chromium 77
- New API for control of QWebEnginePage life-cycle
- Methods and properties for download item to get suggested name, and change the download directory and file name
- New findTextFinished signal and corresponding QWebEngineFindTextResult and FindTextResult types to get extra information about the result of a text search
- Added methods to QWebEngineCertificateError to asynchronously handle an error, and get a chain of digital certificates

Qt WebSockets:
- Qt Widgets
- QTextEdit and QTextBrowser now support Markdown format (CommonMark and GitHub dialects) as an alternative to HTML
- Includes the GitHub checklist extension, such that you can click to toggle checkboxes if the widget is editable
- QTextBrowser::setSource() detects Markdown based on the file extension

Platform Changes:
Android
- Android needs NDKr20+
- Added multi ABI build in one go. By default it will build for all android supported abis (arm64-v8a, armeabi-v7a, x86_64, x86). The user can control which ABIs he wants to use via ANDROID_ABIS qmake variable
- Added support for the new AAB package format, which allows deploying a single application bundle to Google Play which contains binaries for all supported ABIs

iOS
- Wayland

New Modules:
- Qt Quick Timeline
- Technology Preview Modules
- Added tech preview for Qt Quick 3D, a high-level API for creating 3D content for user interfaces from Qt Quick

Qt for Automation:
- Qt KNX
- Extended support for KNXnet/IP Core V2 (discovery, tunneling, routing, security)
- Qt Mqtt
- Added support for using QSslConfiguration when connecting encrypted
- Added autoKeepAlive property to enable manual connectivity checks
- Qt OPC UA
- Added tech preview for GDS client support
- Updated 3rdparty open62541 to version 1.0
- Qt CoAP
- The module leaves the Tech Preview status behind and an API commitment is given