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

update support ios

This commit is contained in:
tianduanrui 2017-11-12 22:44:16 +08:00
parent 570f59cd92
commit 1ac8cd9ba3
12 changed files with 213 additions and 34 deletions

View File

@ -23,6 +23,8 @@ SUBDIRS += examples/exquisite
#-----------------------------------------------------------------
#SUBDIRS += examples/qqtframe3
#SUBDIRS += examples/VegeTablesPrice
#can't support ios
#SUBDIRS += examples/qqtprintsupportexample
#-----------------------------------------------------------------
#need vlcQt libvlc library

View File

@ -0,0 +1,11 @@
#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}

View File

@ -0,0 +1,14 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}

View File

@ -0,0 +1,22 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H

View File

@ -0,0 +1,21 @@
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>480</height>
</rect>
</property>
<property name="windowTitle" >
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralWidget" />
</widget>
<layoutDefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,80 @@
#-------------------------------------------------
#
# Project created by QtCreator 2017-11-12T21:59:07
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = qqtprintsupportexample
TEMPLATE = app
# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
main.cpp \
mainwindow.cpp
HEADERS += \
mainwindow.h
FORMS += \
mainwindow.ui
CONFIG += mobility
MOBILITY =
#-------------------------------------------------
#link qqt library
#if you link a library to your app, on android you must select the running kit to the app, not LibQQt e.g.
#-------------------------------------------------
include(../qqtframe2/link_qqt_library.pri)
#-------------------------------------------------
#install
#-------------------------------------------------
#CONFIG += can_install
can_install:equals(QKIT_PRIVATE, EMBEDDED) {
target.path = /Application
INSTALLS += target
} else: unix {
equals(QKIT_PRIVATE, macOS) {
target.path = /Applications
INSTALLS += target
}
}
#-------------------------------------------------
##project environ
#-------------------------------------------------
#default
message ($${TARGET} config $${CONFIG})
message ($${TARGET} define $${DEFINES})
contains(QKIT_PRIVATE, ANDROID|ANDROIDX86) {
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
}

View File

@ -39,8 +39,6 @@
#ifdef __PRINTSUPPORT__
#include <QPrinter>
#include <QPrintDialog>
#include <QPrintPreviewDialog>
#endif
#include <QTextFormat>
@ -88,6 +86,8 @@
#include <QEventTransition>
#include <QTimeLine>
#ifdef __PROCESSMODULE__
#include <QProcess>
#endif
#endif // QQTGUIQT_H

View File

@ -76,6 +76,7 @@ contains (DEFINES, __QEXTSERIALPORT__) {
win32:DEFINES += _TTY_WIN_
#message ( __QEXTSERIALPORT__ Defined in $${TARGET})
} else {
#message ( __QSERIALPORT__ Defined in $${TARGET})
greaterThan(QT_MAJOR_VERSION, 4): QT += serialport
lessThan(QT_MAJOR_VERSION, 5): CONFIG += serialport
unix {
@ -118,21 +119,38 @@ contains (DEFINES, __CPP11__) {
#lambda also need c++11
}
##################DeviceWatcher Module###############################
#used in windows linux e-linux android, mac ios not support exactly
#if you use DeviceWatcher , open this annotation
DEFINES += __PLUGINWATCHER__
contains(QKIT_PRIVATE, iOS||iOSSimulator||macOS) {
DEFINES -= __PLUGINWATCHER__
}
##################Process Module###############################
#if you use qprocess , open this annotation
DEFINES += __PROCESSMODULE__
#ios has no backend process
contains(QKIT_PRIVATE, iOS||iOSSimulator) {
DEFINES -= __PROCESSMODULE__
}
##################PrintSupport Module###############################
#if you use printsupport , open this annotation
DEFINES += __PRINTSUPPORT__
#ios can't support this feature
contains(QKIT_PRIVATE, iOS||iOSSimulator) {
#DEFINES -= __PRINTSUPPORT__
qtHaveModule(printsupport) : message(ios have printsupport)
}
#Qt5.9.1, ios android can't support this feature
#Qt5.9.1, ios android can't support this feature.
#Qt5.9.1, broken
equals(QT_VERSION, 5.9.1) {
contains(QKIT_PRIVATE, ANDROID||ANDROIDX86) {
contains(QKIT_PRIVATE, iOS||iOSSimulator||ANDROID||ANDROIDX86) {
DEFINES -= __PRINTSUPPORT__
}
}
#ios can't use printsupport
contains(QKIT_PRIVATE, iOS||iOSSimulator) {
DEFINES -= __PRINTSUPPORT__
}
contains (DEFINES, __PRINTSUPPORT__) {
#qtHaveModule(printsupport) : message(qqt use module printsupport)
greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport
#if you use qcustomplot, open this annotation
DEFINES += __CUSTOMPLOT__
@ -189,8 +207,8 @@ win32 {
#LIBS += -F$${MACOSXSDK}/System/Library/Frameworks
#LIBS += -L$${MACOSXSDK}/usr/lib
LIBS += -framework DiskArbitration -framework Cocoa -framework IOKit
} else:contains(QKIT_PRIVATE, iOS|iOSSimulator) {
LIBS += -l DiskArbitration -l Cocoa -l IOKit
}else:contains(QKIT_PRIVATE, iOS|iOSSimulator){
QMAKE_LFLAGS += -ObjC -lsqlite3 -lz -framework "AddressBook" -framework "AssetsLibrary" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreLocation" -framework "CoreMotion" -framework "MessageUI" -framework "SystemConfiguration"
}
}
##################################################################

View File

@ -256,7 +256,7 @@ contains(CONFIG, qqt_create_sdk){
post_link += $$create_dir_struct()
contains(QKIT_PRIVATE, macOS) {
message(create QQt mac bundle framework)
#message(create QQt mac bundle framework)
post_link += $$MK_DIR lib/$${MODULE_NAME}.framework $$CMD_SEP
post_link += $$CD lib/$${MODULE_NAME}.framework $$CMD_SEP
post_link += $$create_mac_sdk() $$CMD_SEP
@ -264,7 +264,7 @@ contains(CONFIG, qqt_create_sdk){
#create prl
post_link += $$COPY $$QQT_BUILD_DIR/$${MODULE_NAME}.framework/$${MODULE_NAME}.prl lib/$${MODULE_NAME}.framework/$${MODULE_NAME}.prl $$CMD_SEP
} else {
message(create QQt linux struct library)
#message(create QQt linux struct library)
post_link += $$create_linux_sdk() $$CMD_SEP
post_link += $$COPY $$QQT_BUILD_DIR/*.prl lib $$CMD_SEP
}

View File

@ -42,11 +42,11 @@ equals(QKIT_PRIVATE, EMBEDDED) {
DEFINES += __IOS__
} else:equals(QKIT_PRIVATE, iOSSimulator) {
DEFINES += __IOS__
#TODO:no customplot word printer process
} else:equals(QKIT_PRIVATE, ANDROID) {
DEFINES += __ANDROID__
} else:equals(QKIT_PRIVATE, ANDROIDX86) {
DEFINES += __ANDROID__
#todo:no customplot word printer
}
#QMAKESPEC_NAME = $${QMAKESPEC}

View File

@ -126,32 +126,33 @@ FORMS += \
#multimedia
#arm mips
#TODO: +wince +android +ios +macOS +win +linux
SOURCES += $$PWD/multimedia/qqtmplayer.cpp
HEADERS += $$PWD/multimedia/qqtmplayer.h
contains (DEFINES, __PROCESSMODULE__) {
SOURCES += $$PWD/multimedia/qqtmplayer.cpp
HEADERS += $$PWD/multimedia/qqtmplayer.h
}
#pluginwatcher
#TODO: macOS dump
win32 {
contains (DEFINES, QQT_LIBRARY) {
DEFINES += BUILD_QDEVICEWATCHER_LIB
} else: contains (DEFINES, QQT_STATIC_LIBRARY) {
DEFINES += BUILD_QDEVICEWATCHER_STATIC
}
wince*: SOURCES += $$PWD/pluginwatcher/qdevicewatcher_wince.cpp
else: SOURCES += $$PWD/pluginwatcher/qdevicewatcher_win32.cpp
}
unix {
mac* {
contains(DEFINES, __PLUGINWATCHER__) {
contains(QKIT_PRIVATE, WIN32|WIN64) {
contains (DEFINES, QQT_LIBRARY) {
DEFINES += BUILD_QDEVICEWATCHER_LIB
} else: contains (DEFINES, QQT_STATIC_LIBRARY) {
DEFINES += BUILD_QDEVICEWATCHER_STATIC
}
wince*: SOURCES += $$PWD/pluginwatcher/qdevicewatcher_wince.cpp
else: SOURCES += $$PWD/pluginwatcher/qdevicewatcher_win32.cpp
}else:contains(QKIT_PRIVATE, macOS) {
SOURCES += $$PWD/pluginwatcher/qdevicewatcher_mac.cpp
} else {
}else {
SOURCES += $$PWD/pluginwatcher/qdevicewatcher_linux.cpp
}
SOURCES += $$PWD/pluginwatcher/qdevicewatcher.cpp \
$$PWD/pluginwatcher/qqtpluginwatcher.cpp
HEADERS += $$PWD/pluginwatcher/qqtpluginwatcher.h \
$$PWD/pluginwatcher/qdevicewatcher.h \
$$PWD/pluginwatcher/qdevicewatcher_p.h
}
SOURCES += $$PWD/pluginwatcher/qdevicewatcher.cpp \
$$PWD/pluginwatcher/qqtpluginwatcher.cpp
HEADERS += $$PWD/pluginwatcher/qqtpluginwatcher.h \
$$PWD/pluginwatcher/qdevicewatcher.h \
$$PWD/pluginwatcher/qdevicewatcher_p.h
#printsupport
#DEFINES += __PRINTSUPPORT__

View File

@ -1,5 +1,7 @@
#include "qqtapplication.h"
#ifdef __PLUGINWATCHER__
#include "qqtpluginwatcher.h"
#endif
#include <qqtwidgets.h>
#include <qqtmsgbox.h>
#include <qqtversion.h>
@ -10,7 +12,9 @@
#include <QSettings>
#include <QTranslator>
#include <QFontDatabase>
#ifdef __PROCESSMODULE__
#include <QProcess>
#endif
QQtApplication::QQtApplication(int& argc, char** argv) :
QApplication(argc, argv),
@ -56,7 +60,7 @@ QQtApplication::QQtApplication(int& argc, char** argv) :
QQTInput::Instance()->Init("min", "control", "QQT", 14, 14);
#endif
#if ( !defined (__DARWIN__) && !defined(__IOS__) )
#ifdef __PLUGINWATCHER__
QObject::connect(QQTPluginWatcher::Instance(), SIGNAL(storageChanged(int)),
this, SLOT(slotUPanAutoRun(int)));
#endif
@ -93,6 +97,7 @@ void QQtApplication::slotUPanAutoRun(int status)
if (!bUPanAutoRun)
return;
#ifdef __PLUGINWATCHER__
if (QQTPluginWatcher::E_ADD == status)
{
QString mP = QQTPluginWatcher::Instance()->upanMountPath();
@ -109,10 +114,15 @@ void QQtApplication::slotUPanAutoRun(int status)
{
return;
}
#ifdef __PROCESSMODULE__
QProcess* p = new QProcess(this);
p->setWorkingDirectory(mP);
p->start(app);
#else
//TODO:
#endif
}
#endif
}