if (!component->isLoading()) {
_q_sourceLoaded();
} else {
- QObject::connect(component, SIGNAL(statusChanged(QDeclarativeComponent::Status)),
+ QObject::connect(component, SIGNAL(statusChanged(QDeclarativeComponent::ComponentStatus)),
q, SLOT(_q_sourceLoaded()));
QObject::connect(component, SIGNAL(progressChanged(qreal)),
q, SIGNAL(progressChanged()));
\sa progress
*/
-QDeclarativeLoader::Status QDeclarativeLoader::status() const
+QDeclarativeLoader::LoaderStatus QDeclarativeLoader::status() const
{
Q_D(const QDeclarativeLoader);
if (d->component)
- return static_cast<QDeclarativeLoader::Status>(d->component->status());
+ return static_cast<QDeclarativeLoader::LoaderStatus>(d->component->status());
if (d->item)
return Ready;
class Q_AUTOTEST_EXPORT QDeclarativeLoader : public QDeclarativeImplicitSizeItem
{
Q_OBJECT
- Q_ENUMS(Status)
+ Q_ENUMS(LoaderStatus)
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
Q_PROPERTY(QDeclarativeComponent *sourceComponent READ sourceComponent WRITE setSourceComponent RESET resetSourceComponent NOTIFY sourceChanged)
Q_PROPERTY(QGraphicsObject *item READ item NOTIFY itemChanged)
- Q_PROPERTY(Status status READ status NOTIFY statusChanged)
+ Q_PROPERTY(LoaderStatus status READ status NOTIFY statusChanged)
Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
public:
void setSourceComponent(QDeclarativeComponent *);
void resetSourceComponent();
- enum Status { Null, Ready, Loading, Error };
- Status status() const;
+ enum LoaderStatus { Null, Ready, Loading, Error };
+ LoaderStatus status() const;
qreal progress() const;
QGraphicsObject *item() const;
// ...
component = new QDeclarativeComponent(engine, QUrl("http://www.example.com/main.qml"));
if (component->isLoading())
- QObject::connect(component, SIGNAL(statusChanged(QDeclarativeComponent::Status)),
+ QObject::connect(component, SIGNAL(statusChanged(QDeclarativeComponent::ComponentStatus)),
this, SLOT(continueLoading()));
else
continueLoading();
*/
/*!
- \enum QDeclarativeComponent::Status
+ \enum QDeclarativeComponent::ComponentStatus
Specifies the loading status of the QDeclarativeComponent.
/*!
\property QDeclarativeComponent::status
- The component's current \l{QDeclarativeComponent::Status} {status}.
+ The component's current \l{QDeclarativeComponent::ComponentStatus} {status}.
*/
-QDeclarativeComponent::Status QDeclarativeComponent::status() const
+QDeclarativeComponent::ComponentStatus QDeclarativeComponent::status() const
{
Q_D(const QDeclarativeComponent);
*/
/*!
- \fn void QDeclarativeComponent::statusChanged(QDeclarativeComponent::Status status)
+ \fn void QDeclarativeComponent::statusChanged(QDeclarativeComponent::ComponentStatus status)
Emitted whenever the component's status changes. \a status will be the
new status.
Q_DECLARE_PRIVATE(QDeclarativeComponent)
Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
- Q_PROPERTY(Status status READ status NOTIFY statusChanged)
+ Q_PROPERTY(ComponentStatus status READ status NOTIFY statusChanged)
Q_PROPERTY(QUrl url READ url CONSTANT)
public:
QDeclarativeComponent(QDeclarativeEngine *, const QUrl &url, QObject *parent = nullptr);
virtual ~QDeclarativeComponent();
- Q_ENUMS(Status)
- enum Status { Null, Ready, Loading, Error };
- Status status() const;
+ Q_ENUMS(ComponentStatus)
+ enum ComponentStatus { Null, Ready, Loading, Error };
+ ComponentStatus status() const;
inline bool isNull() const
- { return status() == Null; }
+ { return status() == ComponentStatus::Null; }
inline bool isReady() const
- { return status() == Ready; }
+ { return status() == ComponentStatus::Ready; }
inline bool isError() const
- { return status() == Error; }
+ { return status() == ComponentStatus::Error; }
inline bool isLoading() const
- { return status() == Loading; }
+ { return status() == ComponentStatus::Loading; }
QList<QDeclarativeError> errors() const;
Q_INVOKABLE QString errorString() const;
static QDeclarativeComponentAttached *qmlAttachedProperties(QObject *);
Q_SIGNALS:
- void statusChanged(QDeclarativeComponent::Status);
+ void statusChanged(QDeclarativeComponent::ComponentStatus);
void progressChanged(qreal);
protected:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QDeclarativeComponent::Status)
+Q_DECLARE_METATYPE(QDeclarativeComponent::ComponentStatus)
QML_DECLARE_TYPE(QDeclarativeComponent)
QML_DECLARE_TYPEINFO(QDeclarativeComponent, QML_HAS_ATTACHED_PROPERTIES)
qRegisterMetaType<QVariant>("QVariant");
qRegisterMetaType<QDeclarativeScriptString>("QDeclarativeScriptString");
qRegisterMetaType<QScriptValue>("QScriptValue");
- qRegisterMetaType<QDeclarativeComponent::Status>("QDeclarativeComponent::Status");
+ qRegisterMetaType<QDeclarativeComponent::ComponentStatus>("QDeclarativeComponent::ComponentStatus");
QDeclarativeData::init();
if (!component->isLoading()) {
q->continueExecute();
} else {
- QObject::connect(component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), q, SLOT(continueExecute()));
+ QObject::connect(component, SIGNAL(statusChanged(QDeclarativeComponent::ComponentStatus)), q, SLOT(continueExecute()));
}
}
}
This signal is emitted when the view is resized to \a size.
*/
-/*! \fn void QDeclarativeView::statusChanged(QDeclarativeView::Status status)
+/*! \fn void QDeclarativeView::statusChanged(QDeclarativeView::ViewStatus status)
This signal is emitted when the component's current \a status changes.
*/
}
/*!
- \enum QDeclarativeView::Status
+ \enum QDeclarativeView::ViewStatus
Specifies the loading status of the QDeclarativeView.
\value Null This QDeclarativeView has no source set.
/*!
\property QDeclarativeView::status
- The component's current \l{QDeclarativeView::Status} {status}.
+ The component's current \l{QDeclarativeView::ViewStatus} {status}.
*/
-QDeclarativeView::Status QDeclarativeView::status() const
+QDeclarativeView::ViewStatus QDeclarativeView::status() const
{
Q_D(const QDeclarativeView);
if (!d->component)
return QDeclarativeView::Null;
- return QDeclarativeView::Status(d->component->status());
+ return QDeclarativeView::ViewStatus(d->component->status());
}
/*!
void QDeclarativeView::continueExecute()
{
Q_D(QDeclarativeView);
- disconnect(d->component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), this, SLOT(continueExecute()));
+ disconnect(d->component, SIGNAL(statusChanged(QDeclarativeComponent::ComponentStatus)), this, SLOT(continueExecute()));
if (d->component->isError()) {
QList<QDeclarativeError> errorList = d->component->errors();
{
Q_OBJECT
Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode)
- Q_PROPERTY(Status status READ status NOTIFY statusChanged)
+ Q_PROPERTY(ViewStatus status READ status NOTIFY statusChanged)
Q_PROPERTY(QUrl source READ source WRITE setSource DESIGNABLE true)
- Q_ENUMS(ResizeMode Status)
+ Q_ENUMS(ResizeMode ViewStatus)
public:
explicit QDeclarativeView(QWidget *parent = nullptr);
QDeclarativeView(const QUrl &source, QWidget *parent = nullptr);
ResizeMode resizeMode() const;
void setResizeMode(ResizeMode);
- enum Status { Null, Ready, Loading, Error };
- Status status() const;
+ enum ViewStatus { Null, Ready, Loading, Error };
+ ViewStatus status() const;
QList<QDeclarativeError> errors() const;
Q_SIGNALS:
void sceneResized(QSize size); // ???
- void statusChanged(QDeclarativeView::Status);
+ void statusChanged(QDeclarativeView::ViewStatus);
private Q_SLOTS:
void continueExecute();