From d8f51a5ef0032e0ee1fb9af51719273955078071 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 16 May 2022 00:07:31 +0200 Subject: [PATCH] Qt4 compatibility --- azure-pipelines.yml | 19 ++----------------- src/laybasic/laybasic/layPixelBuffer.cc | 8 ++++++++ src/layui/layui/layCellSelectionForm.h | 4 ++-- src/lym/lym/lym.pro | 1 - src/pymod/tl/tlMain.cc | 1 - 5 files changed, 12 insertions(+), 21 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2cfe0c5ad..57b5f1c41 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,11 +14,6 @@ jobs: vmImage: 'windows-2019' # other options: 'macOS-10.13', 'ubuntu-16.04' strategy: matrix: - # Python27: - # python.version: '2.7' - # cp35-cp35m-win_amd64.whl: - # python.version: '3.5' - # python.architecture: 'x64' cp36-cp36m-win_amd64.whl: python.version: '3.6' python.architecture: 'x64' @@ -34,9 +29,6 @@ jobs: cp310-cp310-win_amd64.whl: python.version: '3.10' python.architecture: 'x64' - # cp35-cp35m-win32.whl: - # python.version: '3.5' - # python.architecture: 'x86' cp36-cp36m-win32.whl: python.version: '3.6' python.architecture: 'x86' @@ -81,15 +73,6 @@ jobs: #workingDirectory: # Optional displayName: 'Download and Extract KLayout bits' - # - script: | - # curl https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi -o VCForPython27.msi - # msiexec /i VCForPython27.msi /quiet - # set "VS90COMNTOOLS=C:\Users\VssAdministrator\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC" - # curl https://raw.githubusercontent.com/mattn/gntp-send/master/include/msinttypes/stdint.h -o "%VS90COMNTOOLS%\Include\stdint.h" - # dir "%VS90COMNTOOLS%\Include" - # condition: eq(variables['python.version'], '2.7') - # displayName: 'Install Microsoft Visual C++ Compiler for Python 2.7' - - script: | python -m pip install --upgrade pip setuptools wheel displayName: 'Update pip, setuptools and wheel' @@ -107,11 +90,13 @@ jobs: - script: | echo PATH=%PATH% + set TESTSRC=. pip install klayout --no-index -f dist python testdata/pymod/import_db.py python testdata/pymod/import_rdb.py python testdata/pymod/import_tl.py python testdata/pymod/import_lib.py + python testdata/pymod/import_lay.py python testdata/pymod/pya_tests.py displayName: 'Test KLayout pymod' diff --git a/src/laybasic/laybasic/layPixelBuffer.cc b/src/laybasic/laybasic/layPixelBuffer.cc index 90d7eafdd..f5584d0e2 100644 --- a/src/laybasic/laybasic/layPixelBuffer.cc +++ b/src/laybasic/laybasic/layPixelBuffer.cc @@ -290,7 +290,11 @@ QImage PixelBuffer::to_image_copy () const { QImage img (m_width, m_height, m_transparent ? QImage::Format_ARGB32 : QImage::Format_RGB32); +#if QT_VERSION < 0x050000 + memcpy (img.bits (), data (), img.byteCount ()); +#else memcpy (img.bits (), data (), img.sizeInBytes ()); +#endif return img; } @@ -703,7 +707,11 @@ QImage BitmapBuffer::to_image_copy () const { QImage img (m_width, m_height, QImage::Format_MonoLSB); +#if QT_VERSION < 0x050000 + memcpy (img.bits (), data (), img.byteCount ()); +#else memcpy (img.bits (), data (), img.sizeInBytes ()); +#endif return img; } diff --git a/src/layui/layui/layCellSelectionForm.h b/src/layui/layui/layCellSelectionForm.h index b65769c0b..15c00dc2d 100644 --- a/src/layui/layui/layCellSelectionForm.h +++ b/src/layui/layui/layCellSelectionForm.h @@ -25,8 +25,6 @@ #ifndef HDR_layCellSelectionForm #define HDR_layCellSelectionForm -#include - #include "layuiCommon.h" #include "layCellView.h" #include "tlDeferredExecution.h" @@ -34,7 +32,9 @@ #include #include +#include #include +#include namespace Ui { diff --git a/src/lym/lym/lym.pro b/src/lym/lym/lym.pro index 0284fb201..c05c34e79 100644 --- a/src/lym/lym/lym.pro +++ b/src/lym/lym/lym.pro @@ -16,7 +16,6 @@ SOURCES = \ HEADERS = \ lymCommon.h \ lymForceLink.h \ - lymInclude.h \ lymMacroInterpreter.h \ lymMacroCollection.h \ lymMacro.h \ diff --git a/src/pymod/tl/tlMain.cc b/src/pymod/tl/tlMain.cc index d1f69e21d..b9617364e 100644 --- a/src/pymod/tl/tlMain.cc +++ b/src/pymod/tl/tlMain.cc @@ -23,4 +23,3 @@ #include "../pymodHelper.h" DEFINE_PYMOD(tlcore, "tl", "KLayout core module 'tl'") -