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

kalgebra

  • sources
  • kde-4.12
  • kdeedu
  • kalgebra
  • mobile
mobile/main.cpp
Go to the documentation of this file.
1 /*************************************************************************************
2  * Copyright (C) 2010 by Aleix Pol <aleixpol@kde.org> *
3  * *
4  * This program is free software; you can redistribute it and/or *
5  * modify it under the terms of the GNU General Public License *
6  * as published by the Free Software Foundation; either version 2 *
7  * of the License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this program; if not, write to the Free Software *
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
17  *************************************************************************************/
18 
19 #include <KApplication>
20 #include <KAboutData>
21 #include <KCmdLineArgs>
22 #include <KStandardDirs>
23 
24 #ifdef KDECOMPONENTS
25 #include <kdeclarative.h>
26 #endif
27 
28 #include <QDebug>
29 #include <QFileInfo>
30 #include <QDir>
31 #include <QDeclarativeView>
32 #include <QDeclarativeEngine>
33 #include <QDeclarativeContext>
34 #include <QIcon>
35 
36 #include "kalgebramobile.h"
37 
38 int main(int argc, char *argv[])
39 {
40 // KAboutData about("kalgebra", 0, ki18n(("KAlgebra Mobile")), "0.10", ki18n("A portable calculator"),
41 // KAboutData::License_GPL, ki18n("(C) 2006-2010 Aleix Pol Gonzalez"));
42 // about.addAuthor( ki18n("Aleix Pol Gonzalez"), KLocalizedString(), "aleixpol@kde.org" );
43 // KCmdLineArgs::init(argc, argv, &about);
44  QApplication app(argc, argv);
45  app.setApplicationName("kalgebramobile");
46  app.setWindowIcon(QIcon::fromTheme("kalgebra"));
47 
48  KAlgebraMobile widget;
49 
50  QDeclarativeView view;
51  view.setWindowTitle("KAlgebra Mobile");
52  view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
53  view.engine()->rootContext()->setContextProperty("app", &widget);
54 
55 // KGlobal::dirs()->addResourceDir("appdata", PREFIX "/share/apps");
56 
57 #ifdef KDECOMPONENTS
58  KDeclarative kdeclarative;
59  kdeclarative.setDeclarativeEngine(view.engine());
60  kdeclarative.initialize();
61  //binds things like kconfig and icons
62  kdeclarative.setupBindings();
63 #endif
64 
65  QString main = KStandardDirs::locate("appdata", "plugins/widgets/KAlgebraMobile.qml");
66 // QString main = KStandardDirs::locate("appdata", "plugins/Tables.qml");
67  QDir dir = QFileInfo(main).dir();
68  dir.cdUp();
69 
70  view.engine()->addImportPath(dir.path());
71  view.setSource(main);
72 
73  #if defined(__arm__) && !defined(ANDROID)
74  view.showFullScreen();
75  #else
76  view.resize(view.initialSize().width(), view.initialSize().height());
77  view.show();
78  #endif
79 
80  return app.exec();
81 }
main
int main(int argc, char *argv[])
Definition: mobile/main.cpp:38
main
Definition: main.qml:22
kalgebramobile.h
KAlgebraMobile
Definition: kalgebramobile.h:31
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kalgebra

Skip menu "kalgebra"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

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