From 0dd519e804b52ec43175f73f297c5f7239dfe323 Mon Sep 17 00:00:00 2001 From: Caio Lucena Date: Tue, 23 Jun 2015 15:18:20 -0300 Subject: [PATCH] starting --- .gitignore | 1 + android/AndroidManifest.xml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ android/build.gradle | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ android/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 49896 bytes android/gradle/wrapper/gradle-wrapper.properties | 6 ++++++ android/gradlew | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ android/gradlew.bat | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ android/res/drawable-hdpi/icon.png | Bin 0 -> 17243 bytes android/res/drawable-hdpi/splash.png | Bin 0 -> 17243 bytes android/res/drawable-ldpi/icon.png | Bin 0 -> 17243 bytes android/res/drawable-ldpi/splash.png | Bin 0 -> 17243 bytes android/res/drawable-mdpi/icon.png | Bin 0 -> 17243 bytes android/res/drawable-mdpi/splash.png | Bin 0 -> 17243 bytes android/res/values/libs.xml | 25 +++++++++++++++++++++++++ camerasurface.cpp | 23 +++++++++++++++++++++++ camerasurface.h | 19 +++++++++++++++++++ camerawindow.cpp | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ camerawindow.h | 37 +++++++++++++++++++++++++++++++++++++ camerawindow.ui | 24 ++++++++++++++++++++++++ funifier.pro | 41 +++++++++++++++++++++++++++++++++++++++++ images/funifier-logo.png | Bin 0 -> 17243 bytes images/theme/develop/pencil.png | Bin 0 -> 8889 bytes images/theme/develop/plus.png | Bin 0 -> 55999 bytes images/Índice.jpeg | Bin 0 -> 5776 bytes main.cpp | 12 ++++++++++++ mainwindow.cpp | 24 ++++++++++++++++++++++++ mainwindow.h | 24 ++++++++++++++++++++++++ mainwindow.ui | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 28 files changed, 719 insertions(+), 0 deletions(-) create mode 100644 .gitignore create mode 100644 android/AndroidManifest.xml create mode 100644 android/build.gradle create mode 100644 android/gradle/wrapper/gradle-wrapper.jar create mode 100644 android/gradle/wrapper/gradle-wrapper.properties create mode 100755 android/gradlew create mode 100644 android/gradlew.bat create mode 100644 android/res/drawable-hdpi/icon.png create mode 100644 android/res/drawable-hdpi/splash.png create mode 100644 android/res/drawable-ldpi/icon.png create mode 100644 android/res/drawable-ldpi/splash.png create mode 100644 android/res/drawable-mdpi/icon.png create mode 100644 android/res/drawable-mdpi/splash.png create mode 100644 android/res/values/libs.xml create mode 100644 camerasurface.cpp create mode 100644 camerasurface.h create mode 100644 camerawindow.cpp create mode 100644 camerawindow.h create mode 100644 camerawindow.ui create mode 100644 funifier.pro create mode 100644 images/funifier-logo.png create mode 100644 images/theme/develop/pencil.png create mode 100644 images/theme/develop/plus.png create mode 100644 images/Índice.jpeg create mode 100644 main.cpp create mode 100644 mainwindow.cpp create mode 100644 mainwindow.h create mode 100644 mainwindow.ui diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..91c967a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +funifier.pro.user diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml new file mode 100644 index 0000000..6aa05f5 --- /dev/null +++ b/android/AndroidManifest.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 0000000..81acf81 --- /dev/null +++ b/android/build.gradle @@ -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 + } +} diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..8c0fb64 Binary files /dev/null and b/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..1e61d1f --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip diff --git a/android/gradlew b/android/gradlew new file mode 100755 index 0000000..91a7e26 --- /dev/null +++ b/android/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/android/gradlew.bat b/android/gradlew.bat new file mode 100644 index 0000000..aec9973 --- /dev/null +++ b/android/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/android/res/drawable-hdpi/icon.png b/android/res/drawable-hdpi/icon.png new file mode 100644 index 0000000..a88c50b Binary files /dev/null and b/android/res/drawable-hdpi/icon.png differ diff --git a/android/res/drawable-hdpi/splash.png b/android/res/drawable-hdpi/splash.png new file mode 100644 index 0000000..a88c50b Binary files /dev/null and b/android/res/drawable-hdpi/splash.png differ diff --git a/android/res/drawable-ldpi/icon.png b/android/res/drawable-ldpi/icon.png new file mode 100644 index 0000000..a88c50b Binary files /dev/null and b/android/res/drawable-ldpi/icon.png differ diff --git a/android/res/drawable-ldpi/splash.png b/android/res/drawable-ldpi/splash.png new file mode 100644 index 0000000..a88c50b Binary files /dev/null and b/android/res/drawable-ldpi/splash.png differ diff --git a/android/res/drawable-mdpi/icon.png b/android/res/drawable-mdpi/icon.png new file mode 100644 index 0000000..a88c50b Binary files /dev/null and b/android/res/drawable-mdpi/icon.png differ diff --git a/android/res/drawable-mdpi/splash.png b/android/res/drawable-mdpi/splash.png new file mode 100644 index 0000000..a88c50b Binary files /dev/null and b/android/res/drawable-mdpi/splash.png differ diff --git a/android/res/values/libs.xml b/android/res/values/libs.xml new file mode 100644 index 0000000..4d68673 --- /dev/null +++ b/android/res/values/libs.xml @@ -0,0 +1,25 @@ + + + + https://download.qt-project.org/ministro/android/qt5/qt-5.4 + + + + + + + + + + + + + + + + + + + + diff --git a/camerasurface.cpp b/camerasurface.cpp new file mode 100644 index 0000000..d7f44d4 --- /dev/null +++ b/camerasurface.cpp @@ -0,0 +1,23 @@ +#include "camerasurface.h" + +QList CameraSurface::supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType) const +{ + return QList() << QVideoFrame::Format_RGB32; +} + +bool CameraSurface::present(const QVideoFrame &frame) +{ + if (frame.isValid()) { + QVideoFrame cloneFrame(frame); + cloneFrame.map(QAbstractVideoBuffer::ReadOnly); + + QByteArray ba; + ba.append( (char*)cloneFrame.bits(), cloneFrame.bytesPerLine() * cloneFrame.height() ); + + emit novoFrame( ba, cloneFrame.width(), cloneFrame.height() ); + + cloneFrame.unmap(); + return true; + } + return false; +} diff --git a/camerasurface.h b/camerasurface.h new file mode 100644 index 0000000..84b660b --- /dev/null +++ b/camerasurface.h @@ -0,0 +1,19 @@ +#ifndef CAMERASURFACE_H +#define CAMERASURFACE_H + +#include + +class CameraSurface : public QAbstractVideoSurface +{ + Q_OBJECT + public: + explicit CameraSurface(QObject *parent = 0) : QAbstractVideoSurface(parent){} + //~CameraSurface(); + QList supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType) const; + bool present(const QVideoFrame &frame); + + signals: + void novoFrame(QByteArray &buf, int w, int h); +}; + +#endif // CAMERASURFACE_H diff --git a/camerawindow.cpp b/camerawindow.cpp new file mode 100644 index 0000000..2c107ee --- /dev/null +++ b/camerawindow.cpp @@ -0,0 +1,57 @@ +#include "camerawindow.h" +#include "ui_camerawindow.h" + +CameraWindow::CameraWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::CameraWindow), + hasResolution(false) +{ + ui->setupUi(this); + + cameraSurface = new CameraSurface(); + camera = new QCamera(); + capture = new QCameraImageCapture( camera ); + camera->setViewfinder(cameraSurface); + camera->setCaptureMode(QCamera::CaptureStillImage); + camera->start(); + + zxing = new QZXing( QZXing::DecoderFormat_QR_CODE, this ); + //connect(zxing, SIGNAL(tagFound(QString)), this, SLOT(show_result(QString))); + + connect(cameraSurface, SIGNAL(novoFrame(QByteArray&,int,int)), this, SLOT(frameHandler(QByteArray&,int,int))); +} + +CameraWindow::~CameraWindow() +{ + delete ui; + delete cameraSurface; + delete camera; + delete capture; + delete viewfinder; + delete zxing; + delete img; + delete buffer; +} + +void CameraWindow::frameHandler(QByteArray &buff, int w, int h) +{ + if (!hasResolution) { + img = new QImage( w, h, QImage::Format_RGB32 ); + hasResolution = true; + } + + u_int32_t* data = (u_int32_t*)buff.data(); + for(int y = 0; y < h; ++y) { + QRgb* scan = (QRgb*)img->scanLine(y); + + for(int x = 0; x < w; ++x) { + scan[x] = data[y * w + x]; + } + } + + zxing->decodeImage( *img, w, h, true ); + + QImage imgTmp = img->scaled(w*.30, h*.30); + //ui->label->setPixmap(QPixmap::fromImage(imgTmp)); + buff.clear(); +} diff --git a/camerawindow.h b/camerawindow.h new file mode 100644 index 0000000..fdf37f8 --- /dev/null +++ b/camerawindow.h @@ -0,0 +1,37 @@ +#ifndef CAMERAWINDOW_H +#define CAMERAWINDOW_H + +#include +#include +#include +#include +#include +#include "camerasurface.h" + +namespace Ui { +class CameraWindow; +} + +class CameraWindow : public QMainWindow +{ + Q_OBJECT + private: + Ui::CameraWindow *ui; + QCamera * camera; + QCameraImageCapture * capture; + QCameraViewfinder *viewfinder; + CameraSurface *cameraSurface; + QZXing *zxing; + QImage *img; + u_int8_t * buffer; + bool hasResolution; + + public: + explicit CameraWindow(QWidget *parent = 0); + ~CameraWindow(); + + public slots: + void frameHandler(QByteArray&,int,int); +}; + +#endif // CAMERAWINDOW_H diff --git a/camerawindow.ui b/camerawindow.ui new file mode 100644 index 0000000..da1cacb --- /dev/null +++ b/camerawindow.ui @@ -0,0 +1,24 @@ + + + + + CameraWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + + + diff --git a/funifier.pro b/funifier.pro new file mode 100644 index 0000000..0db1f7a --- /dev/null +++ b/funifier.pro @@ -0,0 +1,41 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2015-06-23T12:39:33 +# +#------------------------------------------------- + +QT += core gui multimedia multimediawidgets + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = funifier +TEMPLATE = app + +include(../QZXing/QZXing.pri) + +SOURCES += main.cpp\ + mainwindow.cpp \ + camerasurface.cpp \ + camerawindow.cpp + +HEADERS += mainwindow.h \ + camerasurface.h \ + camerawindow.h + +FORMS += mainwindow.ui \ + camerawindow.ui + +CONFIG += mobility +MOBILITY = + +DISTFILES += \ + android/AndroidManifest.xml \ + android/gradle/wrapper/gradle-wrapper.jar \ + android/gradlew \ + android/res/values/libs.xml \ + android/build.gradle \ + android/gradle/wrapper/gradle-wrapper.properties \ + android/gradlew.bat + +ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android + diff --git a/images/funifier-logo.png b/images/funifier-logo.png new file mode 100644 index 0000000..a88c50b Binary files /dev/null and b/images/funifier-logo.png differ diff --git a/images/theme/develop/pencil.png b/images/theme/develop/pencil.png new file mode 100644 index 0000000..ad27447 Binary files /dev/null and b/images/theme/develop/pencil.png differ diff --git a/images/theme/develop/plus.png b/images/theme/develop/plus.png new file mode 100644 index 0000000..919ed04 Binary files /dev/null and b/images/theme/develop/plus.png differ diff --git a/images/Índice.jpeg b/images/Índice.jpeg new file mode 100644 index 0000000..8738aa9 Binary files /dev/null and b/images/Índice.jpeg differ diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..34ba1c1 --- /dev/null +++ b/main.cpp @@ -0,0 +1,12 @@ +#include "mainwindow.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.setWindowState(Qt::WindowMaximized); + w.show(); + + return a.exec(); +} diff --git a/mainwindow.cpp b/mainwindow.cpp new file mode 100644 index 0000000..a921926 --- /dev/null +++ b/mainwindow.cpp @@ -0,0 +1,24 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); + + connect(ui->pushButton, SIGNAL(clicked(bool)), this, SLOT(addGame())); +} + +MainWindow::~MainWindow() +{ + delete ui; + delete cameraWindow; +} + +void MainWindow::addGame() +{ + CameraWindow * cameraWindow = new CameraWindow(); + cameraWindow->show(); + //hide(); +} diff --git a/mainwindow.h b/mainwindow.h new file mode 100644 index 0000000..b8917bd --- /dev/null +++ b/mainwindow.h @@ -0,0 +1,24 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include "camerawindow.h" + +namespace Ui { + class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + private: + Ui::MainWindow *ui; + CameraWindow *cameraWindow; + public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + public slots: + void addGame(); +}; + +#endif // MAINWINDOW_H diff --git a/mainwindow.ui b/mainwindow.ui new file mode 100644 index 0000000..adb0a35 --- /dev/null +++ b/mainwindow.ui @@ -0,0 +1,61 @@ + + + MainWindow + + + + 0 + 0 + 313 + 365 + + + + Funifier + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Add + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + -- libgit2 0.22.2