qml: implement childAt

Added a namespace-level parentWidget() helper, so it works for
both widgets and quick
This commit is contained in:
Sergio Martins
2020-08-06 17:50:44 +01:00
parent 64020568d6
commit 769d34d746
4 changed files with 19 additions and 2 deletions

View File

@@ -27,6 +27,12 @@
namespace KDDockWidgets {
/// @brief Helper since QQuickItem::parentItem() has a different name than QWidget::parentWidget()
inline QWidget *parentWidget(QWidget *widget)
{
return widget ? widget->parentWidget() : nullptr;
}
class FloatingWindow;
class DOCKS_EXPORT QWidgetAdapter : public QWidget