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

升级宏定义

This commit is contained in:
tianduanrui 2018-07-10 18:10:24 +08:00
parent 125c0eb42e
commit 3361694d43
9 changed files with 100 additions and 70 deletions

@ -1 +1 @@
Subproject commit d0a65e5f49433c1ca446c34926e7e169ef550362
Subproject commit 5bfdec449f68119ed35f7bf26cdbf241764b7910

View File

@ -41,6 +41,8 @@ CONFIG += build_all
include ($${PWD}/../multi-link/add_base_manager.pri)
#根据multi-link提供的动态编译 静态编译设定进行编译添加我自己的QQt的宏定义
#如果用户把LibQQt编译为静态库那么在链接的时候需要QQT_STATIC_LIBRARY定义
#动态链接,一切默认即可
contains(DEFINES, LIB_LIBRARY) {
DEFINES += QQT_LIBRARY
message(Build $${TARGET} QQT_LIBRARY is defined. build)
@ -91,6 +93,7 @@ include ($$PWD/qqt_source.pri)
add_sdk(QQt, $$add_target_name())
#额外做点事情 拷贝头文件 没有后缀的头文件
#这个可以通过Multi-link工具实现
add_sdk_header(QQt, $$add_target_name(), QQtApplication, frame)
add_sdk_header(QQt, $$add_target_name(), QQtWidget, widgets)

View File

@ -59,7 +59,7 @@ private:
//不需要额外初始化的地方
//mingw32 5.3 静态成员不准导出?作为静态类这块编译出现错误
//error: definition of static data member 'QQtWavSoundEffect::msInstance' of dllimport'd class
//这个已经查出来了在qqt_header.pri有一个WIN64的鸿缺失导致QQT_STATIC_LIBRARY缺失引发QQt在QQTSHAREDEXPORT=import下编译所以引发这个变量重新定义的错误而报错是在导入的类里面定义了静态成员也就是说导入类不准许静态成员的定义初始化代码出现引入类的静态成员在自己的实现文件里出现了定义。变量重定义了。
//这个已经查出来了在qqt_header.pri有一个WIN64的缺失导致QQT_STATIC_LIBRARY缺失引发QQt在QQTSHAREDEXPORT=import下编译所以引发这个变量重新定义的错误而报错是在导入的类里面定义了静态成员也就是说导入类不准许静态成员的定义初始化代码出现引入类的静态成员在自己的实现文件里出现了定义。变量重定义了。
static QQtWavSoundEffect* msInstance;
QQtWavAudioInput mWavInput;

View File

@ -24,39 +24,39 @@ protected:
struct timeval Posix_Timeout;
struct timeval Posix_Copy_Timeout;
virtual qint64 readData(char* data, qint64 maxSize);
virtual qint64 writeData(const char* data, qint64 maxSize);
virtual qint64 readData ( char* data, qint64 maxSize );
virtual qint64 writeData ( const char* data, qint64 maxSize );
public:
Posix_QextSerialPort();
Posix_QextSerialPort(const Posix_QextSerialPort& s);
Posix_QextSerialPort(const QString& name, QextSerialBase::QueryMode mode = QextSerialBase::Polling);
Posix_QextSerialPort(const PortSettings& settings, QextSerialBase::QueryMode mode = QextSerialBase::Polling);
Posix_QextSerialPort(const QString& name, const PortSettings& settings,
QextSerialBase::QueryMode mode = QextSerialBase::Polling);
Posix_QextSerialPort& operator=(const Posix_QextSerialPort& s);
Posix_QextSerialPort ( const Posix_QextSerialPort& s );
Posix_QextSerialPort ( const QString& name, QextSerialBase::QueryMode mode = QextSerialBase::Polling );
Posix_QextSerialPort ( const PortSettings& settings, QextSerialBase::QueryMode mode = QextSerialBase::Polling );
Posix_QextSerialPort ( const QString& name, const PortSettings& settings,
QextSerialBase::QueryMode mode = QextSerialBase::Polling );
Posix_QextSerialPort& operator= ( const Posix_QextSerialPort& s );
virtual ~Posix_QextSerialPort();
virtual void setBaudRate(BaudRateType);
virtual void setDataBits(DataBitsType);
virtual void setParity(ParityType);
virtual void setStopBits(StopBitsType);
virtual void setFlowControl(FlowType);
virtual void setTimeout(long);
virtual void setBaudRate ( BaudRateType );
virtual void setDataBits ( DataBitsType );
virtual void setParity ( ParityType );
virtual void setStopBits ( StopBitsType );
virtual void setFlowControl ( FlowType );
virtual void setTimeout ( long );
virtual bool open(OpenMode mode);
virtual bool open ( OpenMode mode );
virtual void close();
virtual void flush();
virtual qint64 size() const;
virtual qint64 bytesAvailable();
virtual void ungetChar(char c);
virtual void ungetChar ( char c );
virtual void translateError(ulong error);
virtual void translateError ( ulong error );
virtual void setDtr(bool set = true);
virtual void setRts(bool set = true);
virtual void setDtr ( bool set = true );
virtual void setRts ( bool set = true );
virtual ulong lineStatus();
};

View File

@ -163,22 +163,22 @@ protected:
ulong lastErr;
QextSerialBase::QueryMode _queryMode;
virtual qint64 readData(char* data, qint64 maxSize) = 0;
virtual qint64 writeData(const char* data, qint64 maxSize) = 0;
virtual qint64 readData ( char* data, qint64 maxSize ) = 0;
virtual qint64 writeData ( const char* data, qint64 maxSize ) = 0;
public:
QextSerialBase();
QextSerialBase(const QString& name);
QextSerialBase ( const QString& name );
virtual ~QextSerialBase();
virtual void construct();
virtual void setPortName(const QString& name);
virtual void setPortName ( const QString& name );
virtual QString portName() const;
/**!
* Get query mode.
* \return query mode.
*/
inline QextSerialBase::QueryMode queryMode() const { return _queryMode; };
inline QextSerialBase::QueryMode queryMode() const { return _queryMode; }
/*!
* Set desired serial communication handling style. You may choose from polling
@ -202,23 +202,23 @@ public:
*
* \param mode query mode.
*/
virtual void setQueryMode(QueryMode mode);
virtual void setQueryMode ( QueryMode mode );
// virtual void setBlockingRead(bool block) = 0; ///< @todo implement.
virtual void setBaudRate(BaudRateType) = 0;
virtual void setBaudRate ( BaudRateType ) = 0;
virtual BaudRateType baudRate() const;
virtual void setDataBits(DataBitsType) = 0;
virtual void setDataBits ( DataBitsType ) = 0;
virtual DataBitsType dataBits() const;
virtual void setParity(ParityType) = 0;
virtual void setParity ( ParityType ) = 0;
virtual ParityType parity() const;
virtual void setStopBits(StopBitsType) = 0;
virtual void setStopBits ( StopBitsType ) = 0;
virtual StopBitsType stopBits() const;
virtual void setFlowControl(FlowType) = 0;
virtual void setFlowControl ( FlowType ) = 0;
virtual FlowType flowControl() const;
virtual void setTimeout(long) = 0;
virtual void setTimeout ( long ) = 0;
virtual bool open(OpenMode mode) = 0;
virtual bool open ( OpenMode mode ) = 0;
virtual bool isSequential() const;
virtual void close() = 0;
virtual void flush() = 0;
@ -227,14 +227,14 @@ public:
virtual qint64 bytesAvailable() = 0;
virtual bool atEnd() const;
virtual void ungetChar(char c) = 0;
virtual qint64 readLine(char* data, qint64 maxSize);
virtual void ungetChar ( char c ) = 0;
virtual qint64 readLine ( char* data, qint64 maxSize );
virtual ulong lastError() const;
virtual void translateError(ulong error) = 0;
virtual void translateError ( ulong error ) = 0;
virtual void setDtr(bool set = true) = 0;
virtual void setRts(bool set = true) = 0;
virtual void setDtr ( bool set = true ) = 0;
virtual void setRts ( bool set = true ) = 0;
virtual ulong lineStatus() = 0;
signals:
@ -253,7 +253,7 @@ signals:
*
* \see lineStatus().
*/
void dsrChanged(bool status);
void dsrChanged ( bool status );
};
#endif

View File

@ -35,7 +35,7 @@ struct QextPortInfo
* Windows implementation is based on Zach Gorman's work from
* <a href="http://www.codeproject.com">The Code Project</a> (http://www.codeproject.com/system/setupdi.asp).
*/
class QextSerialEnumerator
class LIBRARY_SHARED_EXPORT QextSerialEnumerator
{
private:
#ifdef _TTY_WIN_
@ -45,7 +45,7 @@ private:
* \param property property name.
* \return property value.
*/
static QString getRegKeyValue(HKEY key, LPCTSTR property);
static QString getRegKeyValue ( HKEY key, LPCTSTR property );
/*!
* Get specific property from registry.
@ -56,13 +56,13 @@ private:
* \param property registry property. One of defined SPDRP_* constants.
* \return property string.
*/
static QString getDeviceProperty(HDEVINFO devInfo, PSP_DEVINFO_DATA devData, DWORD property);
static QString getDeviceProperty ( HDEVINFO devInfo, PSP_DEVINFO_DATA devData, DWORD property );
/*!
* Search for serial ports using setupapi.
* \param infoList list with result.
*/
static void setupAPIScan(QList<QextPortInfo>& infoList);
static void setupAPIScan ( QList<QextPortInfo>& infoList );
#endif /*_TTY_WIN_*/
public:

View File

@ -13,7 +13,7 @@
#define QextBaseType Win_QextSerialPort
#endif
class QextSerialPort: public QextBaseType
class LIBRARY_SHARED_EXPORT QextSerialPort: public QextBaseType
{
Q_OBJECT
@ -21,11 +21,11 @@ public:
typedef QextSerialBase::QueryMode QueryMode;
QextSerialPort();
QextSerialPort(const QString& name, QueryMode mode = QextSerialPort::Polling);
QextSerialPort(PortSettings const& s, QueryMode mode = QextSerialPort::Polling);
QextSerialPort(const QString& name, PortSettings const& s, QueryMode mode = QextSerialPort::Polling);
QextSerialPort(const QextSerialPort& s);
QextSerialPort& operator=(const QextSerialPort&);
QextSerialPort ( const QString& name, QueryMode mode = QextSerialPort::Polling );
QextSerialPort ( PortSettings const& s, QueryMode mode = QextSerialPort::Polling );
QextSerialPort ( const QString& name, PortSettings const& s, QueryMode mode = QextSerialPort::Polling );
QextSerialPort ( const QextSerialPort& s );
QextSerialPort& operator= ( const QextSerialPort& );
virtual ~QextSerialPort();
};

View File

@ -9,8 +9,6 @@ contains (DEFINES, __PLUGINSUPPORT__) {
contains(QSYS_PRIVATE, Win32|Windows|Win64 || MSVC32|MSVC|MSVC64) {
contains (DEFINES, QQT_LIBRARY) {
DEFINES += BUILD_QDEVICEWATCHER_LIB
} else: contains (DEFINES, QQT_STATIC_LIBRARY) {
DEFINES += BUILD_QDEVICEWATCHER_STATIC
}
wince*: SOURCES += $$PWD/pluginsupport/devicewatcher/qdevicewatcher_wince.cpp
else: SOURCES += $$PWD/pluginsupport/devicewatcher/qdevicewatcher_win32.cpp
@ -35,9 +33,6 @@ contains(DEFINES, __QQTCHARTS__) {
win32 {
contains (DEFINES, QQT_LIBRARY) {
DEFINES += QCUSTOMPLOT_COMPILE_LIBRARY
} else: contains (DEFINES, QQT_STATIC_LIBRARY) {
#build static library - qcustomplot
DEFINES += QCUSTOMPLOT_STATIC_LIBRARY
}
}
SOURCES += $$PWD/charts/qcustomplot/qcpdocumentobject.cpp \
@ -52,6 +47,12 @@ contains (DEFINES, __NETWORKSUPPORT__) {
#if you use qextserialport, open the two annotation
#注释在qqt_header.pri打开 DEFINES += __QEXTSERIALPORT__
contains (DEFINES, __QEXTSERIALPORT__) {
win32 {
contains (DEFINES, QQT_LIBRARY) {
DEFINES += QEXTSERIALPORT_LIBRARY
}
}
#include ( $$PWD/network/qextserialport/qextserialport.pri )
HEADERS += $$PWD/network/qextserialport/qextserialbase.h \
$$PWD/network/qextserialport/qextserialport.h \
@ -70,8 +71,6 @@ contains (DEFINES, __NETWORKSUPPORT__) {
win32 {
contains (DEFINES, QQT_LIBRARY) {
DEFINES += QT_QTSOAP_LIBRARY
} else: contains (DEFINES, QQT_STATIC_LIBRARY) {
DEFINES += QT_QTSOAP_STATIC_LIBRARY
}
}
SOURCES += \
@ -91,8 +90,6 @@ contains (DEFINES, __NETWORKSUPPORT__) {
win32 {
contains (DEFINES, QQT_LIBRARY) {
DEFINES += QT_GUMBO_LIBRARY
} else: contains (DEFINES, QQT_STATIC_LIBRARY) {
DEFINES += QT_GUMBO_STATIC_LIBRARY
}
}
include ($$PWD/network/gumbo/parser/gumbo-parser.pri)
@ -122,8 +119,6 @@ contains (DEFINES, __EXQUISITE__) {
#ignore: QZXing has no need to export
contains (DEFINES, QQT_LIBRARY) {
DEFINES += QZXING_LIBRARY
} else: contains (DEFINES, QQT_STATIC_LIBRARY) {
DEFINES += QZXING_STATIC_LIBRARY
}
}
include ($$PWD/exquisite/qrcode/qrdecode/qrdecode.pri)
@ -142,8 +137,6 @@ contains (DEFINES, __EXQUISITE__) {
#mathml
contains (DEFINES, QQT_LIBRARY) {
DEFINES += QT_QTMMLWIDGET_LIBRARY
} else: contains (DEFINES, QQT_STATIC_LIBRARY) {
DEFINES += QT_QTMMLWIDGET_STATIC_LIBRARY
}
}
SOURCES += $$PWD/exquisite/mathml/qtmmlwidget.cpp

View File

@ -84,13 +84,8 @@ defineTest(add_defines_QQt){
}
#link and build all need this macro
#现在Multi-link v2里面已经有LIB_STATIC_LIBRARY这个宏多余了可是由于内部逻辑复杂更改也不简单所以留着了。用户静态编译LibQQt记得定义QQT_STATIC_LIBRARYbuild and link。
contains(DEFINES, QQT_STATIC_LIBRARY) {
DEFINES += QCUSTOMPLOT_STATIC_LIBRARY
DEFINES += QZXING_STATIC_LIBRARY
DEFINES += QT_QTSOAP_STATIC_LIBRARY
DEFINES += BUILD_QDEVICEWATCHER_STATIC
DEFINES += QT_QTMMLWIDGET_STATIC_LIBRARY
DEFINES += QT_GUMBO_STATIC_LIBRARY
}
################################################################
@ -141,6 +136,13 @@ defineTest(add_defines_QQt){
contains(QSYS_PRIVATE, iOS||iOSSimulator||macOS) {
DEFINES -= __PLUGINSUPPORT__
}
contains (DEFINES, __PLUGINSUPPORT__) {
contains(QSYS_PRIVATE, Win32|Windows|Win64 || MSVC32|MSVC|MSVC64) {
contains (DEFINES, QQT_STATIC_LIBRARY) {
DEFINES += BUILD_QDEVICEWATCHER_STATIC
}
}
}
##################PrintSupport Module###############################
#if you use printsupport , open this annotation
@ -180,6 +182,14 @@ defineTest(add_defines_QQt){
#in ios qcustomplot can't call savePdf now, no result but a log no printer error.
#默认打开customplot
DEFINES += __CUSTOMPLOT__
contains (DEFINES, __CUSTOMPLOT__) {
win32 {
contains (DEFINES, QQT_STATIC_LIBRARY) {
#build static library - qcustomplot
DEFINES += QCUSTOMPLOT_STATIC_LIBRARY
}
}
}
}
##################QQtLogSystem Module###############################
@ -250,6 +260,13 @@ defineTest(add_defines_QQt){
##################WebService Module###############################
#if you use Qt Service Support ( QtSoap ), open this annotation
DEFINES += __WEBSERVICESUPPORT__
contains (DEFINES, __WEBSERVICESUPPORT__) {
win32 {
contains (DEFINES, QQT_STATIC_LIBRARY) {
DEFINES += QT_QTSOAP_STATIC_LIBRARY
}
}
}
#One Ftp Http 单工...
#Multi 半双工(客户端并发,服务器序列) QNetworkAccessManager
@ -291,6 +308,11 @@ defineTest(add_defines_QQt){
contains (DEFINES, __GUMBOSUPPORT__) {
#Gumbo need std support, c99...
QMAKE_CFLAGS += -std=c99
win32 {
contains (DEFINES, QQT_STATIC_LIBRARY) {
DEFINES += QT_GUMBO_STATIC_LIBRARY
}
}
}
}
@ -312,6 +334,12 @@ defineTest(add_defines_QQt){
contains(DEFINES, __QRDECODE__) {
#lessThan(QT_MAJOR_VERSION, 5): QT += declarative
greaterThan(QT_MAJOR_VERSION, 4): QT += quick
contains(QSYS_PRIVATE, Win32|Windows|Win64 || MSVC32|MSVC|MSVC64) {
#ignore: QZXing has no need to export
contains (DEFINES, QQT_STATIC_LIBRARY) {
DEFINES += QZXING_STATIC_LIBRARY
}
}
}
#if you use gif widgets, open this annotation
@ -328,7 +356,13 @@ defineTest(add_defines_QQt){
##################Mathes Module###############################
DEFINES += __MATHWIDGETSUPPORT__
contains (DEFINES, __SVGWIDGETS__) {
contains(QSYS_PRIVATE, Win32|Windows|Win64 || MSVC32|MSVC|MSVC64) {
contains (DEFINES, QQT_STATIC_LIBRARY) {
DEFINES += QT_QTMMLWIDGET_STATIC_LIBRARY
}
}
}
#LOGIC CAMERA PREVIEW
#depend on dmmu
DEFINES += __LOGICCAMERAMODULE__