Deprecating KDesignerPlugin in favour of new ECMAddQtDesignerPlugin
Closed, ResolvedPublic

Description

PROBLEM

as talked about recently, there are some issues with the current content & design of KF5's KDesignerPlugin module. Which currently provides:

  • a utility (kgendesignerplugin) that can be used to generate plugins for Qt Designer from ini-style description files, e.g. by using the CMake macro kf5designerplugin_add_plugin()
  • a single Qt Designer plugin for all the widgets in all the modules of KDE Frameworks

The issues with that single plugin are:

  • defeats the idea of independent modules in KDE Frameworks, at least with Linux/*BSD distributions: the plugin has a dependency on all the modules whose widgets it sports
  • is a separate module from the actual widget code, thus running chance of not getting updated in case widgets get extended/added/deprecated

The issues with the tool are:

  • another separate tool to use, so appearing as yet another dependency item

Now while the big plan seems to replace QWidgets with Qt Quick Controls one day, so far QWidgets are still here with us and might be a bit more. So it makes sense to invest a bit to improve the situation.

WANTED

Required:

  • each Frameworks module should be able to provide its own Qt Designer plugin for its widgets.
  • Creating the plugin should be an optional build feature, so one can disable that if e.g. building library modules for app bundles, where one never will need the plugin.

Optional:

  • does not create yet another dependency, even more for KDE Frameworks tier 1 modules.
  • simple to port to from old kgendesignerplugin usage

PROPOSED SOLUTION

Given that

  • CMake is the current standard build system generation tool with all libraries currently looked at where we want to have Qt Designer plugins for, and as of now nothing hints this will change soon
  • ECM is used already by all libraries currently looked at
  • CMake is able to be used for C++ code generation at configuration time, which is already made use of in ECM code
  • the code generated for Qt Designer plugins is not that complicated
  • part of the code for generating Qt Designer plugins is repeated CMake logic

an approach is to have another addition to ECM, named ECMAddQtDesignerPlugin, which does the generation of the plugin code directly.
Pro:

  • kgendesignerplugin was already wrapped by CMake macro logic
  • no additional dependency on external tool

Cons:

  • only works with CMake

Writing CMake code for parsing the ini-format of the .widgets files for configuring kgendesignerplugin might have been complicated, so as alternative some declaration macro is used with a metadata describing pattern modelled after the one of the ini format, so conversion can be done by copy, paste and modify.

Current set of patches:

  • Addition of the new ECM module: D22724
  • Deprecation of KDesignerPlugin, drop of single cross-KF5 plugin D22784
  • Own plugin for KWidgetsAddons: D22725
  • Own plugin for KIO: D22785
  • Own plugin for KIconThemes: D22790
  • Own plugin for KTextWidgets: D22791
  • Own plugin for KPlotting: D22792
  • Own plugin for KCompletion: D22793
  • Own plugin for Sonnet: D22794
  • Own plugin for KItemViews: D22795
  • Own plugin for KConfigWidgets: D22796
  • Own plugin for KXmlGui: D22798
  • Make KDEWebKit use ECMAddQtDesignerPlugin: D22777
  • Restore option for KSysguard Library to create a Qt Designer plugin: D22778

There was also a patch done to port kdelibs4support (D22776), but turns out it installs a macro using kgendesignerplugin, so I turned away from changing code there. No need to complicate things for something people should port away from anyway,

kossebau created this task.Jul 28 2019, 3:38 PM
kossebau claimed this task.
kossebau updated the task description. (Show Details)
kossebau added a subscriber: vkrause.
kossebau updated the task description. (Show Details)Jul 28 2019, 3:41 PM
kossebau updated the task description. (Show Details)Jul 28 2019, 3:46 PM
kossebau updated the task description. (Show Details)Jul 28 2019, 9:06 PM
kossebau updated the task description. (Show Details)Jul 28 2019, 9:27 PM
kossebau updated the task description. (Show Details)Jul 28 2019, 10:03 PM
aacid added a subscriber: aacid.Jul 29 2019, 7:46 PM

When you say "it only works with cmake".

How is that a con? I mean we only support building kde frameworks themselves with cmake anyway, don't we?

When you say "it only works with cmake".

How is that a con? I mean we only support building kde frameworks themselves with cmake anyway, don't we?

Right. Just, the development utils from ECM/KDE Frameworks are targetting more than KDE Frameworks and its (current) build system, aren't they? :) So limiting the solutions to cmake takes them away from people using qmake/qbs/meson/plain Makefiles/etc...

Seems people so far are fine with this approach, any comments were rather positive. No changes requested.

So unless someone objects, would then proceed to push all the listed diffs soon after KF 5.61 has been branched upcoming WE. Scheduling myself for Tuesday, August 6th currently, so there are some weeks to collect feedback from unreleased master branch experience.

Thanks anyone for review so far :)

kossebau closed this task as Resolved.Aug 6 2019, 3:23 PM