Commit 0ecf21a8 authored by Volker Krause's avatar Volker Krause
Browse files

Adapt to QQuickItem::geometryChanged() rename in Qt6

parent bd8cd9fc
Pipeline #146262 passed with stage
in 8 minutes and 35 seconds
......@@ -454,17 +454,29 @@ void AppletsLayout::releaseSpace(ItemContainer *item)
m_layoutManager->releaseSpace(item);
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void AppletsLayout::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
#else
void AppletsLayout::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
#endif
{
// Ignore completely moves without resize
if (newGeometry.size() == oldGeometry.size()) {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QQuickItem::geometryChanged(newGeometry, oldGeometry);
#else
QQuickItem::geometryChange(newGeometry, oldGeometry);
#endif
return;
}
// Don't care for anything happening before startup completion
if (!m_containment || !m_containment->corona() || !m_containment->corona()->isStartupCompleted()) {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QQuickItem::geometryChanged(newGeometry, oldGeometry);
#else
QQuickItem::geometryChange(newGeometry, oldGeometry);
#endif
return;
}
......@@ -474,7 +486,11 @@ void AppletsLayout::geometryChanged(const QRectF &newGeometry, const QRectF &old
m_layoutChangeTimer->start();
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QQuickItem::geometryChanged(newGeometry, oldGeometry);
#else
QQuickItem::geometryChange(newGeometry, oldGeometry);
#endif
}
void AppletsLayout::updatePolish()
......
......@@ -179,7 +179,11 @@ Q_SIGNALS:
protected:
bool childMouseEventFilter(QQuickItem *item, QEvent *event) override;
void updatePolish() override;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
#else
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
#endif
// void classBegin() override;
void componentComplete() override;
......
......@@ -373,10 +373,18 @@ QQmlListProperty<QObject> ItemContainer::contentData()
return QQmlListProperty<QObject>(this, nullptr, contentData_append, contentData_count, contentData_at, contentData_clear);
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void ItemContainer::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
#else
void ItemContainer::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
#endif
{
syncChildItemsGeometry(newGeometry.size());
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QQuickItem::geometryChanged(newGeometry, oldGeometry);
#else
QQuickItem::geometryChange(newGeometry, oldGeometry);
#endif
Q_EMIT contentWidthChanged();
Q_EMIT contentHeightChanged();
}
......
......@@ -137,7 +137,11 @@ public:
}
protected:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
#else
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
#endif
// void classBegin() override;
void componentComplete() override;
......
......@@ -279,7 +279,11 @@ void PreviewWidget::hoverLeaveEvent(QHoverEvent *e)
unsetCursor();
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void PreviewWidget::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
#else
void PreviewWidget::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
#endif
{
Q_UNUSED(newGeometry)
Q_UNUSED(oldGeometry)
......
......@@ -48,7 +48,11 @@ protected:
void paint(QPainter *) override;
void hoverMoveEvent(QHoverEvent *event) override;
void hoverLeaveEvent(QHoverEvent *e) override;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
#else
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
#endif
private:
void layoutItems();
......
......@@ -284,11 +284,19 @@ void PreviewItem::dispatchEnterLeave(QWidget *enter, QWidget *leave, const QPoin
}
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void PreviewItem::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
#else
void PreviewItem::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
#endif
{
if (m_widget && newGeometry != oldGeometry) {
m_widget->resize(qRound(newGeometry.width()), qRound(newGeometry.height()));
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QQuickPaintedItem::geometryChanged(newGeometry, oldGeometry);
#else
QQuickPaintedItem::geometryChange(newGeometry, oldGeometry);
#endif
}
......@@ -47,7 +47,11 @@ protected:
void hoverMoveEvent(QHoverEvent *event) override;
void hoverLeaveEvent(QHoverEvent *event) override;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
#else
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
#endif
private:
void sendHoverEvent(QHoverEvent *event);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment