aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/util
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2011-11-21 11:38:26 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-24 07:43:21 +0100
commit89e1cba2f671c1c46f81dcd36a168f469315c8ee (patch)
treea8713c6092c9f9192caaafa8ea2aa50118bcc6b0 /src/declarative/util
parent40a4713735c3266aeca31151f6e98f7db4f1885d (diff)
Move QDeclarativeApplication from util/ to qml/
QDeclarativeEngine/QV8Engine depend on QDeclarativeApplication, so this class should reside under qml/, not util/. Change-Id: I2cd49ba1170bfb610a7607525891cb80c8828f27 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/declarative/util')
-rw-r--r--src/declarative/util/qdeclarativeapplication.cpp118
-rw-r--r--src/declarative/util/qdeclarativeapplication_p.h88
-rw-r--r--src/declarative/util/qdeclarativeutilmodule.cpp2
-rw-r--r--src/declarative/util/util.pri2
4 files changed, 0 insertions, 210 deletions
diff --git a/src/declarative/util/qdeclarativeapplication.cpp b/src/declarative/util/qdeclarativeapplication.cpp
deleted file mode 100644
index 765f8dd2cd..0000000000
--- a/src/declarative/util/qdeclarativeapplication.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qdeclarativeapplication_p.h"
-#include <private/qobject_p.h>
-#include <QtGui/QGuiApplication>
-#include <QtGui/QInputPanel>
-
-QT_BEGIN_NAMESPACE
-
-class QDeclarativeApplicationPrivate : public QObjectPrivate
-{
- Q_DECLARE_PUBLIC(QDeclarativeApplication)
-public:
- QDeclarativeApplicationPrivate() : active(QGuiApplication::activeWindow() != 0),
- layoutDirection(QGuiApplication::layoutDirection()) {}
- bool active;
- Qt::LayoutDirection layoutDirection;
-};
-
-/*
- This object and its properties are documented as part of the Qt object,
- in qdeclarativengine.cpp
-*/
-
-QDeclarativeApplication::QDeclarativeApplication(QObject *parent) : QObject(*new QDeclarativeApplicationPrivate(), parent)
-{
- if (qApp)
- qApp->installEventFilter(this);
-}
-
-QDeclarativeApplication::~QDeclarativeApplication()
-{
-}
-
-bool QDeclarativeApplication::active() const
-{
- Q_D(const QDeclarativeApplication);
- return d->active;
-}
-
-Qt::LayoutDirection QDeclarativeApplication::layoutDirection() const
-{
- Q_D(const QDeclarativeApplication);
- return d->layoutDirection;
-}
-
-QObject *QDeclarativeApplication::inputPanel() const
-{
- return qApp ? qApp->inputPanel() : 0;
-}
-
-bool QDeclarativeApplication::eventFilter(QObject *obj, QEvent *event)
-{
- Q_UNUSED(obj)
- Q_D(QDeclarativeApplication);
- if (event->type() == QEvent::ApplicationActivate
- || event->type() == QEvent::ApplicationDeactivate) {
- bool active = d->active;
- if (event->type() == QEvent::ApplicationActivate)
- active = true;
- else if (event->type() == QEvent::ApplicationDeactivate)
- active = false;
-
- if (d->active != active) {
- d->active = active;
- emit activeChanged();
- }
- }
- if (event->type() == QEvent::LayoutDirectionChange) {
- Qt::LayoutDirection direction = QGuiApplication::layoutDirection();
- if (d->layoutDirection != direction) {
- d->layoutDirection = direction;
- emit layoutDirectionChanged();
- }
- }
- return false;
-}
-
-QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativeapplication_p.h b/src/declarative/util/qdeclarativeapplication_p.h
deleted file mode 100644
index aa51085f01..0000000000
--- a/src/declarative/util/qdeclarativeapplication_p.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVEAPPLICATION_P_H
-#define QDECLARATIVEAPPLICATION_P_H
-
-#include <QtCore/QObject>
-#include <qdeclarative.h>
-#include <private/qdeclarativeglobal_p.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QDeclarativeApplicationPrivate;
-class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeApplication : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(bool active READ active NOTIFY activeChanged)
- Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection NOTIFY layoutDirectionChanged)
- Q_PROPERTY(QObject *inputPanel READ inputPanel CONSTANT)
-
-public:
- explicit QDeclarativeApplication(QObject *parent = 0);
- virtual ~QDeclarativeApplication();
- bool active() const;
- Qt::LayoutDirection layoutDirection() const;
- QObject *inputPanel() const;
-
-protected:
- bool eventFilter(QObject *obj, QEvent *event);
-
-Q_SIGNALS:
- void activeChanged();
- void layoutDirectionChanged();
-
-private:
- Q_DISABLE_COPY(QDeclarativeApplication)
- Q_DECLARE_PRIVATE(QDeclarativeApplication)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QDeclarativeApplication)
-
-QT_END_HEADER
-
-#endif // QDECLARATIVEAPPLICATION_P_H
diff --git a/src/declarative/util/qdeclarativeutilmodule.cpp b/src/declarative/util/qdeclarativeutilmodule.cpp
index 0a8f04b0de..4df3115eaf 100644
--- a/src/declarative/util/qdeclarativeutilmodule.cpp
+++ b/src/declarative/util/qdeclarativeutilmodule.cpp
@@ -59,7 +59,6 @@
#include "qdeclarativesystempalette_p.h"
#include "qdeclarativetimer_p.h"
#include "qdeclarativetransition_p.h"
-#include "qdeclarativeapplication_p.h"
#include <qdeclarativeinfo.h>
#include <private/qdeclarativetypenotavailable_p.h>
#ifndef QT_NO_XMLPATTERNS
@@ -76,7 +75,6 @@ void QDeclarativeUtilModule::registerBaseTypes(const char *uri, int versionMajor
void QDeclarativeUtilModule::defineModule()
{
- qmlRegisterUncreatableType<QDeclarativeApplication>("QtQuick",2,0,"Application", QDeclarativeApplication::tr("Application is an abstract class"));
qmlRegisterUncreatableType<QInputPanel>("QtQuick",2,0,"InputPanel", QInputPanel::tr("InputPanel is an abstract class"));
qmlRegisterUncreatableType<QDeclarativeAbstractAnimation>("QtQuick",2,0,"Animation",QDeclarativeAbstractAnimation::tr("Animation is an abstract class"));
diff --git a/src/declarative/util/util.pri b/src/declarative/util/util.pri
index 1d71225bf5..a93fff7f89 100644
--- a/src/declarative/util/util.pri
+++ b/src/declarative/util/util.pri
@@ -1,5 +1,4 @@
SOURCES += \
- $$PWD/qdeclarativeapplication.cpp \
$$PWD/qdeclarativeutilmodule.cpp\
$$PWD/qdeclarativeconnections.cpp \
$$PWD/qdeclarativepackage.cpp \
@@ -33,7 +32,6 @@ SOURCES += \
$$PWD/qdeclarativesvgparser.cpp
HEADERS += \
- $$PWD/qdeclarativeapplication_p.h \
$$PWD/qdeclarativeutilmodule_p.h\
$$PWD/qdeclarativeconnections_p.h \
$$PWD/qdeclarativepackage_p.h \