diff options
| author | J-P Nurmi <jpnurmi@digia.com> | 2013-11-27 17:38:12 +0100 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-28 16:14:43 +0100 |
| commit | 1070aeb5521a95039cad3f4536e85e99526a4900 (patch) | |
| tree | 2b31244780d129053fd30274bc3662be34f45eb4 /examples/quick/controls/shared/qtquickcontrolsapplication.h | |
| parent | 605f63a1880400a5b540bab60ad68d3612bd71c1 (diff) | |
Revise main() in examples
Replace the inconvenient QT_QUICK_CONTROLS_EXAMPLE_MAIN macro with a
simpler macro that merely defines the actual application type. This way
it's easier to do tweaks to main() when for example testing a different
application font size. Moreover, browsing the example code becomes more
convenient (especially online).
Task-number: QTBUG-35083
Change-Id: I8203816a9112bf29b4661baa86bf4a196554db05
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'examples/quick/controls/shared/qtquickcontrolsapplication.h')
| -rw-r--r-- | examples/quick/controls/shared/qtquickcontrolsapplication.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/examples/quick/controls/shared/qtquickcontrolsapplication.h b/examples/quick/controls/shared/qtquickcontrolsapplication.h new file mode 100644 index 000000000..171de6c67 --- /dev/null +++ b/examples/quick/controls/shared/qtquickcontrolsapplication.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Quick Controls module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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 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, Digia gives you certain additional +** rights. These rights are described in the Digia 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. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QTQUICKCONTROLSAPPLICATION_H +#define QTQUICKCONTROLSAPPLICATION_H + +#ifdef QT_WIDGETS_LIB +#include <QtWidgets/QApplication> +#else +#include <QtGui/QGuiApplication> +#endif + +QT_BEGIN_NAMESPACE + +#ifdef QT_WIDGETS_LIB +#define QtQuickControlsApplication QApplication +#else +#define QtQuickControlsApplication QGuiApplication +#endif + +QT_END_NAMESPACE + +#endif // QTQUICKCONTROLSAPPLICATION_H |
