Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Harold André
committed
Dec 22, 2015
1 parent
2bb912d
commit 131a898
Showing
40 changed files
with
1,519 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# This file is used to ignore files which are generated | ||
# ---------------------------------------------------------------------------- | ||
|
||
*~ | ||
*.autosave | ||
*.a | ||
*.core | ||
*.moc | ||
*.o | ||
*.obj | ||
*.orig | ||
*.rej | ||
*.so | ||
*.so.* | ||
*_pch.h.cpp | ||
*_resource.rc | ||
*.qm | ||
.#* | ||
*.*# | ||
core | ||
!core/ | ||
tags | ||
.DS_Store | ||
*.debug | ||
Makefile* | ||
*.prl | ||
*.app | ||
moc_*.cpp | ||
ui_*.h | ||
qrc_*.cpp | ||
Thumbs.db | ||
*.res | ||
*.rc | ||
/.qmake.cache | ||
/.qmake.stash | ||
|
||
# qtcreator generated files | ||
*.pro.user* | ||
|
||
# xemacs temporary files | ||
*.flc | ||
|
||
# Vim temporary files | ||
.*.swp | ||
|
||
# Visual Studio generated files | ||
*.ib_pdb_index | ||
*.idb | ||
*.ilk | ||
*.pdb | ||
*.sln | ||
*.suo | ||
*.vcproj | ||
*vcproj.*.*.user | ||
*.ncb | ||
*.sdf | ||
*.opensdf | ||
*.vcxproj | ||
*vcxproj.* | ||
|
||
# MinGW generated files | ||
*.Debug | ||
*.Release | ||
|
||
# Python byte code | ||
*.pyc | ||
|
||
# Binaries | ||
# -------- | ||
*.dll | ||
*.exe | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "HomePage.h" | ||
|
||
HomePage::HomePage(QWidget *parent) : QWidget(parent) | ||
{ | ||
// Buttons | ||
m_test1Button = new QPushButton; | ||
m_test1Button->setText("Test 1"); | ||
m_test2Button = new QPushButton; | ||
m_test2Button->setText("Test 2"); | ||
|
||
// Main layout | ||
m_mainLayout = new QVBoxLayout; | ||
m_mainLayout->addWidget(m_test1Button); | ||
m_mainLayout->addWidget(m_test2Button); | ||
|
||
// Assign main layout to MainWindow | ||
this->setLayout(m_mainLayout); | ||
} | ||
|
||
HomePage::~HomePage() | ||
{ | ||
delete m_test1Button; | ||
delete m_test2Button; | ||
delete m_mainLayout; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef HOMEPAGE_H | ||
#define HOMEPAGE_H | ||
|
||
#include <QWidget> | ||
#include <QPushButton> | ||
#include <QVBoxLayout> | ||
|
||
class HomePage : public QWidget | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit HomePage(QWidget *parent = 0); | ||
~HomePage(); | ||
|
||
private: | ||
// Buttons | ||
QPushButton *m_test1Button; | ||
QPushButton *m_test2Button; | ||
|
||
// Main layout | ||
QVBoxLayout *m_mainLayout; | ||
}; | ||
|
||
#endif // HOMEPAGE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
QT += core gui | ||
|
||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets | ||
|
||
TARGET = LPB | ||
TEMPLATE = app | ||
|
||
CONFIG += mobility | ||
|
||
SOURCES += \ | ||
main.cpp \ | ||
MainWindow.cpp \ | ||
TestPage1.cpp \ | ||
HomePage.cpp | ||
|
||
HEADERS += \ | ||
MainWindow.h \ | ||
TestPage1.h \ | ||
HomePage.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "MainWindow.h" | ||
|
||
MainWindow::MainWindow(QMainWindow *parent) : QMainWindow(parent) | ||
{ | ||
// Applications pages | ||
m_homePage = new HomePage; | ||
m_testPage1 = new TestPage1; | ||
|
||
QObject::connect(); | ||
|
||
// Stack of all pages | ||
m_stackedWidget = new QStackedWidget; | ||
m_stackedWidget->addWidget(m_homePage); | ||
m_stackedWidget->addWidget(m_testPage1); | ||
|
||
// Assign main layout to MainWindow | ||
this->setCentralWidget(m_stackedWidget); | ||
} | ||
|
||
MainWindow::~MainWindow() | ||
{ | ||
delete m_stackedWidget; | ||
delete m_testPage1; | ||
delete m_homePage; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef MAINWINDOW_H | ||
#define MAINWINDOW_H | ||
|
||
#include <QMainWindow> | ||
#include <QStackedWidget> | ||
|
||
#include "HomePage.h" | ||
#include "TestPage1.h" | ||
|
||
class MainWindow : public QMainWindow | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit MainWindow(QMainWindow *parent = 0); | ||
~MainWindow(); | ||
|
||
private: | ||
// Applications pages | ||
HomePage *m_homePage; | ||
TestPage1 *m_testPage1; | ||
|
||
// Stack of all pages | ||
QStackedWidget *m_stackedWidget; | ||
|
||
// Main layout | ||
QVBoxLayout *m_mainLayout; | ||
}; | ||
|
||
#endif // MAINWINDOW_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "TestPage1.h" | ||
|
||
TestPage1::TestPage1(QWidget *parent) : QWidget(parent) | ||
{ | ||
|
||
} | ||
|
||
TestPage1::~TestPage1() | ||
{ | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef TESTPAGE1_H | ||
#define TESTPAGE1_H | ||
|
||
#include <QWidget> | ||
|
||
class TestPage1 : public QWidget | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit TestPage1(QWidget *parent = 0); | ||
~TestPage1(); | ||
|
||
signals: | ||
|
||
public slots: | ||
}; | ||
|
||
#endif // TESTPAGE1_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
#include <QApplication> | ||
|
||
#include "MainWindow.h" | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
QApplication app(argc, argv); | ||
MainWindow w; | ||
w.show(); | ||
|
||
return app.exec(); | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
TEMPLATE = app | ||
|
||
QT += qml quick widgets sensors svg xml | ||
|
||
SOURCES += main.cpp | ||
|
||
RESOURCES += qml.qrc | ||
|
||
# Additional import path used to resolve QML modules in Qt Creator's code model | ||
QML_IMPORT_PATH = | ||
|
||
# Default rules for deployment. | ||
include(deployment.pri) | ||
|
||
DISTFILES += \ | ||
android/gradle/wrapper/gradle-wrapper.jar \ | ||
android/AndroidManifest.xml \ | ||
android/gradlew.bat \ | ||
android/res/values/libs.xml \ | ||
android/build.gradle \ | ||
android/gradle/wrapper/gradle-wrapper.properties \ | ||
android/gradlew | ||
|
||
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?xml version="1.0"?> | ||
<manifest package="org.qtproject.example" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto"> | ||
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --"> | ||
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="portrait" android:launchMode="singleTop"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
<meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/> | ||
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/> | ||
<meta-data android:name="android.app.repository" android:value="default"/> | ||
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/> | ||
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/> | ||
<!-- Deploy Qt libs as part of package --> | ||
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/> | ||
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/> | ||
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/> | ||
<!-- Run with local libs --> | ||
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/> | ||
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/> | ||
<meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/> | ||
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/> | ||
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/> | ||
<!-- Messages maps --> | ||
<meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/> | ||
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/> | ||
<meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/> | ||
<!-- Messages maps --> | ||
|
||
<!-- Splash screen --> | ||
<!-- | ||
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/> | ||
--> | ||
<!-- Splash screen --> | ||
|
||
<!-- Background running --> | ||
<!-- Warning: changing this value to true may cause unexpected crashes if the | ||
application still try to draw after | ||
"applicationStateChanged(Qt::ApplicationSuspended)" | ||
signal is sent! --> | ||
<meta-data android:name="android.app.background_running" android:value="false"/> | ||
<!-- Background running --> | ||
</activity> | ||
</application> | ||
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="14"/> | ||
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/> | ||
|
||
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application. | ||
Remove the comment if you do not require these default permissions. --> | ||
<!-- %%INSERT_PERMISSIONS --> | ||
|
||
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application. | ||
Remove the comment if you do not require these default features. --> | ||
<!-- %%INSERT_FEATURES --> | ||
|
||
<uses-permission android:name="android.permission.SET_ORIENTATION"/> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:1.0.0' | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
jcenter() | ||
} | ||
} | ||
|
||
apply plugin: 'com.android.application' | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
} | ||
|
||
android { | ||
/******************************************************* | ||
* The following variables: | ||
* - androidBuildToolsVersion, | ||
* - androidCompileSdkVersion | ||
* - qt5AndroidDir - holds the path to qt android files | ||
* needed to build any Qt application | ||
* on Android. | ||
* | ||
* are defined in gradle.properties file. This file is | ||
* updated by QtCreator and androiddeployqt tools. | ||
* Changing them manually might break the compilation! | ||
*******************************************************/ | ||
|
||
compileSdkVersion androidCompileSdkVersion.toInteger() | ||
|
||
buildToolsVersion androidBuildToolsVersion | ||
|
||
sourceSets { | ||
main { | ||
manifest.srcFile 'AndroidManifest.xml' | ||
java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java'] | ||
aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl'] | ||
res.srcDirs = [qt5AndroidDir + '/res', 'res'] | ||
resources.srcDirs = ['src'] | ||
renderscript.srcDirs = ['src'] | ||
assets.srcDirs = ['assets'] | ||
jniLibs.srcDirs = ['libs'] | ||
} | ||
} | ||
|
||
lintOptions { | ||
abortOnError false | ||
} | ||
} |
Binary file not shown.
Oops, something went wrong.