Skip to content

Port config dialogs from .ui to QFormLayout

Port all configuration dialog pages to QFormLayout in C++ code.

Approach

  • C++ instead of .ui files.
  • Put every control in a QFormLayout row.
  • Where possible, use only a single layout, i. e. no nesting.
  • Use rows with an empty QLabel as horizontal spacer. Content grouping by whitespace instead of group boxes.
  • Where group boxes were used for labeling tool managers, use a <h3> QLabel instead.
  • Where group boxes were used for labeling control groups, drop the label or label only the first control (like in Dolphin).
  • Use combo boxes instead of radio button groups. I don’t know how to connect radio buttons to KConfigWidgets...
  • Don’t use checkboxes as label, that doesn’t lay out correctly. Instead, put the checkbox in an own row, although it controls the same feature. (See todo list.)

(End of suggested commit message)

General page

config_general_change_formlayout (before/after, resized vertically to show everything)

  • Collapse document title and background color checkboxes into the following control?
  • Horizontal scroll bars, probably a bug in KPageWidget KConfigDialog? See frameworks/kconfigwidgets!12 (merged)

Accessibility page

config_accessibility_change_formlayout (before/after)

  • There is a QStackedWidget, with every page containing a QFormLayout (i. e. nested layout).
  • Collapse change colors checkbox into the combo box? (Normal colors mode)
  • Enable/disable the whole QStackWidget below the combo box, or only the controls inside?

Performance page

config_performance_change_formlayout (before/after)

  • Pixmap lost. Put it somewhere else? (The title line at the top can take an icon.)

Presentation page

config_presentation_change_formlayout (before/after, resized vertically to show everything)

  • Pretty noisy layout.
  • Collapse enable transitions checkbox to combo box below? (Don’t use transitions item)
  • Collapse advance automatically checkbox to spinbox below? (Disabled item)
  • Reorder to group navigation settings? That should make the layout quieter, I think.

Annotations page

config_annotations_change_formlayout (before/after)

Editor page

config_editor_change_formlayout_wide-0

TODO

  • Remove .ui files as soon as they are not needed anymore.
  • I made a PreferredScreenSelector class for the presentation page, so it can be connected to KConfigWidgets. Not related to QFormLayout, extract it to another MR.

Test Plan

  • Controls with wrong object names (including kcfg_onlySecondPartIsWrong) are not connected to KConfigWidgets.
  • The annotation tool manager always reports a modified setting, because XML does not care about attribute order, but KConfigWidgets compares only strings.
  • All controls toggle the Apply button when they are toggled, and are reset when pressing the Defaults button.
Edited by Laura David Hurka

Merge request reports