KDEGames

kgdeclarativeview.cpp
1 /*
2  SPDX-FileCopyrightText: 2012 Viranch Mehta <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-only
5 */
6 
7 #include "kgdeclarativeview.h"
8 
9 // KF
10 #include <KDeclarative/KDeclarative>
11 #include <KLocalizedContext>
12 // Qt
13 #include <QQmlContext>
14 
15 class KgDeclarativeViewPrivate{};
16 
18  QQuickWidget(parent),
19  d(nullptr) //unused for now, for future expandability
20 {
21  QQmlEngine* engine = this->engine();
23 
24  KLocalizedContext *localizedContextObject = new KLocalizedContext(engine);
25  engine->rootContext()->setContextObject(localizedContextObject);
26 
28 }
29 
30 KgDeclarativeView::~KgDeclarativeView() = default;
static void setupEngine(QQmlEngine *engine)
QQmlEngine * engine() const const
QQmlContext * rootContext() const const
KgDeclarativeView(QWidget *parent=nullptr)
Construcs a new KgDeclarativeView with KDE specific environment.
void setContextObject(QObject *object)
void setResizeMode(QQuickWidget::ResizeMode)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Dec 7 2021 22:34:15 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.