用戶界麵

The Qt framework's main user interface technologies are Qt Quick and Qt Widgets . Qt Quick interfaces are fluid, dynamic, and are best on touch interfaces. Qt Widgets are for creating complex desktop applications. You can create Qt Quick and Qt Widgets interfaces with the target platform's native look and feel.

Building UIs with Qt Quick

Qt Quick is for creating dynamic and fluid user interfaces. The Qt Quick Controls module supplies QML types such as buttons, dialogs, and menus. You can use QML , a declarative language, to build the UI and JavaScript to implement the logic.

The following list contains related overviews:

Qt Widgets User Interfaces

Qt Widgets are the user interface elements that are typical in desktop environments. The widgets integrate well to the underlying platform providing native look and feel on Windows, Linux and macOS. The widgets are mature and feature rich user interface elements suitable for mostly traditional user interfaces. In contrast to Qt Quick , the widgets are for creating large desktop applications and less suited for creating touch-centric applications with fluid interfaces.

The following list contains related overviews for Qt Widgets:

Comparison of UI Interfaces

The following table compares Qt Widgets and Qt Quick interfaces.

Qt Quick / Qt Quick Controls Qt Widgets 注釋
使用語言 QML/JS C++
Native look and feel Qt Widgets and Qt Quick Controls support native look and feel on their target platforms.
Custom styling Qt Widgets provide customization with style sheets and Qt Quick Controls has a selection of customizable styles .
流暢動畫 UI Qt Widgets 無法很好地適應動畫伸縮。Qt Quick 提供瞭按聲明方式實現動畫的方便且自然方式。
觸摸屏 Qt Widgets often require a mouse cursor for good interaction, whereas Qt Quick provides QML types for touch interaction.
標準行業 Widget Qt Widgets provide all the bells and whistles, developed over two decades, needed for building standard industry type applications.
模型/視圖編程 Qt Quick 提供方便視圖,但 Qt Widgets 提供更方便且完整的框架。除 Qt Quick 視圖外,Qt Quick Controls 還提供 TableView .
敏捷 UI 開發 Qt Quick 是敏捷 UI 原型設計和開發的絕佳抉擇。
HW (硬件) 加速圖形 Qt provides full hardware acceleration for Qt Quick interfaces and Qt Widgets interfaces are rendered in software. The 圖形 overview has more information.
圖形效果 Several Qt Quick modules provide graphical effects and Qt Widgets interfaces can use Qt GUI for effects.
富文本處理 目前,Qt Widgets 為實現文本編輯器提供最綜閤基。Qt 的富文本文檔類還可以用於 Qt Quick 和 Qt Quick Controls 的 TextArea ,但可能要求一些 C++ 實現。

The following pages contain more information about designing and developing user interfaces: