mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
add qqt sdk support
This commit is contained in:
parent
5cbfbbf7a6
commit
4084771d3f
2
QQt.pro
2
QQt.pro
@ -14,7 +14,7 @@ SUBDIRS += examples/QtSdkManager
|
||||
SUBDIRS += examples/QQtInstaller
|
||||
|
||||
#need QQt installed to Qt library
|
||||
#SUBDIRS += examples/qqtframe3
|
||||
SUBDIRS += examples/qqtframe3
|
||||
|
||||
#need bluetooth library
|
||||
#SUBDIRS += examples/qqtbluetoothfiletransferserver
|
||||
|
@ -1,11 +1,17 @@
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
#include <qqtcustomspeedmeter.h>
|
||||
|
||||
MainWindow::MainWindow(QWidget* parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->w0->setMinValue(0);
|
||||
//ui->widget->setMaxValue(100);
|
||||
//ui->widget->setValue(80);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
|
@ -14,7 +14,7 @@
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<widget class="QQtCustomSpeedMeter" name="widget" native="true">
|
||||
<widget class="QQtCustomSpeedMeter" name="w0" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
@ -31,7 +31,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>661</width>
|
||||
<height>22</height>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
|
@ -3,12 +3,47 @@
|
||||
# Project created by QtCreator 2017-10-27T12:29:41
|
||||
#
|
||||
#-------------------------------------------------
|
||||
#need QQt.pro CONFIG+=create_sdk support
|
||||
|
||||
#QQt source root on your computer
|
||||
equals(QMAKE_HOST.os, Darwin) {
|
||||
QQT_SOURCE_ROOT = /Users/abel/Develop/a0-develop/a0-qqtfoundation
|
||||
} else: equals(QMAKE_HOST.os, Linux) {
|
||||
QQT_SOURCE_ROOT = /home/abel/Develop/a0-develop/LibQt
|
||||
} else: equals(QMAKE_HOST.os, Windows) {
|
||||
QQT_SOURCE_ROOT = C:/Users/Administrator/Develop/a0-develop/a0-qqtfoundation
|
||||
}
|
||||
|
||||
include($${QQT_SOURCE_ROOT}/src/qqt_header.pri)
|
||||
#CONFIG += BUILD_SRC
|
||||
contains (CONFIG, BUILD_SRC) {
|
||||
#if you want to build src but not link QQt in this project
|
||||
include($${QQT_SOURCE_ROOT}/src/qqt_source.pri)
|
||||
} else {
|
||||
#if you want to link QQt library
|
||||
include($${QQT_SOURCE_ROOT}/src/qqt_library.pri)
|
||||
}
|
||||
|
||||
############
|
||||
##install
|
||||
############
|
||||
#CONFIG += can_install
|
||||
can_install:equals(QKIT_, EMBEDDED) {
|
||||
target.path = /Application
|
||||
INSTALLS += target
|
||||
} else: unix {
|
||||
equals(QKIT_, macOS) {
|
||||
target.path = /Applications
|
||||
INSTALLS += target
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
QT += core gui
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
QT += qqt
|
||||
|
||||
TARGET = qqtframe3
|
||||
TEMPLATE = app
|
||||
|
@ -78,7 +78,10 @@ include ($$PWD/qqt_source.pri)
|
||||
################################################
|
||||
##install to Qt library
|
||||
################################################
|
||||
#if you want to use QQt with QT += QQtCore please open this feature
|
||||
#if you want to use QQt with QT += QQt please open this feature
|
||||
#unimplete: CONFIG += install_to_qt_library
|
||||
#use to output sdk
|
||||
CONFIG += create_sdk
|
||||
include ($$PWD/qqt_install.pri)
|
||||
|
||||
################################################
|
||||
|
@ -127,8 +127,9 @@ MODULE_NAME=qqt
|
||||
MODULE_CNAME=QQt
|
||||
|
||||
QQT_BUILD_DIR=$$OUT_PWD/bin
|
||||
QQT_TEMP_DIR=$$PWD/../install
|
||||
QQT_BASE_DIR=$$QQT_TEMP_DIR
|
||||
#sdk path
|
||||
QQT_TEMP_DIR=$$PWD/../sdk
|
||||
isEmpty(QQT_BASE_DIR) : QQT_BASE_DIR = $$QQT_TEMP_DIR
|
||||
#QQT_BASE_DIR=$$[QT_INSTALL_DATA]
|
||||
message(QQt sdk install here:$${QQT_BASE_DIR})
|
||||
|
||||
@ -186,9 +187,7 @@ contains(QKIT_, macOS) {
|
||||
QMAKE_POST_LINK += $$MK_DIR $$QQT_BUNDLE_INC_DIR $$CMD_SEP
|
||||
QMAKE_POST_LINK += $$COPY $$HEADERS $$QQT_BUNDLE_INC_DIR $$CMD_SEP
|
||||
}else{
|
||||
!equals(QQT_BASE_DIR , $$[QT_INSTALL_DATA]){
|
||||
QMAKE_POST_LINK += $$MK_DIR $$QQT_INC_DIR $$CMD_SEP
|
||||
}
|
||||
QMAKE_POST_LINK += $$COPY $$HEADERS $$QQT_INC_DIR $$CMD_SEP
|
||||
}
|
||||
|
||||
|
48
src/qqt_library.pri
Normal file
48
src/qqt_library.pri
Normal file
@ -0,0 +1,48 @@
|
||||
#don't modify this pri file.
|
||||
|
||||
message(Link QQt to $${TARGET} $${QKIT_} \
|
||||
at $${QT_VERSION} $${SYSNAME} $${BUILD} \
|
||||
on $${QMAKE_HOST.os})
|
||||
|
||||
QQT_LIB_PWD = $$PWD/../sdk/lib
|
||||
message (QQt linked from: $$QQT_LIB_PWD)
|
||||
|
||||
contains(DEFINES, __DARWIN__) {
|
||||
lessThan(QT_MAJOR_VERSION, 5):{
|
||||
LIBS += -L$${QQT_LIB_PWD}
|
||||
LIBS += -l QQt
|
||||
} else {
|
||||
LIBS += -F$${QQT_LIB_PWD}
|
||||
LIBS += -framework QQt
|
||||
}
|
||||
} else {
|
||||
LIBS += -L$${QQT_LIB_PWD}
|
||||
LIBS += -l QQt
|
||||
}
|
||||
|
||||
#not good to use, some function error
|
||||
#CONFIG += qmake_deploy
|
||||
qmake_deploy:equals(QKIT_, macOS) {
|
||||
QQT_MAJOR_VERSION = 1
|
||||
QMAKE_POST_LINK += install_name_tool -change QQt.framework/Versions/$${QQT_MAJOR_VERSION}/QQt \
|
||||
@rpath/QQt.framework/Versions/$${QQT_MAJOR_VERSION}/QQt \
|
||||
bin/$${TARGET}.app/Contents/MacOS/$$TARGET &&
|
||||
QMAKE_POST_LINK += cp -fr $${QQT_LIB_PWD}/QQt.framework \
|
||||
bin/$${TARGET}.app/Contents/Frameworks &&
|
||||
QMAKE_POST_LINK += macdeployqt bin/$${TARGET}.app -verbose=1
|
||||
}
|
||||
|
||||
############
|
||||
##config defination
|
||||
############
|
||||
equals(QKIT_, macOS) {
|
||||
CONFIG += app_bundle
|
||||
}
|
||||
equals(QKIT_, ANDROID) {
|
||||
CONFIG += mobility
|
||||
MOBILITY =
|
||||
#DISTFILES += \
|
||||
# android/AndroidManifest.xml
|
||||
|
||||
#ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user