Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.12.5, 5.12.8
-
None
Description
We have a custom Button derived from QAbstractButton, and we're using it on a UI file.
The custom button is added to a Button Group.
When compiling the UI file into a .h file, no setup is implemented for the custom button, and if no other non-custom button is used, the Button Group is not even instantiated.
This is due to the result of the `isButton()` function call in `cppwritedeclaration.cpp` line 634.
Indeed that function returns true only for classes derived from some classes derived from `QAbstractButton`, but strangely enough, not from `QAbstractButton` .
See `uic.cpp` lines 256:
```
bool Uic::isButton(const QString &className) const{ return customWidgetsInfo()>extends(className, QLatin1String("QRadioButton")) || customWidgetsInfo()>extends(className, QLatin1String("QToolButton")) || customWidgetsInfo()>extends(className, QLatin1String("QCheckBox")) || customWidgetsInfo()>extends(className, QLatin1String("QPushButton")) || customWidgetsInfo()->extends(className, QLatin1String("QCommandLinkButton"));}
```
Adding `QAbstractButton` in that test fixes the issue and the code is generated correctly. the Custom Widget works fine and the Button Group correctly handles the functionality.