Core: Allow plain widgets in IOptionPage::setWidgetCreator()

They were internally stored as QWidget anyway and only used as
IOptionsPageWidget after qobject_cast, with a sane default
implementation if they are not.

Change-Id: I98c73fb1221ba6f05e52d9f79ccd0f4c2fc7fa69
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2024-07-26 11:53:04 +02:00
parent 0ace1802a1
commit 8af2f68493

View File

@@ -56,7 +56,7 @@ public:
QString displayCategory() const; QString displayCategory() const;
Utils::FilePath categoryIconPath() const; Utils::FilePath categoryIconPath() const;
using WidgetCreator = std::function<IOptionsPageWidget *()>; using WidgetCreator = std::function<QWidget *()>;
void setWidgetCreator(const WidgetCreator &widgetCreator); void setWidgetCreator(const WidgetCreator &widgetCreator);
virtual QWidget *widget(); virtual QWidget *widget();