This article explains the most important technical details about development in August: UIQt module, its refactoring, a new feature based development approach, and its benefits.

UIQt module is a collection of UI components backed by Qt. We only use it for Editor UI at the moment.

Here is a list of UIQt module components with their description and current code size:

№

Component

Description

Size (B)

Size (%)

1

UIQtAction

Actions (events) for menus

11224

9

2

UIQtAux

Initializes Qt and main window. Provides widget resolution by name to other components

15518

12

3

UIQtDock

Widget docks

5273

4

4

UIQtFileDialog

File selection dialogs

8960

7

5

UIQtMenu

Menus for main window and pop-ups (like node's add/copy/paste/delete menu)

4566

3

6

UIQtMenuBar

Menu bar for main window

4222

3

7

UIQtRunner

Allows to start QApplication

2450

2

8

UIQtThumbnailDialog

Dialog with thumbnail images

18615

14

9

UIQtToolBar

Tool bar for main window

4276

3

10

UIQtTree

Provides complex widgets like Scene tree and Property browser

51216

39

11

UIQtWidget

Common widget properties like focus and visibility

5465

4

UIQt module refactoring purpose was to replace old State API with new Environment API, which allows to achieve the same functionality with less code, i.e., makes development easier and faster.

Refactoring started in July and should have been done the same month. However, we only finished the work in August. Initial plan assumed 28 hours would be enough, but we spent 65 instead. We estimated planned time by relying on the number of public API calls of each component. That worked fine for small components, because the number of their public API calls was roughly equal to the number of their features, and features themselves were very small. However, it totally failed for UIQtTree, which contains 39% of UIQt module code, because there was no direct connection between public API and features.

Feature based development approach was born as a result of UIQtTree refactoring struggle. Since Qt uses MVC, UIQtTree component consists of several classes. By the time UIQtTree could display and manage a hierarchy of items, the component was already 27K in size. We noticed UIQtTree started to require abnormal amount of development time even for tiny features. This was an obvious quantitative complexity manifestation.

We decided to separate UIQtTree into base part and additional ones. Base would only contain minimal code required by all features. Addition would contain specific feature code and could be safely modified. In the case of UIQtTree, item hierarchy display and modification is the minimal functionality, while item renaming is an addition.