When building KConfigWidgets, the only non-copying constructor for KColorScheme is skipped by some rule: [...] KColorScheme(const KColorScheme & __0); [...] // Discarded CONSTRUCTOR on line 327 'KColorScheme' (by Qt5Ruleset.py:FunctionRuleDb[11],function_discard) [...] Also, there seems to be no way to customize templates for the binding generator (please correct me if i’m wrong), so this bug isn’t fixable until the sip customizations in extra-cmake-modules are modified to allow custom templates per project.
This bug is fixed in shaheed’s fork of extra-cmake-modules: https://github.com/ShaheedHaque/extra-cmake-modules
To construct a KColorScheme, use https://api.kde.org/frameworks/kconfigwidgets/html/classKColorScheme.html#a286db1b24ea2cd06dcdb71f8d92205cc
As Phil noted in comment #1, I don't think there is any reasonable fix for the fork in the KDE repos, because this fork basically ignored templates. SIP needs something called a %MappedType to implement the template, and %MethodCode to call the template logic. Now, my version of the code has rules+logic which trigger template generation causing, for example, this to be emitted in KConfigWidgets/KColorScheme.sip: =========== class KColorScheme { ... KColorScheme(QPalette::ColorGroup __0, KColorScheme::ColorSet __1 = KColorScheme::View, QExplicitlySharedDataPointer<KSharedConfig> __2 = KSharedConfigPtr()) [(QPalette::ColorGroup __0, KColorScheme::ColorSet __1 = KColorScheme::View, QExplicitlySharedDataPointer<KSharedConfig> __2 = KSharedConfigPtr())]; %MethodCode // Generated for CONSTRUCTOR on line 324 'KColorScheme::KColorScheme' (by builtin_rules.py:function_rules[1],function_uses_templates): {'(void)': ['QPalette::ColorGroup(INTEGER)', 'KColorScheme::ColorSet(INTEGER)', 'QExplicitlySharedDataPointer<KSharedConfig>(OBJECT)']} Py_BEGIN_ALLOW_THREADS sipCpp = new sipKColorScheme(a0, a1, *a2); Py_END_ALLOW_THREADS %End } =========== plus the following autogenerated template logic in KConfigWidgets/KConfigWidgetsmod.sip: =========== %MappedType QExplicitlySharedDataPointer<KSharedConfig> { // Generated for PARM_DECL on line 534 'KStatefulBrush::KStatefulBrush::__2' (by PyQt.py:parameter_rules[4],pointer_parameter): ['KSharedConfig(OBJECT)'] %TypeHeaderCode #include <QExplicitlySharedDataPointer> %End %ConvertFromTypeCode typedef KSharedConfig CxxvalueT; const sipTypeDef *genvalueT = sipType_KSharedConfig; // Convert the value from C++. PyObject *value = sipConvertFromType((void *)sipCpp->data(), genvalueT, sipTransferObj); if (value == NULL) { PyErr_Format(PyExc_TypeError, "cannot convert value"); return 0; } return value; %End %ConvertToTypeCode const char *cxxvalueS = "KSharedConfig"; typedef KSharedConfig CxxvalueT; const sipTypeDef *genvalueT = sipType_KSharedConfig; PyObject *value; // Convert the value to C++. value = sipPy; int valueState; CxxvalueT *cxxvalue = reinterpret_cast<CxxvalueT *>(sipForceConvertToType(value, genvalueT, sipTransferObj, SIP_NOT_NONE, &valueState, sipIsErr)); if (*sipIsErr) { if (cxxvalue == NULL) { PyErr_Format(PyExc_TypeError, "value has type '%s' but '%s' is expected", Py_TYPE(value)->tp_name, cxxvalueS); } sipReleaseType((void *)cxxvalue, genvalueT, valueState); return 0; } sipReleaseType((void *)cxxvalue, genvalueT, valueState); *sipCppPtr = new QExplicitlySharedDataPointer<CxxvalueT>(cxxvalue); return sipGetState(sipTransferObj); %End }; =========== (Note, as I stated in my post, the above code has not been tested, only compiled). The KDE version has no equivalent, afaik.
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version? If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging Thank you for helping us make KDE software even better for everyone!