mirror of https://code.videolan.org/videolan/vlc
qt: remove unnecessary member in RoundImage
This commit is contained in:
parent
88c518596b
commit
4333661cdf
|
@ -170,19 +170,10 @@ QSGNode *RoundImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
|
|||
return node;
|
||||
}
|
||||
|
||||
void RoundImage::classBegin()
|
||||
{
|
||||
QQuickItem::classBegin();
|
||||
|
||||
m_isComponentComplete = false;
|
||||
}
|
||||
|
||||
void RoundImage::componentComplete()
|
||||
{
|
||||
QQuickItem::componentComplete();
|
||||
|
||||
Q_ASSERT(!m_isComponentComplete); // classBegin is not called?
|
||||
m_isComponentComplete = true;
|
||||
if (!m_source.isEmpty())
|
||||
regenerateRoundImage();
|
||||
}
|
||||
|
@ -197,7 +188,7 @@ qreal RoundImage::radius() const
|
|||
return m_radius;
|
||||
}
|
||||
|
||||
void RoundImage::setSource(QUrl source)
|
||||
void RoundImage::setSource(const QUrl& source)
|
||||
{
|
||||
if (m_source == source)
|
||||
return;
|
||||
|
@ -236,7 +227,7 @@ void RoundImage::setDPR(const qreal value)
|
|||
|
||||
void RoundImage::regenerateRoundImage()
|
||||
{
|
||||
if (!m_isComponentComplete || m_enqueuedGeneration)
|
||||
if (!isComponentComplete() || m_enqueuedGeneration)
|
||||
return;
|
||||
|
||||
m_roundImageGenerator.reset();
|
||||
|
|
|
@ -43,20 +43,18 @@ class RoundImage : public QQuickItem
|
|||
public:
|
||||
RoundImage(QQuickItem *parent = nullptr);
|
||||
|
||||
void classBegin() override;
|
||||
void componentComplete() override;
|
||||
|
||||
QUrl source() const;
|
||||
qreal radius() const;
|
||||
|
||||
public slots:
|
||||
void setSource(QUrl source);
|
||||
void setSource(const QUrl& source);
|
||||
void setRadius(qreal radius);
|
||||
|
||||
signals:
|
||||
void sourceChanged(QUrl source);
|
||||
void radiusChanged(int radius);
|
||||
void sourceSizeChanged(QSizeF sourceSize);
|
||||
void sourceChanged(const QUrl&);
|
||||
void radiusChanged(qreal);
|
||||
|
||||
protected:
|
||||
void itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &value) override;
|
||||
|
@ -90,7 +88,6 @@ private:
|
|||
TaskHandle<RoundImageGenerator> m_roundImageGenerator {};
|
||||
|
||||
bool m_enqueuedGeneration = false;
|
||||
bool m_isComponentComplete = true;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue