mirror of
https://github.com/videolan/vlc.git
synced 2024-12-12 11:13:34 +08:00
qml: fix race condition while initializing FlickableScrollHandler
fix: #27890
This commit is contained in:
parent
71c6ce8d05
commit
705f53e985
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user