mirror of
https://github.com/miurahr/aqtinstall.git
synced 2025-12-18 13:14:37 +03:00
Azure: Add ci script generator (#20)
thanks @nelsonjchen Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,3 +8,4 @@ __pycache__
|
|||||||
.tox
|
.tox
|
||||||
.venv
|
.venv
|
||||||
_build
|
_build
|
||||||
|
ci/*.matrix.gen.yml
|
||||||
@@ -12,9 +12,7 @@ Another Qt installer(aqt)
|
|||||||
|
|
||||||
.. |macos| image:: https://dev.azure.com/miurahr/github/_apis/build/status/miurahr.aqtinstall?branchName=master&jobName=macOS
|
.. |macos| image:: https://dev.azure.com/miurahr/github/_apis/build/status/miurahr.aqtinstall?branchName=master&jobName=macOS
|
||||||
:target: https://dev.azure.com/miurahr/github/_build/latest?definitionId=6&branchName=master
|
:target: https://dev.azure.com/miurahr/github/_build/latest?definitionId=6&branchName=master
|
||||||
.. |ubuntu3| image:: https://dev.azure.com/miurahr/github/_apis/build/status/miurahr.aqtinstall?branchName=master&jobName=Ubuntu_1604_py3
|
.. |ubuntu3| image:: https://dev.azure.com/miurahr/github/_apis/build/status/miurahr.aqtinstall?branchName=master&jobName=Linux
|
||||||
:target: https://dev.azure.com/miurahr/github/_build/latest?definitionId=6&branchName=master
|
|
||||||
.. |ubuntu2| image:: https://dev.azure.com/miurahr/github/_apis/build/status/miurahr.aqtinstall?branchName=master&jobName=Ubuntu_1604_py2
|
|
||||||
:target: https://dev.azure.com/miurahr/github/_build/latest?definitionId=6&branchName=master
|
:target: https://dev.azure.com/miurahr/github/_build/latest?definitionId=6&branchName=master
|
||||||
.. |windows| image:: https://dev.azure.com/miurahr/github/_apis/build/status/miurahr.aqtinstall?branchName=master&jobName=Windows
|
.. |windows| image:: https://dev.azure.com/miurahr/github/_apis/build/status/miurahr.aqtinstall?branchName=master&jobName=Windows
|
||||||
:target: https://dev.azure.com/miurahr/github/_build/latest?definitionId=6&branchName=master
|
:target: https://dev.azure.com/miurahr/github/_build/latest?definitionId=6&branchName=master
|
||||||
@@ -26,8 +24,6 @@ Another Qt installer(aqt)
|
|||||||
+-------------+-----------+
|
+-------------+-----------+
|
||||||
| Ubuntu | |ubuntu3| |
|
| Ubuntu | |ubuntu3| |
|
||||||
+-------------+-----------+
|
+-------------+-----------+
|
||||||
| Python2 | |ubuntu2| |
|
|
||||||
+-------------+-----------+
|
|
||||||
| Windows | |windows| |
|
| Windows | |windows| |
|
||||||
+-------------+-----------+
|
+-------------+-----------+
|
||||||
|
|
||||||
@@ -126,7 +122,7 @@ For details see `Qt licensing`_ and `Licenses used in Qt5`_
|
|||||||
History
|
History
|
||||||
-------
|
-------
|
||||||
|
|
||||||
This program is originally shown in `Kaidan`_ project
|
This program is originally shown in `Kaidan`_ project as a name `qli-installer`.
|
||||||
A project `aqtinstall` extend the original to run with standard python features with Linux, Mac and Windows,
|
A project `aqtinstall` extend the original to run with standard python features with Linux, Mac and Windows,
|
||||||
to be tested on CI platform, and to improve performance with a concurrent downloading.
|
to be tested on CI platform, and to improve performance with a concurrent downloading.
|
||||||
|
|
||||||
|
|||||||
@@ -1,135 +1,335 @@
|
|||||||
|
# Generated by `generate_azure_pipelines_yml.py`
|
||||||
variables:
|
# Please edit template in `ci/`
|
||||||
aqt_version: 0.3.1
|
|
||||||
qtversion: 5.12.1
|
|
||||||
pydepends: requests six flake8 wheel twine
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
- job: Ubuntu_1604_py3
|
- job: Mac
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'ubuntu-16.04'
|
vmImage: macOS-10.14
|
||||||
steps:
|
steps:
|
||||||
- task: UsePythonVersion@0
|
- script: brew install p7zip
|
||||||
inputs:
|
displayName: Install 7zip
|
||||||
versionSpec: '3.6'
|
- template: ci/steps.yml
|
||||||
architecture: 'x64'
|
strategy:
|
||||||
- script: |
|
matrix:
|
||||||
python -m pip install $(pydepends)
|
Python 3.6 QT 5.12.3 mac desktop clang_64:
|
||||||
flake8 aqt bin
|
TARGET: desktop
|
||||||
displayName: 'Run lint tests'
|
ARCHDIR: clang_64
|
||||||
- script: |
|
QT_VERSION: 5.12.3
|
||||||
sudo apt-get update
|
HOST: mac
|
||||||
sudo apt-get -y install p7zip
|
PYTHON_VERSION: '3.6'
|
||||||
- task: PythonScript@0
|
ARCH: clang_64
|
||||||
inputs:
|
Python 3.6 QT 5.13.0 mac ios ios:
|
||||||
scriptSource: filePath
|
TARGET: ios
|
||||||
scriptPath: $(Build.SourcesDirectory)/setup.py
|
ARCHDIR: ios
|
||||||
arguments: sdist bdist_wheel
|
QT_VERSION: 5.13.0
|
||||||
workingDirectory: $(Build.SourcesDirectory)
|
HOST: mac
|
||||||
displayName: build package
|
PYTHON_VERSION: '3.6'
|
||||||
- script: pip install $(Build.SourcesDirectory)/dist/aqtinstall-$(aqt_version)-py2.py3-none-any.whl
|
ARCH: ios
|
||||||
displayName: install package
|
Python 3.6 QT 5.13.0 mac android android_x86:
|
||||||
- task: PythonScript@0
|
TARGET: android
|
||||||
inputs:
|
ARCHDIR: android_x86
|
||||||
scriptSource: filePath
|
QT_VERSION: 5.13.0
|
||||||
scriptPath: $(Build.SourcesDirectory)/bin/aqt
|
HOST: mac
|
||||||
arguments: install $(qtversion) linux desktop
|
PYTHON_VERSION: '3.6'
|
||||||
workingDirectory: $(Build.BinariesDirectory)
|
ARCH: android_x86
|
||||||
displayName: install qt
|
Python 3.6 QT 5.13.0 mac android android_armv7:
|
||||||
- script: |
|
TARGET: android
|
||||||
$(Build.BinariesDirectory)/Qt$(qtversion)/$(qtversion)/gcc_64/bin/qmake $(Build.SourcesDirectory)/tests
|
ARCHDIR: android_armv7
|
||||||
make
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: mac
|
||||||
- job: Ubuntu_1604_py2
|
PYTHON_VERSION: '3.6'
|
||||||
pool:
|
ARCH: android_armv7
|
||||||
vmImage: 'ubuntu-16.04'
|
Python 3.7 QT 5.13.0 mac ios ios:
|
||||||
steps:
|
TARGET: ios
|
||||||
- task: UsePythonVersion@0
|
ARCHDIR: ios
|
||||||
inputs:
|
QT_VERSION: 5.13.0
|
||||||
versionSpec: '2.7'
|
HOST: mac
|
||||||
architecture: 'x64'
|
PYTHON_VERSION: '3.7'
|
||||||
- script: |
|
ARCH: ios
|
||||||
sudo apt-get update
|
Python 3.7 QT 5.13.0 mac android android_armv7:
|
||||||
sudo apt-get -y install p7zip
|
TARGET: android
|
||||||
python -m pip install $(pydepends)
|
ARCHDIR: android_armv7
|
||||||
- task: PythonScript@0
|
QT_VERSION: 5.13.0
|
||||||
inputs:
|
HOST: mac
|
||||||
scriptSource: filePath
|
PYTHON_VERSION: '3.7'
|
||||||
scriptPath: $(Build.SourcesDirectory)/setup.py
|
ARCH: android_armv7
|
||||||
arguments: sdist bdist_wheel
|
Python 3.6 QT 5.11.3 mac desktop clang_64:
|
||||||
workingDirectory: $(Build.SourcesDirectory)
|
TARGET: desktop
|
||||||
displayName: build package
|
ARCHDIR: clang_64
|
||||||
- script: pip install $(Build.SourcesDirectory)/dist/aqtinstall-$(aqt_version)-py2.py3-none-any.whl
|
QT_VERSION: 5.11.3
|
||||||
displayName: install package
|
HOST: mac
|
||||||
- task: PythonScript@0
|
PYTHON_VERSION: '3.6'
|
||||||
inputs:
|
ARCH: clang_64
|
||||||
scriptSource: filePath
|
Python 3.7 QT 5.12.3 mac desktop clang_64:
|
||||||
scriptPath: $(Build.SourcesDirectory)/bin/aqt
|
TARGET: desktop
|
||||||
arguments: install $(qtversion) linux desktop
|
ARCHDIR: clang_64
|
||||||
workingDirectory: $(Build.BinariesDirectory)
|
QT_VERSION: 5.12.3
|
||||||
displayName: install qt
|
HOST: mac
|
||||||
- script: |
|
PYTHON_VERSION: '3.7'
|
||||||
$(Build.BinariesDirectory)/Qt$(qtversion)/$(qtversion)/gcc_64/bin/qmake $(Build.SourcesDirectory)/tests
|
ARCH: clang_64
|
||||||
make
|
Python 3.6 QT 5.13.0 mac desktop clang_64:
|
||||||
- script: ls -lR $(Build.BinariesDirectory)
|
TARGET: desktop
|
||||||
|
ARCHDIR: clang_64
|
||||||
- job: macOS
|
QT_VERSION: 5.13.0
|
||||||
pool:
|
HOST: mac
|
||||||
vmImage: 'macOS-10.13'
|
PYTHON_VERSION: '3.6'
|
||||||
steps:
|
ARCH: clang_64
|
||||||
- task: UsePythonVersion@0
|
Python 3.7 QT 5.13.0 mac android android_x86:
|
||||||
inputs:
|
TARGET: android
|
||||||
versionSpec: '3.6'
|
ARCHDIR: android_x86
|
||||||
architecture: 'x64'
|
QT_VERSION: 5.13.0
|
||||||
- script: |
|
HOST: mac
|
||||||
brew install p7zip
|
PYTHON_VERSION: '3.7'
|
||||||
python -m pip install $(pydepends)
|
ARCH: android_x86
|
||||||
- task: PythonScript@0
|
Python 3.7 QT 5.13.0 mac desktop clang_64:
|
||||||
inputs:
|
TARGET: desktop
|
||||||
scriptSource: filePath
|
ARCHDIR: clang_64
|
||||||
scriptPath: $(Build.SourcesDirectory)/setup.py
|
QT_VERSION: 5.13.0
|
||||||
arguments: sdist bdist_wheel
|
HOST: mac
|
||||||
workingDirectory: $(Build.SourcesDirectory)
|
PYTHON_VERSION: '3.7'
|
||||||
displayName: build package
|
ARCH: clang_64
|
||||||
- script: pip install $(Build.SourcesDirectory)/dist/aqtinstall-$(aqt_version)-py2.py3-none-any.whl
|
Python 3.7 QT 5.11.3 mac desktop clang_64:
|
||||||
displayName: install package
|
TARGET: desktop
|
||||||
- task: PythonScript@0
|
ARCHDIR: clang_64
|
||||||
inputs:
|
QT_VERSION: 5.11.3
|
||||||
scriptSource: filePath
|
HOST: mac
|
||||||
scriptPath: $(Build.SourcesDirectory)/bin/aqt
|
PYTHON_VERSION: '3.7'
|
||||||
arguments: install $(qtversion) mac desktop
|
ARCH: clang_64
|
||||||
workingDirectory: $(Build.BinariesDirectory)
|
|
||||||
displayName: install qt
|
|
||||||
- script: |
|
|
||||||
$(Build.BinariesDirectory)/Qt$(qtversion)/$(qtversion)/clang_64/bin/qmake $(Build.SourcesDirectory)/tests
|
|
||||||
make
|
|
||||||
- script: ls -lR $(Build.BinariesDirectory)
|
|
||||||
|
|
||||||
- job: Windows
|
- job: Windows
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'vs2017-win2016'
|
vmImage: vs2017-win2016
|
||||||
steps:
|
steps:
|
||||||
- task: UsePythonVersion@0
|
- template: ci/steps.yml
|
||||||
inputs:
|
strategy:
|
||||||
versionSpec: '3.6'
|
matrix:
|
||||||
architecture: 'x64'
|
Python 3.7 QT 5.11.3 windows desktop win64_msvc2017_64:
|
||||||
- script: |
|
TARGET: desktop
|
||||||
cinst -y 7zip
|
ARCHDIR: msvc2017_64
|
||||||
python -m pip install $(pydepends)
|
QT_VERSION: 5.11.3
|
||||||
- task: PythonScript@0
|
HOST: windows
|
||||||
inputs:
|
PYTHON_VERSION: '3.7'
|
||||||
scriptSource: filePath
|
ARCH: win64_msvc2017_64
|
||||||
scriptPath: $(Build.SourcesDirectory)/setup.py
|
Python 3.6 QT 5.13.0 windows desktop win64_msvc2015_64:
|
||||||
arguments: sdist bdist_wheel
|
TARGET: desktop
|
||||||
workingDirectory: $(Build.SourcesDirectory)
|
ARCHDIR: msvc2015_64
|
||||||
displayName: build package
|
QT_VERSION: 5.13.0
|
||||||
- script: pip install $(Build.SourcesDirectory)/dist/aqtinstall-$(aqt_version)-py2.py3-none-any.whl
|
HOST: windows
|
||||||
displayName: install package
|
PYTHON_VERSION: '3.6'
|
||||||
- task: PythonScript@0
|
ARCH: win64_msvc2015_64
|
||||||
inputs:
|
Python 3.6 QT 5.13.0 windows desktop win64_msvc2017_64:
|
||||||
scriptSource: filePath
|
TARGET: desktop
|
||||||
scriptPath: $(Build.SourcesDirectory)/bin/aqt
|
ARCHDIR: msvc2017_64
|
||||||
arguments: install $(qtversion) windows desktop win64_msvc2017_64
|
QT_VERSION: 5.13.0
|
||||||
workingDirectory: $(Build.BinariesDirectory)
|
HOST: windows
|
||||||
displayName: install qt
|
PYTHON_VERSION: '3.6'
|
||||||
- script: ls -lR $(Build.BinariesDirectory)
|
ARCH: win64_msvc2017_64
|
||||||
|
Python 3.7 QT 5.13.0 windows android android_x86:
|
||||||
|
TARGET: android
|
||||||
|
ARCHDIR: android_x86
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.7'
|
||||||
|
ARCH: android_x86
|
||||||
|
Python 3.6 QT 5.11.3 windows desktop win32_msvc2015:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: msvc2015
|
||||||
|
QT_VERSION: 5.11.3
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.6'
|
||||||
|
ARCH: win32_msvc2015
|
||||||
|
Python 3.7 QT 5.13.0 windows desktop win64_msvc2015_64:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: msvc2015_64
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.7'
|
||||||
|
ARCH: win64_msvc2015_64
|
||||||
|
Python 3.6 QT 5.13.0 windows desktop win32_msvc2017:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: msvc2017
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.6'
|
||||||
|
ARCH: win32_msvc2017
|
||||||
|
Python 3.6 QT 5.13.0 windows android android_x86:
|
||||||
|
TARGET: android
|
||||||
|
ARCHDIR: android_x86
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.6'
|
||||||
|
ARCH: android_x86
|
||||||
|
Python 3.7 QT 5.13.0 windows desktop win32_msvc2017:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: msvc2017
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.7'
|
||||||
|
ARCH: win32_msvc2017
|
||||||
|
Python 3.7 QT 5.13.0 windows desktop win32_mingw73:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: mingw73
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.7'
|
||||||
|
ARCH: win32_mingw73
|
||||||
|
Python 3.6 QT 5.13.0 windows android android_armv7:
|
||||||
|
TARGET: android
|
||||||
|
ARCHDIR: android_armv7
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.6'
|
||||||
|
ARCH: android_armv7
|
||||||
|
Python 3.7 QT 5.12.3 windows desktop win64_msvc2017_64:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: msvc2017_64
|
||||||
|
QT_VERSION: 5.12.3
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.7'
|
||||||
|
ARCH: win64_msvc2017_64
|
||||||
|
Python 3.6 QT 5.12.3 windows desktop win32_msvc2017:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: msvc2017
|
||||||
|
QT_VERSION: 5.12.3
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.6'
|
||||||
|
ARCH: win32_msvc2017
|
||||||
|
Python 3.7 QT 5.13.0 windows android android_armv7:
|
||||||
|
TARGET: android
|
||||||
|
ARCHDIR: android_armv7
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.7'
|
||||||
|
ARCH: android_armv7
|
||||||
|
Python 3.6 QT 5.11.3 windows desktop win64_msvc2017_64:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: msvc2017_64
|
||||||
|
QT_VERSION: 5.11.3
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.6'
|
||||||
|
ARCH: win64_msvc2017_64
|
||||||
|
Python 3.7 QT 5.11.3 windows desktop win32_msvc2015:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: msvc2015
|
||||||
|
QT_VERSION: 5.11.3
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.7'
|
||||||
|
ARCH: win32_msvc2015
|
||||||
|
Python 3.7 QT 5.13.0 windows desktop win64_mingw73:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: mingw73
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.7'
|
||||||
|
ARCH: win64_mingw73
|
||||||
|
Python 3.6 QT 5.12.3 windows desktop win64_msvc2017_64:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: msvc2017_64
|
||||||
|
QT_VERSION: 5.12.3
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.6'
|
||||||
|
ARCH: win64_msvc2017_64
|
||||||
|
Python 3.6 QT 5.13.0 windows desktop win32_mingw73:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: mingw73
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.6'
|
||||||
|
ARCH: win32_mingw73
|
||||||
|
Python 3.7 QT 5.13.0 windows desktop win64_msvc2017_64:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: msvc2017_64
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.7'
|
||||||
|
ARCH: win64_msvc2017_64
|
||||||
|
Python 3.6 QT 5.13.0 windows desktop win64_mingw73:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: mingw73
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.6'
|
||||||
|
ARCH: win64_mingw73
|
||||||
|
Python 3.7 QT 5.12.3 windows desktop win32_msvc2017:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: msvc2017
|
||||||
|
QT_VERSION: 5.12.3
|
||||||
|
HOST: windows
|
||||||
|
PYTHON_VERSION: '3.7'
|
||||||
|
ARCH: win32_msvc2017
|
||||||
|
- job: Linux
|
||||||
|
pool:
|
||||||
|
vmImage: ubuntu-16.04
|
||||||
|
steps:
|
||||||
|
- template: ci/steps.yml
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
Python 3.7 QT 5.13.0 linux android android_x86:
|
||||||
|
TARGET: android
|
||||||
|
ARCHDIR: android_x86
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: linux
|
||||||
|
PYTHON_VERSION: '3.7'
|
||||||
|
ARCH: android_x86
|
||||||
|
Python 3.6 QT 5.11.3 linux desktop gcc_64:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: gcc_64
|
||||||
|
QT_VERSION: 5.11.3
|
||||||
|
HOST: linux
|
||||||
|
PYTHON_VERSION: '3.6'
|
||||||
|
ARCH: gcc_64
|
||||||
|
Python 3.7 QT 5.13.0 linux android android_armv7:
|
||||||
|
TARGET: android
|
||||||
|
ARCHDIR: android_armv7
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: linux
|
||||||
|
PYTHON_VERSION: '3.7'
|
||||||
|
ARCH: android_armv7
|
||||||
|
Python 3.7 QT 5.12.3 linux desktop gcc_64:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: gcc_64
|
||||||
|
QT_VERSION: 5.12.3
|
||||||
|
HOST: linux
|
||||||
|
PYTHON_VERSION: '3.7'
|
||||||
|
ARCH: gcc_64
|
||||||
|
Python 3.6 QT 5.13.0 linux android android_x86:
|
||||||
|
TARGET: android
|
||||||
|
ARCHDIR: android_x86
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: linux
|
||||||
|
PYTHON_VERSION: '3.6'
|
||||||
|
ARCH: android_x86
|
||||||
|
Python 3.6 QT 5.13.0 linux desktop gcc_64:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: gcc_64
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: linux
|
||||||
|
PYTHON_VERSION: '3.6'
|
||||||
|
ARCH: gcc_64
|
||||||
|
Python 3.6 QT 5.12.3 linux desktop gcc_64:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: gcc_64
|
||||||
|
QT_VERSION: 5.12.3
|
||||||
|
HOST: linux
|
||||||
|
PYTHON_VERSION: '3.6'
|
||||||
|
ARCH: gcc_64
|
||||||
|
Python 3.7 QT 5.13.0 linux desktop gcc_64:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: gcc_64
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: linux
|
||||||
|
PYTHON_VERSION: '3.7'
|
||||||
|
ARCH: gcc_64
|
||||||
|
Python 3.6 QT 5.13.0 linux android android_armv7:
|
||||||
|
TARGET: android
|
||||||
|
ARCHDIR: android_armv7
|
||||||
|
QT_VERSION: 5.13.0
|
||||||
|
HOST: linux
|
||||||
|
PYTHON_VERSION: '3.6'
|
||||||
|
ARCH: android_armv7
|
||||||
|
Python 3.7 QT 5.11.3 linux desktop gcc_64:
|
||||||
|
TARGET: desktop
|
||||||
|
ARCHDIR: gcc_64
|
||||||
|
QT_VERSION: 5.11.3
|
||||||
|
HOST: linux
|
||||||
|
PYTHON_VERSION: '3.7'
|
||||||
|
ARCH: gcc_64
|
||||||
|
|||||||
21
ci/azure-pipelines.tmpl.yml
Normal file
21
ci/azure-pipelines.tmpl.yml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Generated by `generate_azure_pipelines_yml.py`
|
||||||
|
# Please edit template in `ci/`
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
- job: Mac
|
||||||
|
pool:
|
||||||
|
vmImage: 'macOS-10.14'
|
||||||
|
steps:
|
||||||
|
- script: brew install p7zip
|
||||||
|
displayName: Install 7zip
|
||||||
|
- template: ci/steps.yml
|
||||||
|
- job: Windows
|
||||||
|
pool:
|
||||||
|
vmImage: 'vs2017-win2016'
|
||||||
|
steps:
|
||||||
|
- template: ci/steps.yml
|
||||||
|
- job: Linux
|
||||||
|
pool:
|
||||||
|
vmImage: 'ubuntu-16.04'
|
||||||
|
steps:
|
||||||
|
- template: ci/steps.yml
|
||||||
99
ci/steps.yml
Normal file
99
ci/steps.yml
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
steps:
|
||||||
|
- task: UsePythonVersion@0
|
||||||
|
inputs:
|
||||||
|
versionSpec: '3.6'
|
||||||
|
architecture: 'x64'
|
||||||
|
- script: |
|
||||||
|
cd $(Build.SourcesDirectory)
|
||||||
|
python -m pip install -rrequirements.txt
|
||||||
|
displayName: 'Install dependency'
|
||||||
|
- script: flake8 aqt bin
|
||||||
|
displayName: 'Run lint tests'
|
||||||
|
- task: PythonScript@0
|
||||||
|
inputs:
|
||||||
|
scriptSource: filePath
|
||||||
|
scriptPath: $(Build.SourcesDirectory)/setup.py
|
||||||
|
arguments: sdist bdist_wheel
|
||||||
|
workingDirectory: $(Build.SourcesDirectory)
|
||||||
|
displayName: build package
|
||||||
|
#
|
||||||
|
# Install aqtinstall
|
||||||
|
- bash: |
|
||||||
|
export AQT_VERSION=$(python $(Build.SourcesDirectory)/setup.py --version)
|
||||||
|
pip install $(Build.SourcesDirectory)/dist/aqtinstall-${AQT_VERSION}-py2.py3-none-any.whl
|
||||||
|
condition: or( eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' ))
|
||||||
|
displayName: install package on MacOS and Linux
|
||||||
|
- powershell: |
|
||||||
|
$aqtVersion = & python $(Build.SourcesDirectory)/setup.py --version | Out-String -Stream
|
||||||
|
pip install $(Build.SourcesDirectory)/dist/aqtinstall-$aqtVersion-py2.py3-none-any.whl
|
||||||
|
condition: eq( variables['Agent.OS'], 'Windows_NT' )
|
||||||
|
displayName: install package on Windows
|
||||||
|
#
|
||||||
|
# Run Aqt
|
||||||
|
- task: PythonScript@0
|
||||||
|
inputs:
|
||||||
|
scriptSource: filePath
|
||||||
|
scriptPath: $(Build.SourcesDirectory)/bin/aqt
|
||||||
|
arguments: install $(QT_VERSION) $(HOST) $(TARGET) $(ARCH)
|
||||||
|
workingDirectory: $(Build.BinariesDirectory)
|
||||||
|
displayName: Install Qt
|
||||||
|
#
|
||||||
|
# Test installation result
|
||||||
|
# for Android on linux
|
||||||
|
- script: |
|
||||||
|
wget https://dl.google.com/android/repository/android-ndk-r19c-linux-x86_64.zip
|
||||||
|
unzip android-ndk-r19c-linux-x86_64.zip
|
||||||
|
condition: and(eq(variables['TARGET'], 'android'), eq(variables['Agent.OS'], 'Linux'))
|
||||||
|
displayName: Download and extract Android NDK
|
||||||
|
# for Android on mac
|
||||||
|
- script: |
|
||||||
|
wget https://dl.google.com/android/repository/android-ndk-r19c-darwin-x86_64.zip
|
||||||
|
unzip android-ndk-r19c-darwin-x86_64.zip
|
||||||
|
condition: and(eq(variables['TARGET'], 'android'), eq(variables['Agent.OS'], 'Darwin'))
|
||||||
|
displayName: Download and extract Android NDK
|
||||||
|
# for Android on windows
|
||||||
|
- script: |
|
||||||
|
cinst -y --no-progress wget
|
||||||
|
wget https://dl.google.com/android/repository/android-ndk-r19c-windows-x86_64.zip
|
||||||
|
unzip android-ndk-r19c-windows-x86_64.zip
|
||||||
|
condition: and(eq(variables['TARGET'], 'android'), eq(variables['Agent.OS'], 'Windows_NT'))
|
||||||
|
displayName: Download and extract Android NDK
|
||||||
|
- script: |
|
||||||
|
export ANDROID_NDK_ROOT=$(Build.SourcesDirectory)/android-ndk-r19c
|
||||||
|
$(Build.BinariesDirectory)/Qt$(QT_VERSION)/$(QT_VERSION)/$(ARCHDIR)/bin/qmake $(Build.SourcesDirectory)/tests/accelbubble/ && make
|
||||||
|
condition: and(eq(variables['TARGET'], 'android'), or(eq(variables['Agent.OS'], 'Linux'), eq(variables['Agent.OS'], 'Darwin')))
|
||||||
|
displayName: Build accelbubble example application to test for android
|
||||||
|
# for desktop application
|
||||||
|
- powershell: |
|
||||||
|
if ('$(ARCH)' like '*msvc*') {
|
||||||
|
echo '##vso[task.setvariable variable=RUNTEST]true'
|
||||||
|
if ($(ARCH) like 'win64_msvc*') {
|
||||||
|
echo '##vso[task.setvariable variable=ARCHITECTURE]amd64'
|
||||||
|
} else {
|
||||||
|
echo '##vso[task.setvariable variable=ARCHITECTURE]x86'
|
||||||
|
}
|
||||||
|
if ('$(ARCH)' like '*msvc2017*') {
|
||||||
|
echo '##vso[task.setvariable variable=VS_VER]2017'
|
||||||
|
} else {
|
||||||
|
echo '##vso[task.setvariable variable=VS_VER]2015'
|
||||||
|
}
|
||||||
|
Install-PackageProvider NuGet -Force
|
||||||
|
Import-PackageProvider NuGet -Force
|
||||||
|
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
|
||||||
|
Install-Module Pscx -AllowClobber
|
||||||
|
Install-Module VSSetup -Scope CurrentUser
|
||||||
|
Import-VisualStudioVars -VisualStudioVersion $(VS_VER) -Architecture $(ARCHITECTURE)
|
||||||
|
$(Build.BinariesDirectory)/Qt$(QT_VERSION)/$(QT_VERSION)/$(ARCHDIR)/bin/qmake $(Build.SourcesDirectory)/tests
|
||||||
|
nmake
|
||||||
|
}
|
||||||
|
condition: and(eq( variables['Agent.OS'], 'Windows_NT'), eq(variables['TARGET'], 'desktop'))
|
||||||
|
displayName: build test with qmake for windows
|
||||||
|
- script: |
|
||||||
|
$(Build.BinariesDirectory)/Qt$(QT_VERSION)/$(QT_VERSION)/$(ARCHDIR)/bin/qmake $(Build.SourcesDirectory)/tests
|
||||||
|
make
|
||||||
|
condition: and(eq( variables['TARGET'], 'desktop' ), or(eq(variables['Agent.OS'], 'Linux'), eq(variables['Agent.OS'], 'Darwin')))
|
||||||
|
displayName: Build test with qmake for Linux and macOS
|
||||||
|
# for ios
|
||||||
|
- script: echo Currently not implemented.
|
||||||
|
condition: and(eq(variables['TARGET'], 'ios'), eq(variables['Agent.OS'], 'Darwin'))
|
||||||
|
displayName: Build test with qmake for ios
|
||||||
132
generate_azure_pipelines_yml.py
Normal file
132
generate_azure_pipelines_yml.py
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
"""
|
||||||
|
This generates a matrix of QT versions to test downloading against
|
||||||
|
"""
|
||||||
|
|
||||||
|
from itertools import product
|
||||||
|
import os
|
||||||
|
from ruamel.yaml import YAML
|
||||||
|
|
||||||
|
|
||||||
|
class BuildJob:
|
||||||
|
def __init__(self, qt_version, host, target, arch, archdir):
|
||||||
|
self.qt_version = qt_version
|
||||||
|
self.host = host
|
||||||
|
self.target = target
|
||||||
|
self.arch = arch
|
||||||
|
self.archdir = archdir
|
||||||
|
|
||||||
|
|
||||||
|
class PlatformBuildJobs:
|
||||||
|
def __init__(self, platform, build_jobs):
|
||||||
|
self.platform = platform
|
||||||
|
self.build_jobs = build_jobs
|
||||||
|
|
||||||
|
|
||||||
|
python_versions = [
|
||||||
|
'3.6',
|
||||||
|
'3.7',
|
||||||
|
]
|
||||||
|
|
||||||
|
qt_versions = [
|
||||||
|
'5.11.3',
|
||||||
|
'5.12.3',
|
||||||
|
'5.13.0'
|
||||||
|
]
|
||||||
|
|
||||||
|
linux_build_jobs = []
|
||||||
|
mac_build_jobs = []
|
||||||
|
windows_build_jobs = []
|
||||||
|
|
||||||
|
all_platform_build_jobs = [
|
||||||
|
PlatformBuildJobs('linux', linux_build_jobs),
|
||||||
|
PlatformBuildJobs('mac', mac_build_jobs),
|
||||||
|
PlatformBuildJobs('windows', windows_build_jobs),
|
||||||
|
]
|
||||||
|
|
||||||
|
# Linux Desktop
|
||||||
|
|
||||||
|
for qt_version in qt_versions:
|
||||||
|
linux_build_jobs.append(
|
||||||
|
BuildJob(qt_version, 'linux', 'desktop', 'gcc_64', 'gcc_64')
|
||||||
|
)
|
||||||
|
|
||||||
|
# Mac Desktop
|
||||||
|
|
||||||
|
for qt_version in qt_versions:
|
||||||
|
mac_build_jobs.append(
|
||||||
|
BuildJob(qt_version, 'mac', 'desktop', 'clang_64', "clang_64")
|
||||||
|
)
|
||||||
|
|
||||||
|
# Mac iOS
|
||||||
|
mac_build_jobs.append(
|
||||||
|
BuildJob('5.13.0', 'mac', 'ios', 'ios', 'ios')
|
||||||
|
)
|
||||||
|
|
||||||
|
# Windows Desktop
|
||||||
|
windows_build_jobs.extend(
|
||||||
|
[
|
||||||
|
BuildJob('5.11.3', 'windows', 'desktop', 'win64_msvc2017_64', 'msvc2017_64'),
|
||||||
|
BuildJob('5.11.3', 'windows', 'desktop', 'win32_msvc2015', 'msvc2015'),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
windows_build_jobs.extend(
|
||||||
|
[
|
||||||
|
BuildJob('5.12.3', 'windows', 'desktop', 'win64_msvc2017_64', 'msvc2017_64'),
|
||||||
|
BuildJob('5.12.3', 'windows', 'desktop', 'win32_msvc2017', 'msvc2017'),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
windows_build_jobs.extend(
|
||||||
|
[
|
||||||
|
BuildJob('5.13.0', 'windows', 'desktop', 'win64_msvc2017_64', 'msvc2017_64'),
|
||||||
|
BuildJob('5.13.0', 'windows', 'desktop', 'win64_msvc2015_64', 'msvc2015_64'),
|
||||||
|
BuildJob('5.13.0', 'windows', 'desktop', 'win64_mingw73', 'mingw73'),
|
||||||
|
BuildJob('5.13.0', 'windows', 'desktop', 'win32_msvc2017', 'msvc2017'),
|
||||||
|
BuildJob('5.13.0', 'windows', 'desktop', 'win32_mingw73', 'mingw73'),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
# All Androids for all platforms
|
||||||
|
|
||||||
|
for android_arch in [ 'android_x86', 'android_armv7', ]:
|
||||||
|
for platform_build_jobs in all_platform_build_jobs:
|
||||||
|
platform_build_jobs.build_jobs.append(
|
||||||
|
BuildJob('5.13.0', platform_build_jobs.platform, 'android', android_arch, android_arch)
|
||||||
|
)
|
||||||
|
|
||||||
|
matrices = {}
|
||||||
|
|
||||||
|
for platform_build_job in all_platform_build_jobs:
|
||||||
|
yaml_dictionary = {
|
||||||
|
'matrix': {}
|
||||||
|
}
|
||||||
|
for build_job, python_version in product(platform_build_job.build_jobs, python_versions):
|
||||||
|
key = 'Python {} QT {} {} {} {}'.format(python_version, build_job.qt_version, build_job.host, build_job.target,
|
||||||
|
build_job.arch)
|
||||||
|
yaml_dictionary['matrix'][key] = \
|
||||||
|
{
|
||||||
|
'PYTHON_VERSION': python_version,
|
||||||
|
'QT_VERSION': build_job.qt_version,
|
||||||
|
'HOST': build_job.host,
|
||||||
|
'TARGET': build_job.target,
|
||||||
|
'ARCH': build_job.arch,
|
||||||
|
'ARCHDIR': build_job.archdir,
|
||||||
|
}
|
||||||
|
matrices[platform_build_job.platform.capitalize()] = yaml_dictionary
|
||||||
|
|
||||||
|
root_dir = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
|
||||||
|
# Load azure-pipelines.tmpl.yml
|
||||||
|
with open(os.path.join(root_dir, 'ci', 'azure-pipelines.tmpl.yml'), 'r') as f:
|
||||||
|
azure_pipelines_yaml = YAML().load(f.read())
|
||||||
|
|
||||||
|
# Attach strategies to their respective jobs
|
||||||
|
for job_yaml in azure_pipelines_yaml['jobs']:
|
||||||
|
if job_yaml['job'] in matrices:
|
||||||
|
job_yaml['strategy'] = matrices[job_yaml['job']]
|
||||||
|
|
||||||
|
with open(os.path.join(root_dir, 'azure-pipelines.yml'), 'w') as f:
|
||||||
|
YAML().dump(azure_pipelines_yaml, f)
|
||||||
|
|
||||||
|
pass
|
||||||
9
requirements.txt
Normal file
9
requirements.txt
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
six
|
||||||
|
requests
|
||||||
|
pytest
|
||||||
|
pytest-pep8
|
||||||
|
pytest-cov
|
||||||
|
flake8
|
||||||
|
ruamel.yaml==0.15.94
|
||||||
|
wheel
|
||||||
|
twine
|
||||||
10
tests/accelbubble/Bluebubble.svg
Normal file
10
tests/accelbubble/Bluebubble.svg
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny">
|
||||||
|
<defs>
|
||||||
|
<radialGradient id="grad1" cx="0.5" cy="0.7" r="0.7" fx="0.5" fy="0.4">
|
||||||
|
<stop offset="0" style="stop-color:rgb(255,255,255)" />
|
||||||
|
<stop offset="1.5" style="stop-color:rgb(0,102,153)" />
|
||||||
|
</radialGradient>
|
||||||
|
</defs>
|
||||||
|
<circle cx="100" cy="80" r="42" fill="url(#grad1)"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 399 B |
60
tests/accelbubble/Bubble.qml
Normal file
60
tests/accelbubble/Bubble.qml
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:BSD$
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** BSD License Usage
|
||||||
|
** Alternatively, you may use this file under the terms of the BSD license
|
||||||
|
** as follows:
|
||||||
|
**
|
||||||
|
** "Redistribution and use in source and binary forms, with or without
|
||||||
|
** modification, are permitted provided that the following conditions are
|
||||||
|
** met:
|
||||||
|
** * Redistributions of source code must retain the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer.
|
||||||
|
** * Redistributions in binary form must reproduce the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer in
|
||||||
|
** the documentation and/or other materials provided with the
|
||||||
|
** distribution.
|
||||||
|
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||||
|
** contributors may be used to endorse or promote products derived
|
||||||
|
** from this software without specific prior written permission.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
import QtQuick 2.9
|
||||||
|
import QtQuick.Controls 2.2
|
||||||
|
|
||||||
|
Image {
|
||||||
|
source: "Bluebubble.svg"
|
||||||
|
smooth: true
|
||||||
|
property real centerX
|
||||||
|
property real centerY
|
||||||
|
property real bubbleCenter
|
||||||
|
}
|
||||||
74
tests/accelbubble/Page1Form.ui.qml
Normal file
74
tests/accelbubble/Page1Form.ui.qml
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:BSD$
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** BSD License Usage
|
||||||
|
** Alternatively, you may use this file under the terms of the BSD license
|
||||||
|
** as follows:
|
||||||
|
**
|
||||||
|
** "Redistribution and use in source and binary forms, with or without
|
||||||
|
** modification, are permitted provided that the following conditions are
|
||||||
|
** met:
|
||||||
|
** * Redistributions of source code must retain the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer.
|
||||||
|
** * Redistributions in binary form must reproduce the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer in
|
||||||
|
** the documentation and/or other materials provided with the
|
||||||
|
** distribution.
|
||||||
|
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||||
|
** contributors may be used to endorse or promote products derived
|
||||||
|
** from this software without specific prior written permission.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
import QtQuick 2.9
|
||||||
|
import QtQuick.Controls 2.2
|
||||||
|
|
||||||
|
Page {
|
||||||
|
width: 600
|
||||||
|
height: 400
|
||||||
|
property alias bubble: bubble
|
||||||
|
property alias mainWindow: mainWindow
|
||||||
|
|
||||||
|
header: Label {
|
||||||
|
text: qsTr("Page 1")
|
||||||
|
font.pixelSize: Qt.application.font.pixelSize * 2
|
||||||
|
padding: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: mainWindow
|
||||||
|
color: "#ffffff"
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
Bubble {
|
||||||
|
id: bubble
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
67
tests/accelbubble/Page2Form.ui.qml
Normal file
67
tests/accelbubble/Page2Form.ui.qml
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:BSD$
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** BSD License Usage
|
||||||
|
** Alternatively, you may use this file under the terms of the BSD license
|
||||||
|
** as follows:
|
||||||
|
**
|
||||||
|
** "Redistribution and use in source and binary forms, with or without
|
||||||
|
** modification, are permitted provided that the following conditions are
|
||||||
|
** met:
|
||||||
|
** * Redistributions of source code must retain the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer.
|
||||||
|
** * Redistributions in binary form must reproduce the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer in
|
||||||
|
** the documentation and/or other materials provided with the
|
||||||
|
** distribution.
|
||||||
|
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||||
|
** contributors may be used to endorse or promote products derived
|
||||||
|
** from this software without specific prior written permission.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
import QtQuick 2.9
|
||||||
|
import QtQuick.Controls 2.2
|
||||||
|
|
||||||
|
Page {
|
||||||
|
width: 600
|
||||||
|
height: 400
|
||||||
|
|
||||||
|
header: Label {
|
||||||
|
text: qsTr("Page 2")
|
||||||
|
font.pixelSize: Qt.application.font.pixelSize * 2
|
||||||
|
padding: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("You are on Page 2.")
|
||||||
|
anchors.centerIn: parent
|
||||||
|
}
|
||||||
|
}
|
||||||
37
tests/accelbubble/accelbubble.pro
Normal file
37
tests/accelbubble/accelbubble.pro
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
QT += quick sensors svg xml
|
||||||
|
|
||||||
|
CONFIG += c++11
|
||||||
|
|
||||||
|
# The following define makes your compiler emit warnings if you use
|
||||||
|
# any feature of Qt which as been marked 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
|
||||||
|
|
||||||
|
RESOURCES += qml.qrc
|
||||||
|
|
||||||
|
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||||
|
QML_IMPORT_PATH =
|
||||||
|
|
||||||
|
# Additional import path used to resolve QML modules just for Qt Quick Designer
|
||||||
|
QML_DESIGNER_IMPORT_PATH =
|
||||||
|
|
||||||
|
# Default rules for deployment.
|
||||||
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
|
!isEmpty(target.path): INSTALLS += target
|
||||||
|
|
||||||
|
ios {
|
||||||
|
QTPLUGIN += qsvg qsvgicon qtsensors_ios
|
||||||
|
QMAKE_INFO_PLIST = Info.plist
|
||||||
|
}
|
||||||
|
|
||||||
|
DISTFILES += \
|
||||||
|
Bluebubble.svg
|
||||||
66
tests/accelbubble/main.cpp
Normal file
66
tests/accelbubble/main.cpp
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:BSD$
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** BSD License Usage
|
||||||
|
** Alternatively, you may use this file under the terms of the BSD license
|
||||||
|
** as follows:
|
||||||
|
**
|
||||||
|
** "Redistribution and use in source and binary forms, with or without
|
||||||
|
** modification, are permitted provided that the following conditions are
|
||||||
|
** met:
|
||||||
|
** * Redistributions of source code must retain the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer.
|
||||||
|
** * Redistributions in binary form must reproduce the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer in
|
||||||
|
** the documentation and/or other materials provided with the
|
||||||
|
** distribution.
|
||||||
|
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||||
|
** contributors may be used to endorse or promote products derived
|
||||||
|
** from this software without specific prior written permission.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <QGuiApplication>
|
||||||
|
#include <QQmlApplicationEngine>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
|
|
||||||
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
|
QQmlApplicationEngine engine;
|
||||||
|
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||||
|
if (engine.rootObjects().isEmpty())
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return app.exec();
|
||||||
|
}
|
||||||
141
tests/accelbubble/main.qml
Normal file
141
tests/accelbubble/main.qml
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:BSD$
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** BSD License Usage
|
||||||
|
** Alternatively, you may use this file under the terms of the BSD license
|
||||||
|
** as follows:
|
||||||
|
**
|
||||||
|
** "Redistribution and use in source and binary forms, with or without
|
||||||
|
** modification, are permitted provided that the following conditions are
|
||||||
|
** met:
|
||||||
|
** * Redistributions of source code must retain the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer.
|
||||||
|
** * Redistributions in binary form must reproduce the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer in
|
||||||
|
** the documentation and/or other materials provided with the
|
||||||
|
** distribution.
|
||||||
|
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||||
|
** contributors may be used to endorse or promote products derived
|
||||||
|
** from this software without specific prior written permission.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
import QtQuick 2.9
|
||||||
|
import QtQuick.Controls 2.2
|
||||||
|
import QtSensors 5.9
|
||||||
|
|
||||||
|
ApplicationWindow {
|
||||||
|
visible: true
|
||||||
|
width: 640
|
||||||
|
height: 480
|
||||||
|
title: qsTr("Accelerate Bubble")
|
||||||
|
|
||||||
|
SwipeView {
|
||||||
|
id: swipeView
|
||||||
|
anchors.fill: parent
|
||||||
|
currentIndex: tabBar.currentIndex
|
||||||
|
|
||||||
|
Page1Form {
|
||||||
|
bubble {
|
||||||
|
id: bubble
|
||||||
|
centerX: mainWindow.width / 2
|
||||||
|
centerY: mainWindow.height / 2
|
||||||
|
bubbleCenter: bubble.width / 2
|
||||||
|
x: bubble.centerX - bubble.bubbleCenter
|
||||||
|
y: bubble.centerY - bubble.bubbleCenter
|
||||||
|
|
||||||
|
Behavior on y {
|
||||||
|
SmoothedAnimation {
|
||||||
|
easing.type: Easing.Linear
|
||||||
|
duration: 100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on x {
|
||||||
|
SmoothedAnimation {
|
||||||
|
easing.type: Easing.Linear
|
||||||
|
duration: 100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Page2Form {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
footer: TabBar {
|
||||||
|
id: tabBar
|
||||||
|
currentIndex: swipeView.currentIndex
|
||||||
|
|
||||||
|
TabButton {
|
||||||
|
text: qsTr("Page 1")
|
||||||
|
}
|
||||||
|
TabButton {
|
||||||
|
text: qsTr("Page 2")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Accelerometer {
|
||||||
|
id: accel
|
||||||
|
dataRate: 100
|
||||||
|
active: true
|
||||||
|
|
||||||
|
onReadingChanged: {
|
||||||
|
var newX = (bubble.x + calcRoll(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
|
||||||
|
var newY = (bubble.y - calcPitch(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
|
||||||
|
|
||||||
|
if (isNaN(newX) || isNaN(newY))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (newX < 0)
|
||||||
|
newX = 0
|
||||||
|
|
||||||
|
if (newX > mainWindow.width - bubble.width)
|
||||||
|
newX = mainWindow.width - bubble.width
|
||||||
|
|
||||||
|
if (newY < 18)
|
||||||
|
newY = 18
|
||||||
|
|
||||||
|
if (newY > mainWindow.height - bubble.height)
|
||||||
|
newY = mainWindow.height - bubble.height
|
||||||
|
|
||||||
|
bubble.x = newX
|
||||||
|
bubble.y = newY
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function calcPitch(x, y, z) {
|
||||||
|
return -(Math.atan(y / Math.sqrt(x * x + z * z)) * 57.2957795);
|
||||||
|
}
|
||||||
|
function calcRoll(x, y, z) {
|
||||||
|
return -(Math.atan(x / Math.sqrt(y * y + z * z)) * 57.2957795);
|
||||||
|
}
|
||||||
|
}
|
||||||
10
tests/accelbubble/qml.qrc
Normal file
10
tests/accelbubble/qml.qrc
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/">
|
||||||
|
<file>Page1Form.ui.qml</file>
|
||||||
|
<file>Page2Form.ui.qml</file>
|
||||||
|
<file>qtquickcontrols2.conf</file>
|
||||||
|
<file>Bubble.qml</file>
|
||||||
|
<file>Bluebubble.svg</file>
|
||||||
|
<file>main.qml</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
||||||
6
tests/accelbubble/qtquickcontrols2.conf
Normal file
6
tests/accelbubble/qtquickcontrols2.conf
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
; This file can be edited to change the style of the application
|
||||||
|
; Read "Qt Quick Controls 2 Configuration File" for details:
|
||||||
|
; http://doc.qt.io/qt-5/qtquickcontrols2-configuration.html
|
||||||
|
|
||||||
|
[Controls]
|
||||||
|
Style=Default
|
||||||
Reference in New Issue
Block a user