tests: Fix overloaded signal "parentChanged()"

This commit is contained in:
Sergio Martins
2021-01-08 18:24:51 +00:00
parent 39c3e4fd13
commit c73c26e5cb
4 changed files with 8 additions and 2 deletions

View File

@@ -784,7 +784,12 @@ void DockWidgetBase::Private::show()
void DockWidgetBase::onParentChanged()
{
#ifdef KDDOCKWIDGETS_QTWIDGETS
// TODO: In v1.4, remove this part and use the signal emitting the arg
Q_EMIT parentChanged();
#else
Q_EMIT parentChanged(this);
#endif
d->updateToggleAction();
d->updateFloatAction();
}

View File

@@ -374,8 +374,10 @@ public:
static DockWidgetBase* byName(const QString &uniqueName);
Q_SIGNALS:
#ifdef KDDOCKWIDGETS_QTWIDGETS
///@brief signal emitted when the parent changed
void parentChanged();
#endif
///@brief signal emitted when the DockWidget is shown. As in QEvent::Show.
void shown();

View File

@@ -135,7 +135,7 @@ void QWidgetAdapter::itemChange(QQuickItem::ItemChange change, const QQuickItem:
case QQuickItem::ItemParentHasChanged: {
QEvent ev(QEvent::ParentChange);
qApp->sendEvent(this, &ev); // Not calling event() directly, otherwise it would skip event filters
Q_EMIT parentChanged();
Q_EMIT parentChanged(this);
break;
}
case QQuickItem::ItemVisibleHasChanged: {

View File

@@ -176,7 +176,6 @@ public:
static QQuickItem *createItem(QQmlEngine *, const QString &filename);
static void makeItemFillParent(QQuickItem *item);
Q_SIGNALS:
void parentChanged();
void geometryUpdated(); // similar to QLayout stuff, when size constraints change
protected:
void create();