Skip to content
Snippets Groups Projects
Commit 705f53e9 authored by Pierre Lamot's avatar Pierre Lamot Committed by Jean-Baptiste Kempf
Browse files

qml: fix race condition while initializing FlickableScrollHandler

fix: #27890
parent 71c6ce8d
No related branches found
No related tags found
1 merge request!3345qml: fix race condition while initializing FlickableScrollHandler
Pipeline #318884 passed with stage
in 18 minutes and 13 seconds
......@@ -34,8 +34,6 @@ FlickableScrollHandler::FlickableScrollHandler(QObject *parent)
});
setScaleFactor(1.0);
QMetaObject::invokeMethod(this, &FlickableScrollHandler::init, Qt::QueuedConnection);
}
FlickableScrollHandler::~FlickableScrollHandler()
......@@ -43,7 +41,11 @@ FlickableScrollHandler::~FlickableScrollHandler()
detach();
}
void FlickableScrollHandler::init()
void FlickableScrollHandler::classBegin()
{
}
void FlickableScrollHandler::componentComplete()
{
assert(parent());
......
......@@ -22,8 +22,9 @@
#include <QQmlProperty>
#include <QPointer>
#include <QQuickItem>
#include <QQmlParserStatus>
class FlickableScrollHandler : public QObject
class FlickableScrollHandler : public QObject, public QQmlParserStatus
{
Q_OBJECT
......@@ -35,6 +36,8 @@ class FlickableScrollHandler : public QObject
Q_PROPERTY(bool fallbackScroll MEMBER m_fallbackScroll NOTIFY fallbackScrollChanged FINAL)
Q_PROPERTY(bool handleOnlyPixelDelta MEMBER m_handleOnlyPixelDelta NOTIFY handleOnlyPixelDeltaChanged FINAL)
Q_INTERFACES(QQmlParserStatus)
public:
explicit FlickableScrollHandler(QObject *parent = nullptr);
~FlickableScrollHandler();
......@@ -46,6 +49,9 @@ public:
void setScaleFactor(qreal newScaleFactor);
void setEnabled(bool newEnabled);
void classBegin() override;
void componentComplete() override;
signals:
void initialized();
......@@ -57,8 +63,6 @@ signals:
void handleOnlyPixelDeltaChanged();
private slots:
void init();
void adjustScrollBarV();
void adjustScrollBarH();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment