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

on android add printsupport and update library macro for many module

This commit is contained in:
tianduanrui 2017-11-12 21:04:23 +08:00
parent d122158107
commit 570f59cd92
16 changed files with 3323 additions and 3173 deletions

1
.gitignore vendored
View File

@ -19,3 +19,4 @@ moc_*.cpp
qrc_*.cpp qrc_*.cpp
Makefile Makefile
*-build-* *-build-*
.idea

44
QQt.pro
View File

@ -2,39 +2,51 @@ TEMPLATE = subdirs
CONFIG += ordered CONFIG += ordered
SUBDIRS = src/qqt.pro SUBDIRS = src/qqt.pro
#open SUBDIRS += examples/framelesshelperwidget #-----------------------------------------------------------------
#open SUBDIRS += examples/qqtframe #basic example
#open SUBDIRS += examples/animationframe #-----------------------------------------------------------------
#open SUBDIRS += examples/cmdwidget #SUBDIRS += examples/framelesshelperwidget
#open #SUBDIRS += examples/qqtframe
SUBDIRS += examples/qqtnetworkexample #SUBDIRS += examples/animationframe
#open SUBDIRS += examples/exquisite #SUBDIRS += examples/cmdwidget
#open SUBDIRS += examples/QtBuildTool #SUBDIRS += examples/qqtnetworkexample
#open SUBDIRS += examples/QtSdkManager #
#open SUBDIRS += examples/QQtInstaller SUBDIRS += examples/exquisite
#SUBDIRS += examples/QtBuildTool
#open SUBDIRS += examples/qqtframe2 #SUBDIRS += examples/QtSdkManager
#SUBDIRS += examples/QQtInstaller
#SUBDIRS += examples/qqtframe2
#-----------------------------------------------------------------
#need QQt installed to Qt library or #need QQt installed to Qt library or
#need QQt installed to sdk #need QQt installed to sdk
#open SUBDIRS += examples/qqtframe3 #-----------------------------------------------------------------
#SUBDIRS += examples/qqtframe3
#SUBDIRS += examples/VegeTablesPrice #SUBDIRS += examples/VegeTablesPrice
#-----------------------------------------------------------------
#need vlcQt libvlc library #need vlcQt libvlc library
#-----------------------------------------------------------------
#SUBDIRS += examples/qqtliveplayer #SUBDIRS += examples/qqtliveplayer
#-----------------------------------------------------------------
#need ffmpeg library #need ffmpeg library
#-----------------------------------------------------------------
#SUBDIRS += examples/qqtffmpegplayer #SUBDIRS += examples/qqtffmpegplayer
#need bluetooth library #need bluetooth library
#SUBDIRS += examples/qqtbluetoothfiletransferserver #open SUBDIRS += examples/qqtbluetoothfiletransferserver
#-----------------------------------------------------------------
#need QtSoap - WebSupport #need QtSoap - WebSupport
#open SUBDIRS += examples/easter #-----------------------------------------------------------------
#open SUBDIRS += examples/soapQQtOnline #SUBDIRS += examples/easter
#SUBDIRS += examples/soapQQtOnline
#-----------------------------------------------------------------
#need webkitwidgets - WebSupport #need webkitwidgets - WebSupport
#webkit webengine #webkit webengine
#-----------------------------------------------------------------
#SUBDIRS += examples/qqtftpclient #SUBDIRS += examples/qqtftpclient
#SUBDIRS += examples/qqthttpclient #SUBDIRS += examples/qqthttpclient
#SUBDIRS += examples/qqtwebkit #SUBDIRS += examples/qqtwebkit

View File

@ -3,24 +3,6 @@
# Project created by QtCreator 2017-10-20T19:53:30 # Project created by QtCreator 2017-10-20T19:53:30
# #
#------------------------------------------------- #-------------------------------------------------
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
}
}
QT += core gui QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
@ -55,3 +37,46 @@ HEADERS += \
FORMS += \ FORMS += \
mainwindow.ui mainwindow.ui
#-------------------------------------------------
#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

@ -4,6 +4,11 @@
#include <QKeyEvent> #include <QKeyEvent>
#include <qqtcore.h> #include <qqtcore.h>
#include <qqtslideeffecttabbar.h> #include <qqtslideeffecttabbar.h>
#include <qcustomplot.h>
#include <QTime>
QCPGraph* g0 = NULL;
QTime start;
MainWindow::MainWindow(QWidget* parent) : MainWindow::MainWindow(QWidget* parent) :
QMainWindow(parent), QMainWindow(parent),
@ -201,6 +206,15 @@ MainWindow::MainWindow(QWidget* parent) :
ui->w77->addTab("ddd"); ui->w77->addTab("ddd");
ui->w77->addTab("xxxx"); ui->w77->addTab("xxxx");
ui->w77->setFixedHeight(28); ui->w77->setFixedHeight(28);
ui->w99->xAxis->setTickLabelType(QCPAxis::ltNumber);
ui->w99->xAxis->setAutoTickStep(true);
ui->w99->xAxis->setTickStep(5);
ui->w99->xAxis->setRange(0, 100);
ui->w99->yAxis->setRange(0, 200);
g0 = ui->w99->addGraph(ui->w99->xAxis, ui->w99->yAxis);
start = QTime::currentTime();
} }
@ -212,6 +226,13 @@ MainWindow::~MainWindow()
void MainWindow::setValue(int value) void MainWindow::setValue(int value)
{ {
this->value = value; this->value = value;
QTime ecl = QTime::currentTime();
int key = -ecl.msecsTo(start) / 10;
g0->addData(key, ui->hs0->value());
ui->w99->xAxis->setRange(0, key + 100, Qt::AlignLeft);
ui->w99->replot();
//pline() << key;
} }
void MainWindow::setValue() void MainWindow::setValue()

View File

@ -18,7 +18,7 @@
<item> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>5</number>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="title"> <attribute name="title">
@ -113,6 +113,16 @@
<attribute name="title"> <attribute name="title">
<string>页</string> <string>页</string>
</attribute> </attribute>
<widget class="QCustomPlot" name="w99" native="true">
<property name="geometry">
<rect>
<x>140</x>
<y>80</y>
<width>651</width>
<height>301</height>
</rect>
</property>
</widget>
</widget> </widget>
<widget class="QWidget" name="tab_6"> <widget class="QWidget" name="tab_6">
<attribute name="title"> <attribute name="title">
@ -233,7 +243,13 @@
<customwidget> <customwidget>
<class>QQtSlideEffectTabWidget</class> <class>QQtSlideEffectTabWidget</class>
<extends>QTabWidget</extends> <extends>QTabWidget</extends>
<header>qqtslideeffecttabwidget.h</header> <header location="global">qqtslideeffecttabwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QCustomPlot</class>
<extends>QWidget</extends>
<header location="global">qcustomplot.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
</customwidgets> </customwidgets>

View File

@ -1,6 +1,6 @@
#include "filetransferprotocol.h" #include "filetransferprotocol.h"
FiletransferProtocol::FiletransferProtocol(QObject *parent) : QQTProtocol(parent) FiletransferProtocol::FiletransferProtocol(QObject* parent) : QQtProtocol(parent)
{ {
} }

View File

@ -5,19 +5,19 @@
#include <qqtmessage.h> #include <qqtmessage.h>
#include <qqtprotocol.h> #include <qqtprotocol.h>
class FiletransferMessage:public QQTMessage class FiletransferMessage: public QQtMessage
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit FiletransferMessage(QObject* parent = 0):QQTMessage(parent) {} explicit FiletransferMessage(QObject* parent = 0): QQtMessage(parent) {}
// QQTMessage interface // QQTMessage interface
public: public:
virtual void parser(const QByteArray &l) override virtual void parser(const QByteArray& l) override
{ {
} }
virtual void packer(QByteArray &l) override virtual void packer(QByteArray& l) override
{ {
} }
private: private:
@ -26,11 +26,11 @@ private:
quint32 tail; quint32 tail;
}; };
class FiletransferProtocol : public QQTProtocol class FiletransferProtocol : public QQtProtocol
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit FiletransferProtocol(QObject *parent = nullptr); explicit FiletransferProtocol(QObject* parent = nullptr);
signals: signals:

View File

@ -3,8 +3,6 @@
# Project created by QtCreator 2017-10-17T17:48:58 # Project created by QtCreator 2017-10-17T17:48:58
# #
#------------------------------------------------- #-------------------------------------------------
include(../qqtframe2/link_qqt_library.pri)
QT += core gui QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
@ -41,3 +39,34 @@ FORMS += \
CONFIG += mobility CONFIG += mobility
MOBILITY = MOBILITY =
#-------------------------------------------------
#link qqt library
#-------------------------------------------------
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
}
}
equals(QKIT_PRIVATE, ANDROID) {
CONFIG += mobility
MOBILITY =
}
#-------------------------------------------------
##project environ
#-------------------------------------------------
#default
message ($${TARGET} config $${CONFIG})
message ($${TARGET} define $${DEFINES})

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,7 @@
#include <QDebug> #include <QDebug>
#include <QEventLoop> #include <QEventLoop>
#include <QTimer> #include <QTimer>
#include <qqt.h>
/** /**
* @brief The QQtVerificationCode_p class * @brief The QQtVerificationCode_p class

View File

@ -1,5 +1,5 @@
/****************************************************************************** /******************************************************************************
QDeviceWatcher: Device watcher class QDeviceWatcher: Device watcher class
Copyright (C) 2011-2015 Wang Bin <wbsecg1@gmail.com> Copyright (C) 2011-2015 Wang Bin <wbsecg1@gmail.com>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
@ -22,44 +22,47 @@
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QEvent> #include <QtCore/QEvent>
#include <QtCore/qglobal.h>
#ifdef BUILD_QDEVICEWATCHER_STATIC #if defined(Q_OS_WIN)
#define Q_DW_EXPORT //dynamic and static are different
#if defined(BUILD_QDEVICEWATCHER_LIB)
# define Q_DW_EXPORT Q_DECL_EXPORT
#elif defined(BUILD_QDEVICEWATCHER_STATIC)
# define Q_DW_EXPORT
#else #else
#if defined(BUILD_QDEVICEWATCHER_LIB) # define Q_DW_EXPORT Q_DECL_IMPORT
# undef Q_DW_EXPORT #endif
# define Q_DW_EXPORT Q_DECL_EXPORT #else
#else //dynamic and static are equal to each other
# undef Q_DW_EXPORT # define Q_DW_EXPORT
# define Q_DW_EXPORT //Q_DECL_IMPORT //only for vc?
#endif #endif
#endif //BUILD_QDEVICEWATCHER_STATIC
class QDeviceWatcherPrivate; class QDeviceWatcherPrivate;
class Q_DW_EXPORT QDeviceWatcher : public QObject class Q_DW_EXPORT QDeviceWatcher : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_DECLARE_PRIVATE(QDeviceWatcher) Q_DECLARE_PRIVATE(QDeviceWatcher)
public: public:
explicit QDeviceWatcher(QObject *parent = 0); explicit QDeviceWatcher(QObject* parent = 0);
~QDeviceWatcher(); ~QDeviceWatcher();
bool start(); bool start();
bool stop(); bool stop();
bool isRunning() const; bool isRunning() const;
void appendEventReceiver(QObject* receiver); void appendEventReceiver(QObject* receiver);
signals: signals:
void deviceAdded(const QString& dev); void deviceAdded(const QString& dev);
void deviceChanged(const QString& dev); //when umounting the device void deviceChanged(const QString& dev); //when umounting the device
void deviceRemoved(const QString& dev); void deviceRemoved(const QString& dev);
protected: protected:
bool running; bool running;
QDeviceWatcherPrivate *d_ptr; QDeviceWatcherPrivate* d_ptr;
}; };

View File

@ -7,6 +7,11 @@
#if you succeed with LibQQt, please thumb up. #if you succeed with LibQQt, please thumb up.
#2017年11月10日18:53:56 #2017年11月10日18:53:56
#################################################################
##Usage
#################################################################
#please dont use Qt 5.9.1, it is broken with android and ios.
################################################################# #################################################################
##project name ##project name
################################################################# #################################################################
@ -18,13 +23,15 @@ TEMPLATE = lib
##need QKIT to compitible with some occasion ##need QKIT to compitible with some occasion
################################################ ################################################
include ($$PWD/qqt_kit.pri) include ($$PWD/qqt_kit.pri)
##special lib lib_bundle/staticlib
equals(QKIT_PRIVATE, macOS) { ##different target:
CONFIG += dll ##win link qqt dll + ..
CONFIG += lib_bundle ##win link qqt static + QQT_STATIC_LIBRARY
} else:equals(QKIT_PRIVATE, iOS) { ##win build qqt dll + QQT_LIBRARY
CONFIG += staticlib ##win build qqt lib + QQT_STATIC_LIBRARY
} else:equals(QKIT_PRIVATE, WIN32) { ##*nix build and link qqt dll or lib + ..
##some target, special lib lib_bundle/staticlib
equals(QKIT_PRIVATE, WIN32) {
#when Qt is static by mingw32 building 5.9.1 #when Qt is static by mingw32 building 5.9.1
equals(QT_VERSION, 5.9.1){ equals(QT_VERSION, 5.9.1){
CONFIG += staticlib CONFIG += staticlib
@ -33,12 +40,16 @@ equals(QKIT_PRIVATE, macOS) {
CONFIG += dll CONFIG += dll
DEFINES += QQT_LIBRARY DEFINES += QQT_LIBRARY
} }
} else { } else:equals(QKIT_PRIVATE, macOS) {
##default build dll but some occasion CONFIG += dll
CONFIG += lib_bundle
} else:equals(QKIT_PRIVATE, iOS) {
CONFIG += staticlib
} else {
##default build dll
CONFIG += dll CONFIG += dll
#windows QQt library export (DLL) static lib is not needed
#*nix no need this macro #*nix no need this macro
DEFINES += QQT_LIBRARY #DEFINES += QQT_LIBRARY
} }
#create prl #create prl
CONFIG += create_prl CONFIG += create_prl

View File

@ -121,17 +121,21 @@ contains (DEFINES, __CPP11__) {
##################PrintSupport Module############################### ##################PrintSupport Module###############################
#if you use printsupport , open this annotation #if you use printsupport , open this annotation
DEFINES += __PRINTSUPPORT__ DEFINES += __PRINTSUPPORT__
#ios android can't support this function now #ios can't support this feature
contains(QKIT_PRIVATE, iOS||iOSSimulator||ANDROID||ANDROIDX86) { contains(QKIT_PRIVATE, iOS||iOSSimulator) {
DEFINES -= __PRINTSUPPORT__ #DEFINES -= __PRINTSUPPORT__
qtHaveModule(printsupport) : message(ios have printsupport)
}
#Qt5.9.1, ios android can't support this feature
equals(QT_VERSION, 5.9.1) {
contains(QKIT_PRIVATE, ANDROID||ANDROIDX86) {
DEFINES -= __PRINTSUPPORT__
}
} }
contains (DEFINES, __PRINTSUPPORT__) { contains (DEFINES, __PRINTSUPPORT__) {
greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport
#if you use qcustomplot, open this annotation #if you use qcustomplot, open this annotation
DEFINES += __CUSTOMPLOT__ DEFINES += __CUSTOMPLOT__
contains(QKIT_PRIVATE, iOS||iOSSimulator||ANDROID||ANDROIDX86) {
DEFINES -= __CUSTOMPLOT__
}
} }
##################Exquisite Module############################### ##################Exquisite Module###############################

View File

@ -84,7 +84,8 @@ equals(QKIT_PRIVATE, macOS) {
equals(QKIT_PRIVATE, macOS) { equals(QKIT_PRIVATE, macOS) {
CONFIG += app_bundle CONFIG += app_bundle
} }
equals(QKIT_PRIVATE, ANDROID) {
equals(QKIT_PRIVATE, ANDROID||ANDROIDX86) {
CONFIG += mobility CONFIG += mobility
MOBILITY = MOBILITY =
} }

View File

@ -16,20 +16,20 @@ SOURCES +=
HEADERS += HEADERS +=
#root dir #root dir
win32 { contains (QKIT_PRIVATE, WIN32||WIN64) {
#win32 base type #win32 base type
HEADERS += $$PWD/qqtwin.h HEADERS += $$PWD/qqtwin.h
} } else:contains (QKIT_PRIVATE, macOS||iOS||iOSSimulator) {
unix { #mac base type
equals(QKIT_PRIVATE, macOS) { HEADERS += $$PWD/qqtdarwin.h
HEADERS += $$PWD/qqtdarwin.h } else:contains (QKIT_PRIVATE, ANDROID||ANDROIDX86) {
} else: contains(QKIT_PRIVATE, LINUX|LINUX64) { #android base type
HEADERS += $$PWD/qqtlinux.h
}
}
contains (QKIT_PRIVATE, ANDROID||ANDROIDX86) {
HEADERS += $$PWD/qqtandroid.h HEADERS += $$PWD/qqtandroid.h
} else {
#linux base type
HEADERS += $$PWD/qqtlinux.h
} }
HEADERS += $$PWD/qqt.h \ HEADERS += $$PWD/qqt.h \
$$PWD/qqt-local.h \ $$PWD/qqt-local.h \
$$PWD/qqtversion.h \ $$PWD/qqtversion.h \
@ -131,10 +131,12 @@ HEADERS += $$PWD/multimedia/qqtmplayer.h
#pluginwatcher #pluginwatcher
#TODO: macOS dump #TODO: macOS dump
contains (DEFINES, QQT_LIBRARY) {
DEFINES += BUILD_QDEVICEWATCHER_LIB
}
win32 { 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 wince*: SOURCES += $$PWD/pluginwatcher/qdevicewatcher_wince.cpp
else: SOURCES += $$PWD/pluginwatcher/qdevicewatcher_win32.cpp else: SOURCES += $$PWD/pluginwatcher/qdevicewatcher_win32.cpp
} }
@ -166,8 +168,12 @@ contains (DEFINES, __PRINTSUPPORT__) {
#DEFINES += __CUSTOMPLOT__ #DEFINES += __CUSTOMPLOT__
contains (DEFINES, __CUSTOMPLOT__) { contains (DEFINES, __CUSTOMPLOT__) {
#message (qcustomplot is used in $${TARGET}) #message (qcustomplot is used in $${TARGET})
contains (DEFINES, QQT_LIBRARY) { win32 {
DEFINES += QCUSTOMPLOT_COMPILE_LIBRARY contains (DEFINES, QQT_LIBRARY) {
DEFINES += QCUSTOMPLOT_COMPILE_LIBRARY
} else: contains (DEFINES, QQT_STATIC_LIBRARY) {
DEFINES += QCUSTOMPLOT_USE_LIBRARY
}
} }
SOURCES += $$PWD/customplot/qcpdocumentobject.cpp \ SOURCES += $$PWD/customplot/qcpdocumentobject.cpp \
$$PWD/customplot/qcustomplot.cpp $$PWD/customplot/qcustomplot.cpp
@ -367,8 +373,12 @@ contains (DEFINES, __QRENCODE__) {
##websocket ##websocket
contains(DEFINES, __QTSOAP__) { contains(DEFINES, __QTSOAP__) {
contains (DEFINES, QQT_LIBRARY) { win32 {
DEFINES += QT_QTSOAP_LIBRARY contains (DEFINES, QQT_LIBRARY) {
DEFINES += QT_QTSOAP_LIBRARY
} else: contains (DEFINES, QQT_STATIC_LIBRARY) {
DEFINES += QT_QTSOAP_STATIC_LIBRARY
}
} }
SOURCES += \ SOURCES += \
$$PWD/soap/qtsoap.cpp $$PWD/soap/qtsoap.cpp

View File

@ -49,11 +49,20 @@
#include <QLinkedList> #include <QLinkedList>
#include <QPointer> #include <QPointer>
#include <QtCore/qglobal.h>
#if defined(QT_QTSOAP_LIBRARY) #if defined(Q_OS_WIN)
# define QT_QTSOAP_EXPORT Q_DECL_EXPORT //dynamic and static are different
#if defined(QT_QTSOAP_LIBRARY)
# define QT_QTSOAP_EXPORT Q_DECL_EXPORT
#elif defined(QT_QTSOAP_STATIC_LIBRARY)
# define QT_QTSOAP_EXPORT
#else #else
# define QT_QTSOAP_EXPORT Q_DECL_IMPORT # define QT_QTSOAP_EXPORT Q_DECL_IMPORT
#endif
#else
//dynamic and static are equal to each other
# define QT_QTSOAP_EXPORT
#endif #endif
#define SOAPv11_ENVELOPE "http://schemas.xmlsoap.org/soap/envelope/" #define SOAPv11_ENVELOPE "http://schemas.xmlsoap.org/soap/envelope/"