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

kanagram

  • sources
  • kde-4.12
  • kdeedu
  • kanagram
  • src
  • harmattan
harmattan/main.cpp
Go to the documentation of this file.
1 /******************************************************************************
2  * This file is part of the Kanagram project
3  * Copyright (c) 2012 Laszlo Papp <lpapp@kde.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #include "kanagramenginehelper.h"
21 
22 #include <KDE/KGlobal>
23 #include <KDE/KStandardDirs>
24 #include <KDE/KComponentData>
25 #include <kdeclarative.h>
26 
27 #include <QtDeclarative/QDeclarativeView>
28 #include <QtDeclarative/QDeclarativeContext>
29 #include <QtGui/QApplication>
30 
31 #include <QtCore/QUrl>
32 
33 int main( int argc, char** argv )
34 {
35  QApplication app( argc, argv );
36  app.setOrganizationName( "KDE Kanagram" );
37  app.setApplicationName( "Kanagram Harmattan Frontend" );
38 
39  QDeclarativeView view;
40  QDeclarativeContext *ctxt = view.rootContext();
41 
42  KGlobal::dirs()->addResourceDir("data", "/opt/kanagram/share/");
43 
44  KanagramGame *kanagramGame = new KanagramGame();
45  ctxt->setContextProperty("kanagramGame", kanagramGame);
46 
47  KanagramEngineHelper kanagramEngineHelper(kanagramGame);
48  ctxt->setContextProperty("kanagramEngineHelper", &kanagramEngineHelper);
49 
50  KComponentData data("kanagram-harmattan");
51 
52  KDeclarative kdeclarative;
53  kdeclarative.setDeclarativeEngine(view.engine());
54  kdeclarative.initialize();
55  //binds things like kconfig and icons
56  kdeclarative.setupBindings();
57 
58  view.setSource(QUrl("qrc:/main.qml"));
59  view.showFullScreen();
60 
61  return app.exec();
62 }
KanagramEngineHelper
Definition: kanagramenginehelper.h:25
QDeclarativeView
kanagramenginehelper.h
KanagramGame
game api
Definition: kanagramgame.h:41
main
int main(int argc, char **argv)
Definition: harmattan/main.cpp:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:35 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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