Qt 小工具画廊
Qt 对 Widget 风格和主题的支持可使您的应用程序与本地桌面环境相匹配。
窗口小部件示例展示了 Qt 中的一些窗口小部件在配置为使用特定样式时的外观。每种样式仅在相应的平台上可用,并通过与平台主题的集成提供本地外观和感觉。因此,最终外观会因活动主题而异。
Windows 风格("windows")由 QWindowsStyle 提供。
Windows Vista 风格("windowsvista")由 QWindowsVistaStyle 提供。
macOS 风格("macOS")由 QMacStyle 提供。
Fusion 风格("fusion")由 QFusionStyle 提供。
样式示例显示了以下部件:
- QCheckBox (1) 提供一个带有文本标签的复选框。
- QRadioButton (2) 提供一个带有文本或像素图标签的单选按钮。
- QPushButton (3) 提供一个命令按钮。
- QTabWidget (4) 提供一叠标签式窗口小部件。
- QTableWidget (5) 提供经典的基于项目的表格视图。
- QScrollBar (6) 提供垂直或水平滚动条。
- QProgressBar (7) 提供水平进度条。
- QDateTimeEdit (8) 提供一个用于编辑日期和时间的 widget。
- QSlider (9) 提供垂直或水平滑块。
- QDial (10) 提供一个圆形范围控件(如速度计或电位器)。
日历小部件示例显示了一些额外的小部件,此处在 Windows 10 和 macOS 上运行:
Windows 10 上的日历部件示例
MacOS 上的日历部件示例
- QGroupBox (1) 提供一个带有标题的组框。
- QCalendarWidget (2) 提供一个可用于选择日期的月历部件。
- QLabel (3) 提供文本或图片显示。
- QDateEdit (4) 提供一个用于编辑日期的 widget。
- QComboBox (5) 提供一个组合按钮和弹出列表。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.