diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-05-22 19:03:56 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-06-16 06:50:07 +0000 |
commit | 30d931b866bf6cdf7900d0c7f85734e0bfe03a6f (patch) | |
tree | 059d5fa08602c93c103f90964316e4b4fc34586a /src/imports/platform/qtlabsplatformplugin.cpp | |
parent | bfb0a9ebe3b1dc6b0f06ec2d66469ba878fbe98b (diff) |
Setup a Qt.labs.platform module
This change just prepares the infrastructure and imports an icon
loader helper that will be used for the platform menu, dialog, and
system tray icon implementations.
Change-Id: I34a93050a7c988134c3daa986aca6021eac7a4d1
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/platform/qtlabsplatformplugin.cpp')
-rw-r--r-- | src/imports/platform/qtlabsplatformplugin.cpp | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/imports/platform/qtlabsplatformplugin.cpp b/src/imports/platform/qtlabsplatformplugin.cpp new file mode 100644 index 00000000..c691e1cf --- /dev/null +++ b/src/imports/platform/qtlabsplatformplugin.cpp @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Labs Templates module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later 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 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtQml/qqmlextensionplugin.h> +#include <QtQml/qqml.h> + +static inline void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_Qt_labs_platform); +#endif +} + +QT_BEGIN_NAMESPACE + +class QtLabsPlatformPlugin: public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + +public: + QtLabsPlatformPlugin(QObject *parent = nullptr); + void registerTypes(const char *uri) override; +}; + +QtLabsPlatformPlugin::QtLabsPlatformPlugin(QObject *parent) : QQmlExtensionPlugin(parent) +{ + initResources(); +} + +void QtLabsPlatformPlugin::registerTypes(const char *uri) +{ + Q_UNUSED(uri) +} + +QT_END_NAMESPACE + +#include "qtlabsplatformplugin.moc" |