• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kanagram

  • sources
  • kde-4.14
  • kdeedu
  • kanagram
  • src
mainwindow.cpp
Go to the documentation of this file.
1 /******************************************************************************
2  * This file is part of the Kanagram project
3  * Copyright 2011 Sebastian Kügler <sebas@kde.org>
4  * Copyright 2011 Marco Martin <mart@kde.org>
5  * Copyright 2012 Laszlo Papp <lpapp@kde.org>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include "mainwindow.h"
23 
24 #include "kdeclarativeview.h"
25 #include "kanagramgame.h"
26 #include "kanagramenginehelper.h"
27 
28 #include <QtDeclarative/QtDeclarative>
29 
30 MainWindow::MainWindow()
31 {
32  m_game = new KanagramGame();
33  m_engineHelper = new KanagramEngineHelper(m_game,this);
34 
35  declarativeView()->rootContext()->setContextProperty("kanagramGame",m_game);
36  declarativeView()->rootContext()->setContextProperty("kanagramEngineHelper",m_engineHelper);
37  declarativeView()->setPackageName("org.kde.kanagram");
38 
39  connect(declarativeView()->engine(), SIGNAL(quit()), qApp, SLOT(quit()));
40 
41 }
42 
43 MainWindow::~MainWindow()
44 {
45  delete m_engineHelper;
46  delete m_game;
47 }
48 
49 #include "mainwindow.moc"
QDeclarativeContext::setContextProperty
void setContextProperty(const QString &name, QObject *value)
kanagramgame.h
KanagramEngineHelper
Definition: kanagramenginehelper.h:37
KDeclarativeView::setPackageName
void setPackageName(const QString &packageName)
Sets the package from where load the application QML UI The package must be of the type "Generic pack...
Definition: kdeclarativeview.cpp:77
kanagramenginehelper.h
kdeclarativeview.h
mainwindow.h
KDeclarativeMainWindow::declarativeView
KDeclarativeView * declarativeView() const
Definition: kdeclarativemainwindow.cpp:102
MainWindow::MainWindow
MainWindow()
Definition: mainwindow.cpp:30
KanagramGame
game api
Definition: kanagramgame.h:41
MainWindow::~MainWindow
~MainWindow()
Definition: mainwindow.cpp:43
QDeclarativeView::rootContext
QDeclarativeContext * rootContext() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:12:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kanagram

Skip menu "kanagram"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal