1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00

update qqt support Android

This commit is contained in:
tianduanrui 2017-10-03 17:07:40 +08:00
parent 2128bd77f5
commit fbdc8a247c
6 changed files with 92 additions and 60 deletions

View File

@ -14,13 +14,38 @@ macx {
CONFIG += app_bundle CONFIG += app_bundle
} }
OBJECTS_DIR = obj QT_KIT = $$(QKIT)
MOC_DIR = obj/moc.cpp message($${QT_KIT} Defined in qqtframe)
UI_DIR = obj/ui.h equals(QT_KIT, MIPS32) {
RCC_DIR = qrc QT += multimedia
#user directory DEFINES += __MIPS_LINUX__
DESTDIR = bin } else:equals(QT_KIT, LINUX) {
#DESTDIR = ../../../Product/install/Application DEFINES += __LINUX__
} else:equals(QT_KIT, LINUX64) {
DEFINES += __LINUX64__
} else:equals(QT_KIT, WIN) {
DEFINES += __WIN__
} else:equals(QT_KIT, WIN64) {
DEFINES += __WIN64__
} else:equals(QT_KIT, macOS) {
DEFINES += __DARWIN__
} else:equals(QT_KIT, Android) {
DEFINES += __ANDROID__
}
CONFIG(debug, debug|release) {
} else {
DEFINES -= QT_NO_DEBUG_OUTPUT
}
equals(QT_KIT, Android) {
CONFIG += mobility
MOBILITY =
#DISTFILES += \
# android/AndroidManifest.xml
#ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
}
INCLUDEPATH += $$PWD \ INCLUDEPATH += $$PWD \
$$PWD/../../src \ $$PWD/../../src \
@ -41,42 +66,25 @@ macx {
LIBS += -F/Users/abel/Develop/c0-buildstation/a0-qqtfoundation/MacOS/Release/src/bin LIBS += -F/Users/abel/Develop/c0-buildstation/a0-qqtfoundation/MacOS/Release/src/bin
LIBS += -framework QQt LIBS += -framework QQt
} }
equals(QT_KIT, Android) {
QT_KIT = $$(QKIT) LIBS += -L/Users/abel/Develop/c0-buildstation/a0-qqtfoundation/Android-arm/Release/src/bin
LIBS += -lQQt
message($${QT_KIT} Defined in qqtframe)
DEFINES += _TTY_POSIX_
equals(QT_KIT, MIPS32) {
QT += multimedia
DEFINES += __MIPS_LINUX__
} else:equals(QT_KIT, LINUX) {
DEFINES += __LINUX__
} else:equals(QT_KIT, LINUX64) {
DEFINES += __LINUX64__
} else:equals(QT_KIT, WIN) {
DEFINES += __WIN__
} else:equals(QT_KIT, WIN64) {
DEFINES += __WIN64__
} else:equals(QT_KIT, macOS) {
DEFINES += __DARWIN__
} }
CONFIG(debug, debug|release) { OBJECTS_DIR = obj
} else { MOC_DIR = obj/moc.cpp
DEFINES -= QT_NO_DEBUG_OUTPUT UI_DIR = obj/ui.h
} RCC_DIR = qrc
#user directory
DESTDIR = bin
equals(QT_KIT, MIPS32) { equals(QT_KIT, MIPS32) {
target.path = /Application target.path = /Application
INSTALLS += target INSTALLS += target
} else: unix { } else: unix {
macx{ macx{
target.path = /Users/abel/Develop/b1-Product/a0-qqtbased/Application target.path = /Users/abel/Develop/b1-Product
INSTALLS += target INSTALLS += target
} }
} }
INCLUDEPATH += $$PWD INCLUDEPATH += $$PWD

View File

@ -14,6 +14,7 @@
#include <QDebug> #include <QDebug>
#include <QSqlDatabase> #include <QSqlDatabase>
#include <QSqlError> #include <QSqlError>
#include <QSslError>
#include <qqt-local.h> #include <qqt-local.h>
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -10,6 +10,10 @@ QQTWord::QQTWord(QObject *parent) :
fmt(0), mainFmt(0),headerFmt(0),titleFmt(0), title2Fmt(0) fmt(0), mainFmt(0),headerFmt(0),titleFmt(0), title2Fmt(0)
{ {
//setup printer //setup printer
/**
MIPS bug: you must use QQTPrinter(QPrinter::HighResolution)
Other constructer won't work well
*/
pr= new QQTPrinter(QPrinter::HighResolution); pr= new QQTPrinter(QPrinter::HighResolution);
pr->setFullPage(true); pr->setFullPage(true);
pr->setColorMode(QPrinter::Color); pr->setColorMode(QPrinter::Color);
@ -298,7 +302,7 @@ void QQTWord::exportPdf(const QString &pdf)
pr->setOutputFileName(pdf); pr->setOutputFileName(pdf);
// print pdf // print pdf
QPainter p(pr); QPainter p(pr);
QQTGraphicsScene* pageScene = 0; QQTGraphicsScene* pageScene = 0;
foreach (pageScene, pageSceneVector) { foreach (pageScene, pageSceneVector) {

View File

@ -82,4 +82,8 @@
#include <QEventTransition> #include <QEventTransition>
#include <QTimeLine> #include <QTimeLine>
#include <QSslError>
#include <QSslKey>
#include <QSslSocket>
#endif // QQTGUIQT_H #endif // QQTGUIQT_H

View File

@ -4,21 +4,6 @@
# #
#------------------------------------------------- #-------------------------------------------------
############
##install and build
############
OBJECTS_DIR = obj
MOC_DIR = obj/moc.cpp
UI_DIR = obj/ui.h
RCC_DIR = qrc
#user directory
DESTDIR = bin
macx {
###if install product to same path,use this.
target.path = /Users/abel/Develop/b1-Product/a0-qqtbased/Application
INSTALLS += target
}
############# #############
##project version ##project version
############# #############
@ -35,11 +20,13 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport serialport
QT_KIT = $$(QKIT) QT_KIT = $$(QKIT)
message($${QT_KIT} Defined in qqtfoundation) message($${QT_KIT} Defined in qqtfoundation)
#MIPS __MIPS_LINUX__ #MIPS __MIPS_LINUX__
#ARM __ARM_LINUX__
#LINUX __LINUX__ #LINUX __LINUX__
#LINUX64 __LINUX64__ #LINUX64 __LINUX64__
#WIN __WIN__ #WIN __WIN__
#WIN64 __WIN64__ #WIN64 __WIN64__
#macOS __DARWIN__ #macOS __DARWIN__
#Android __ANDROID__
#处理文件内平台小差异 #处理文件内平台小差异
equals(QT_KIT, MIPS32) { equals(QT_KIT, MIPS32) {
QT += multimedia QT += multimedia
@ -54,6 +41,9 @@ equals(QT_KIT, MIPS32) {
DEFINES += __WIN64__ DEFINES += __WIN64__
} else:equals(QT_KIT, macOS) { } else:equals(QT_KIT, macOS) {
DEFINES += __DARWIN__ DEFINES += __DARWIN__
} else:equals(QT_KIT, Android) {
DEFINES += __ANDROID__
#TODO:no customplot word printer
} }
CONFIG(debug, debug|release) { CONFIG(debug, debug|release) {
} else { } else {
@ -64,7 +54,6 @@ win32 {
QMAKE_CXXFLAGS += /wd"4819" /wd"4244" /wd"4100" QMAKE_CXXFLAGS += /wd"4819" /wd"4244" /wd"4100"
} }
############# #############
##libraries ##libraries
############# #############
@ -85,6 +74,21 @@ win32 {
} }
} }
############
##install and build
############
OBJECTS_DIR = obj
MOC_DIR = obj/moc.cpp
UI_DIR = obj/ui.h
RCC_DIR = qrc
#user directory
DESTDIR = bin
macx {
###if install product to same path,use this.
target.path = /Users/abel/Develop/b1-Product
INSTALLS += target
}
########################### ###########################
##include directories ##include directories
########################### ###########################
@ -157,7 +161,12 @@ SOURCES += $$PWD/customplot/qcpdocumentobject.cpp \
$$PWD/customplot/qcustomplot.cpp $$PWD/customplot/qcustomplot.cpp
HEADERS += $$PWD/customplot/qcpdocumentobject.h \ HEADERS += $$PWD/customplot/qcpdocumentobject.h \
$$PWD/customplot/qcustomplot.h $$PWD/customplot/qcustomplot.h
equals(QT_KIT, Android) {
SOURCES -= $$PWD/customplot/qcpdocumentobject.cpp \
$$PWD/customplot/qcustomplot.cpp
HEADERS -= $$PWD/customplot/qcpdocumentobject.h \
$$PWD/customplot/qcustomplot.h
}
@ -202,6 +211,10 @@ FORMS += \
$$PWD/frame/qqtdialog.ui \ $$PWD/frame/qqtdialog.ui \
$$PWD/frame/qqtinput.ui \ $$PWD/frame/qqtinput.ui \
$$PWD/frame/qqtmsgbox.ui $$PWD/frame/qqtmsgbox.ui
equals(QT_KIT, Android) {
SOURCES -= $$PWD/frame/qqtword.cpp
HEADERS -= $$PWD/frame/qqtword.h
}
#gui #gui
@ -280,7 +293,10 @@ HEADERS += $$PWD/pluginwatcher/qqtpluginwatcher.h \
#printsupport #printsupport
SOURCES += $$PWD/printsupport/qqtprinter.cpp SOURCES += $$PWD/printsupport/qqtprinter.cpp
HEADERS += $$PWD/printsupport/qqtprinter.h HEADERS += $$PWD/printsupport/qqtprinter.h
equals(QT_KIT, Android) {
SOURCES -= $$PWD/printsupport/qqtprinter.cpp
HEADERS -= $$PWD/printsupport/qqtprinter.h
}
#sql #sql
SOURCES += $$PWD/sql/qqtsql.cpp SOURCES += $$PWD/sql/qqtsql.cpp

View File

@ -5,14 +5,13 @@
#------------------------------------------------- #-------------------------------------------------
TARGET = QQt TARGET = QQt
TEMPLATE = lib TEMPLATE = lib
CONFIG += dll
macx { macx {
CONFIG += lib_bundle CONFIG += lib_bundle
} }
#QQT LIBRARY (DLL) #QQT LIBRARY (DLL)
#DEFINES += QQT_LIBRARY #DEFINES += QQT_LIBRARY
DEFINES += QQT_LIBRARY DEFINES += QQT_LIBRARY