Qt 4.8
qdeclarativeview.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtDeclarative module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QDECLARATIVEVIEW_H
43 #define QDECLARATIVEVIEW_H
44 
45 #include <QtCore/qdatetime.h>
46 #include <QtCore/qurl.h>
47 #include <QtGui/qgraphicssceneevent.h>
48 #include <QtGui/qgraphicsview.h>
49 #include <QtGui/qwidget.h>
50 #include <QtDeclarative/qdeclarativedebug.h>
51 
53 
55 
56 QT_MODULE(Declarative)
57 
58 class QGraphicsObject;
59 class QDeclarativeEngine;
61 class QDeclarativeError;
62 
65 {
66  Q_OBJECT
71 public:
72  explicit QDeclarativeView(QWidget *parent = 0);
73  QDeclarativeView(const QUrl &source, QWidget *parent = 0);
74  virtual ~QDeclarativeView();
75 
76  QUrl source() const;
77  void setSource(const QUrl&);
78 
79  QDeclarativeEngine* engine() const;
80  QDeclarativeContext* rootContext() const;
81 
82  QGraphicsObject *rootObject() const;
83 
84  enum ResizeMode { SizeViewToRootObject, SizeRootObjectToView };
85  ResizeMode resizeMode() const;
86  void setResizeMode(ResizeMode);
87 
88  enum Status { Null, Ready, Loading, Error };
89  Status status() const;
90 
91  QList<QDeclarativeError> errors() const;
92 
93  QSize sizeHint() const;
94  QSize initialSize() const;
95 
96 Q_SIGNALS:
97  void sceneResized(QSize size); // ???
98  void statusChanged(QDeclarativeView::Status);
99 
100 private Q_SLOTS:
101  void continueExecute();
102 
103 protected:
104  virtual void resizeEvent(QResizeEvent *);
105  virtual void paintEvent(QPaintEvent *event);
106  virtual void timerEvent(QTimerEvent*);
107  virtual void setRootObject(QObject *obj);
108  virtual bool eventFilter(QObject *watched, QEvent *e);
109 
110 private:
113 };
114 
116 
118 
119 #endif // QDECLARATIVEVIEW_H
Error
Definition: qaudio.h:58
QSize sizeHint() const
Reimplemented Function
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
EventRef event
#define QT_MODULE(x)
Definition: qglobal.h:2783
The QDeclarativeView class provides a widget for displaying a Qt Declarative user interface...
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
ResizeMode
This enum specifies how to resize the view.
virtual void timerEvent(QTimerEvent *)
This event handler can be reimplemented in a subclass to receive timer events for the object...
Definition: qobject.cpp:1294
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
static LibLoadStatus status
Definition: qlocale_icu.cpp:69
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
Definition: qglobal.h:2523
static QObject * rootObject
#define Q_SLOTS
Definition: qobjectdefs.h:71
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
#define Q_SIGNALS
Definition: qobjectdefs.h:72
#define Q_ENUMS(x)
Definition: qobjectdefs.h:84
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
void resizeEvent(QResizeEvent *event)
Reimplemented Function
The QResizeEvent class contains event parameters for resize events.
Definition: qevent.h:349
ResizeMode resizeMode
whether the view should resize the canvas contents
The QDeclarativeError class encapsulates a QML error.
#define Q_OBJECT
Definition: qobjectdefs.h:157
virtual bool eventFilter(QObject *, QEvent *)
Filters events if this object has been installed as an event filter for the watched object...
Definition: qobject.cpp:1375
#define Q_DECLARATIVE_EXPORT
Definition: qglobal.h:1454
The QTimerEvent class contains parameters that describe a timer event.
Definition: qcoreevent.h:341
The QDeclarativeEngine class provides an environment for instantiating QML components.
Status status
The component&#39;s current status.
The QDeclarativeContext class defines a context within a QML engine.
QUrl source
The URL of the source of the QML component.
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
Definition: qgraphicsview.h:64
void paintEvent(QPaintEvent *event)
Reimplemented Function
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
#define Q_DECLARE_PRIVATE(Class)
Definition: qglobal.h:2467
Status
Specifies the loading status of the QDeclarativeView.
The QPaintEvent class contains event parameters for paint events.
Definition: qevent.h:298
The QGraphicsObject class provides a base class for all graphics items that require signals...
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56
#define QT_END_HEADER
Definition: qglobal.h:137