Skip to content

Qt Widgets (Fusion)

The qt pack imitates desktop applications built with Qt 6 Widgets (C++, PySide6 or PyQt6) in Qt's cross-platform Fusion style with its default palette: Window #efefef, Base #ffffff, AlternateBase #f7f7f7, Highlight #308cc6, and in dark mode (Qt 6.5+ colour scheme) Window #323232, Base #242424, Text #f0f0f0. Controls have Fusion's faint vertical gradient, a 1 px outline and 2 px corners; item views are square framed panels with Highlight selection; the type is the desktop's 9 pt UI font ("Segoe UI", "Noto Sans", "DejaVu Sans" …, 12 px).

Select it with import QtWidgets (also Qt, Qt6, PySide, PyQt) or pack="qt". Elements use the Qt class names without the Q: MainWindow, MenuBar / Menu / Action / Separator, ToolBar / ToolButton, StatusBar, DockWidget, GroupBox, TabWidget, Splitter, PushButton, CheckBox, RadioButton, ComboBox, LineEdit, TextEdit, SpinBox, DateEdit, CalendarWidget, Slider, Dial, ProgressBar, LCDNumber, ListWidget, TreeWidget + HeaderView, TableView, MessageBox, FileDialog, DialogButtonBox, FormLayout + FormRow, ToolBox, Wizard / WizardPage, ChartView and more — mockitdown elements qt lists them all. Arguments follow the Qt properties (placeholderText:, currentText:, echoMode: .password, checkState:, toolButtonStyle:, alternatingRowColors:, calendarPopup: …), and icons accept freedesktop theme names ("document-save", "edit-copy") and QStyle standard pixmaps ("SP_DialogOkButton"). The reusable pieces below come from mockups/qt/widgets.mockitdown.

Qt's own Widgets Gallery example in Fusion: radio buttons and a tri-state check box, the push button variants (default, toggle, flat), a tool button with a menu, a command link, a tab widget with a table, a checkable group of simple input widgets, and a progress bar.

Widgets Gallery
Style:
Fusion
Color scheme:
Auto
Use style's standard paletteDisable widgets
Group 1
Radio button 1Radio button 2Radio button 3Tri-state check box
Group 2
Default Push ButtonToggle Push ButtonFlat Push Button
Tool Button
Command Link Button
TableText EditTree View
NameQtyPrice
Apples121.20
Pears40.95
Plums300.40
Figs72.10
Kiwis180.55
Group 3
••••••
50
11/24/2026 09:41
64%
Light
Widgets Gallery
Style:
Fusion
Color scheme:
Auto
Use style's standard paletteDisable widgets
Group 1
Radio button 1Radio button 2Radio button 3Tri-state check box
Group 2
Default Push ButtonToggle Push ButtonFlat Push Button
Tool Button
Command Link Button
TableText EditTree View
NameQtyPrice
Apples121.20
Pears40.95
Plums300.40
Figs72.10
Kiwis180.55
Group 3
••••••
50
11/24/2026 09:41
64%
Dark
Widgets Gallery
Source
import QtWidgets

VBoxLayout(spacing: 8) {
  HBoxLayout(spacing: 8) {
    Label("Style:")
    ComboBox(items: ["Fusion", "Windows"], currentText: "Fusion").frame(width: 120)
    Label("Color scheme:")
    ComboBox(items: ["Auto", "Light", "Dark"], currentText: "Auto").frame(width: 100)
    Spacer()
    CheckBox("Use style's standard palette", checked: true)
    CheckBox("Disable widgets")
  }
  GridLayout(columns: 2, spacing: 8) {
    GroupBox("Group 1") {
      RadioButton("Radio button 1", checked: true)
      RadioButton("Radio button 2")
      RadioButton("Radio button 3")
      CheckBox("Tri-state check box", checked: .indeterminate)
    }
    GroupBox("Group 2") {
      PushButton("Default Push Button", default: true)
      PushButton("Toggle Push Button", checked: true)
      PushButton("Flat Push Button").flat()
      HBoxLayout { ToolButton("Tool Button", popupMode: .menuButtonPopup); Spacer() }
      CommandLinkButton("Command Link Button")
    }
    TabWidget(selection: "Table") {
      Tab("Table") {
        TableWidget(columns: ["Name", "Qty", "Price"],
                    rows: [["Apples", 12, "1.20"], ["Pears", 4, "0.95"], ["Plums", 30, "0.40"], ["Figs", 7, "2.10"], ["Kiwis", 18, "0.55"]],
                    selection: [1])
      }
      Tab("Text Edit") { TextEdit("Twinkle, twinkle, little star") }
      Tab("Tree View") { TreeWidget { TreeWidgetItem("Item") } }
    }
    GroupBox("Group 3", checkable: true, checked: true) {
      LineEdit("s3cRe7", echoMode: .password).state(.focused)
      SpinBox(value: 50)
      DateTimeEdit(dateTime: "2026-11-24 09:41")
      HBoxLayout(spacing: 12) {
        VBoxLayout(spacing: 10) {
          Slider(value: 40, maximum: 100)
          ScrollBar(value: 60, maximum: 100)
        }
        .frame(maxWidth: .infinity)
        Dial(value: 30, maximum: 100, notchesVisible: true)
      }
    }
  }
  ProgressBar(value: 64)
}
.padding(9)

Document editor

A classic MainWindow: a menu bar with the Edit menu open (icons, shortcuts, a disabled action, a checkable action and a submenu), a tool bar of ToolButtons with a font combo box, a document-mode TabWidget with closable tabs around the central TextEdit, two stacked DockWidgets and a StatusBar with permanent widgets on the right.

release-notes.md — Text Editor
release-notes.mdCHANGELOGuntitled 1
# Text Editor 4.2

## New features

### Dark colour scheme
The editor now follows the system colour scheme (Qt 6.5 or later). Choose
View ▸ Appearance to force light or dark.

### Tabbed documents
Open several files in one window; drag a tab out to make a new window.
Document
Encoding:
UTF-8
Line endings:
LF
Tab width:
4
Insert spaces
Show whitespace
Outline
Release 4.2
Highlights
New features
Dark colour scheme
Tabbed documents
Spell checking
Fixed issues
Known issues
Light
release-notes.md — Text Editor
release-notes.mdCHANGELOGuntitled 1
# Text Editor 4.2

## New features

### Dark colour scheme
The editor now follows the system colour scheme (Qt 6.5 or later). Choose
View ▸ Appearance to force light or dark.

### Tabbed documents
Open several files in one window; drag a tab out to make a new window.
Document
Encoding:
UTF-8
Line endings:
LF
Tab width:
4
Insert spaces
Show whitespace
Outline
Release 4.2
Highlights
New features
Dark colour scheme
Tabbed documents
Spell checking
Fixed issues
Known issues
Dark
release-notes.md — Text Editor

Preferences

A preferences window: a TabWidget whose pages hold GroupBoxes, right-aligned FormLayout labels, a checkable group box, a KeySequenceEdit and the DialogButtonBox with the default OK button.

Preferences
GeneralEditorAppearanceShortcuts
Font
Family:
DejaVu Sans Mono
Size:
11 pt
Line spacing:
1.25
Behavior
Tab policy:
Spaces only
Tab size:
4
Auto-save every:
5 min
Complete shortcut:
Ctrl+Space
Highlight current line
Wrap long lines
Spell checking
Language:
English (US)
Restore Defaults
OKCancelApply
Preferences
Source
import QtWidgets

VBoxLayout(spacing: 9) {
  TabWidget(selection: "Editor") {
    Tab("General") { Label("") }
    Tab("Editor") {
      GroupBox("Font") {
        FormLayout {
          FormRow("Family:") { FontComboBox(currentText: "DejaVu Sans Mono") }
          FormRow("Size:") { SpinBox(value: 11, suffix: " pt").frame(width: 90) }
          FormRow("Line spacing:") { DoubleSpinBox(value: 1.25).frame(width: 90) }
        }
      }
      GroupBox("Behavior") {
        FormLayout {
          FormRow("Tab policy:") { ComboBox(items: ["Spaces only", "Tabs only"], currentText: "Spaces only") }
          FormRow("Tab size:") { SpinBox(value: 4).frame(width: 90) }
          FormRow("Auto-save every:") { SpinBox(value: 5, suffix: " min").frame(width: 90) }
          FormRow("Complete shortcut:") { KeySequenceEdit(keySequence: "Ctrl+Space") }
          FormRow("") { CheckBox("Highlight current line", checked: true) }
          FormRow("") { CheckBox("Wrap long lines") }
        }
      }
      GroupBox("Spell checking", checkable: true, checked: false) {
        FormLayout {
          FormRow("Language:") { ComboBox(items: ["English (US)"], currentText: "English (US)") }
        }
      }
    }
    Tab("Appearance") { Label("") }
    Tab("Shortcuts") { Label("") }
  }
  .frame(maxHeight: .infinity)
  DialogButtonBox {
    PushButton("Restore Defaults")
    Spacer()
    PushButton("OK", default: true)
    PushButton("Cancel")
    PushButton("Apply").disabled()
  }
}
.padding(9)

Data entry

An appointment form: a CalendarWidget (weekends in red, Highlight navigation bar) beside a FormLayout with an editable ComboBox, TimeEdit, SpinBox with a suffix, a DateEdit with a calendar popup, radio buttons in a horizontal layout and a PlainTextEdit.

New Appointment
November 2026
MoTuWeThFrSaSu262728293031123456789101112131415161718192021222324252627282930123456
Show week numbers
Patient:
Okafor, Chidi
Type:
Follow-up
Start:
10:30
Duration:
45 min
Remind on:
11/25/2026
Room:A-101A-102Telehealth
Notes:
Review blood work from 11/12.
Send confirmation e-mail
SaveCancel
New Appointment

Data browser

A database browser: a filter LineEdit, a column ComboBox and a checked tool button showing its ToolTip in the tool bar, a Splitter with a connection TreeWidget (with its HeaderView) on the left and a sorted TableView with alternating rows, row numbers and a selected row on the right.

Chinook.sqlite — DB Browser
Name
main
Tables (11)
albums
artists
customers
genres
invoices
tracks
Indices (10)
Views (2)
Triggers (0)
TrackIdNameAlbumComposerGenreMillisecondsUnitPrice
1For Those About To RockFor Those About To RockAngus Young, Malcolm YoungRock3437190.99
6Put The Finger On YouFor Those About To RockAngus Young, Malcolm YoungRock2056620.99
7Let's Get It UpFor Those About To RockAngus Young, Malcolm YoungRock2339260.99
15Go DownLet There Be RockAC/DCRock3311800.99
16Dog Eat DogLet There Be RockAC/DCRock2151960.99
17Let There Be RockLet There Be RockAC/DCRock3666540.99
18Bad Boy BoogieLet There Be RockAC/DCRock2677280.99
19Problem ChildLet There Be RockAC/DCRock3250410.99
20OverdoseLet There Be RockAC/DCRock3693190.99
21Hell Ain't A Bad Place To BeLet There Be RockAC/DCRock2543800.99
22Whole Lotta RosieLet There Be RockAC/DCRock3237610.99
23Walk On WaterBig OnesSteven Tyler, Joe PerryRock2956800.99
24Love In An ElevatorBig OnesSteven Tyler, Joe PerryRock3218280.99
25Rag DollBig OnesSteven Tyler, Joe PerryRock2646980.99
26What It TakesBig OnesSteven Tyler, Joe PerryRock3106220.99
27Dude (Looks Like A Lady)Big OnesSteven Tyler, Joe PerryRock2648550.99
Chinook.sqlite — DB Browser

Unsaved changes

A MessageBox with the standard warning icon, its text, the informative text and the Save / Discard / Cancel buttons (Save is the default button). Qt dialogs are separate windows: they do not dim their parent.

notes.txt — Text Editor
Groceries
- oat milk
- lemons
- basil
notes.txt — Text Editor
Source
import QtWidgets

MainWindow {
  MenuBar { Menu("File"); Menu("Edit"); Menu("View"); Menu("Help") }
  CentralWidget {
    PlainTextEdit(plainText: "Groceries\n- oat milk\n- lemons\n- basil").frame(maxHeight: .infinity)
  }
  StatusBar { Label("Modified") }
}

MessageBox("Text Editor", text: "The document has been modified.", icon: .warning,
           buttons: ["Save", "Discard", "Cancel"], primary: "Save") {
  Label("Do you want to save your changes?")
}

Qt Designer

A Designer-like layout: the Widget Box as a ToolBox of categories with a filter, the form being edited on Designer's dotted grid with a RubberBand selection, the Object Inspector (TreeWidget with Object / Class columns) and the Property Editor — a property grid built from the custom PropertyClass and Property components, with Designer's tinted class bands and bold modified properties.

Qt Widgets Designer — logindialog.ui
Widget Box
Filter
Layouts
Buttons
Push ButtonTool ButtonRadio ButtonCheck BoxCommand Link ButtonDialog Button Box
Item Views
Containers
Input Widgets
Display Widgets
logindialog.ui*
Sign in to ChinookUser name:
ana
Password:
••••••
Remember meCancelSign In
Object Inspector
ObjectClass
LoginDialogQDialog
buttonBoxQDialogButtonBox
passwordEditQLineEdit
rememberCheckQCheckBox
userEditQLineEdit
signInButtonQPushButton
Property Editor
Filter
signInButton : QPushButton
PropertyValue
QObject
objectNamesignInButton
QWidget
enabled
geometry[(258, 236), 90 x 24]
sizePolicy[Minimum, Fixed, 0, 0]
fontA [Segoe UI, 9]
QAbstractButton
textSign In
checkable
QPushButton
default
flat
Qt Widgets Designer — logindialog.ui

Bench monitor

An instrument panel: LCDNumber read-outs (the custom Readout component, used four times), Dials with notches, a Qt Charts ChartView line chart and bar chart in the Qt Charts light / dark themes, Sliders with tick marks and DoubleSpinBoxes for the set points.

Bench Monitor — PSU-3
Output voltage
12.04V
Output current
1.872A
Power
22.54W
Heat sink
41.7°C
Voltage and current (last 60 s)
Voltage (V)Current ×10 (A)
Set points
Voltage
Current limit
Voltage:
12.00 V
Current limit:
2.000 A
Ramp:
Output OnApply
Energy per channel (Wh, today)
CH1CH2
Protection
Over-voltage (OVP) at 13.2 VOver-current (OCP)Over-temperature (OTP)
42%
Fan duty
Bench Monitor — PSU-3

Walkthrough: exporting a table

Qt's own (non-native) FileDialog, shown here as its own window. Pick the folder in the Look in combo box 1 or the places side bar 2, select an existing file in the detail view 3 to reuse its name, type the File name 4 and choose the format in Files of type 5. Save 6 is the default button, so Enter confirms.

1
2
3Detail view
4
6
5
QFileDialog
Source
import QtWidgets
import "qt/widgets"

FileDialog("Export Table as CSV", inline: true) {
  HBoxLayout(spacing: 4) {
    Label("Look in:")
    ComboBox(items: ["/home/brian/Documents/exports"], currentText: "/home/brian/Documents/exports")
      .frame(maxWidth: .infinity)
      .callout(1, alignment: .top)
    ToolAction(icon: "go-previous"); ToolAction(icon: "go-next"); ToolAction(icon: "go-up")
    ToolAction(icon: "folder-new"); ToolAction(icon: "view-list-icons")
    ToolAction(icon: "view-list-details", checked: true)
  }
  Splitter {
    FileDialogSidebar(selection: "Documents")
      .frame(width: 130)
      .callout(2, alignment: .bottomLeading)
    TreeWidget {
      HeaderView(["Name", "Size", "Type", "Date Modified"])
      TreeWidgetItem("archive", icon: "folder") { Text(""); Text("Folder"); Text("11/02/26") }
      TreeWidgetItem("albums.csv", icon: "text-x-generic") { Text("21 KB"); Text("csv File"); Text("11/20/26") }
      TreeWidgetItem("tracks.csv", icon: "text-x-generic") { Text("312 KB"); Text("csv File"); Text("11/23/26") }
        .selected()
      TreeWidgetItem("invoices.csv", icon: "text-x-generic") { Text("88 KB"); Text("csv File"); Text("11/24/26") }
    }
    .frame(maxWidth: .infinity)
    .callout(3, "Detail view", alignment: .center)
  }
  .frame(maxHeight: .infinity)
  GridLayout(columns: [GridItem(.fixed(84)), GridItem(.flexible()), GridItem(.fixed(84))], spacing: 6) {
    Label("File name:")
    LineEdit("tracks.csv").state(.focused).callout(4, alignment: .trailing)
    PushButton("Save", default: true).callout(6, alignment: .topTrailing)
    Label("Files of type:")
    ComboBox(items: ["CSV (*.csv *.tsv)"], currentText: "CSV (*.csv *.tsv)").callout(5, alignment: .trailing)
    PushButton("Cancel")
  }
}

Custom components

The page imports qt/widgets from docs/mockups/qt/widgets.mockitdown. It defines ToolAction (an icon-only tool-bar button), Property and PropertyClass (Designer's property grid), Readout (an LCD instrument) and FileDialogSidebar (the places list of QFileDialog):

struct Readout: View {
  var title: String
  var value: String
  var unit: String
  var level: Double = 0.5
  var segmentStyle: String = "filled"

  var body: some View {
    GroupBox(title) {
      HBoxLayout(spacing: 6) {
        LCDNumber(value, segmentStyle: segmentStyle).frame(maxWidth: .infinity)
        Label(unit).frame(width: 34)
      }
      ProgressBar(value: level * 100, textVisible: false)
    }
  }
}