Skip to content
Merged
4 changes: 2 additions & 2 deletions .github/workflows/build_internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- os: windows-latest
qthost: windows
qtarch: win64_msvc2019_64
version: 6.4.3
version: 6.6.2
pythonversion: 3.8.10
arch: x64
binding: PyQt6
Expand All @@ -51,7 +51,7 @@ jobs:
- os: ubuntu-latest
qthost: linux
qtarch: gcc_64
version: 6.4.3
version: 6.6.2
pythonversion: 3.8.12
arch: x64
binding: PyQt6
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

PyQt5: `pip install PyQt5-ElaWidgetTools`,PyQt5>=5.15.5

PyQt6: `pip install PyQt6-ElaWidgetTools`,PyQt6>=6.4.2
PyQt6: `pip install PyQt6-ElaWidgetTools`,PyQt6>=6.6.2

PySide6: `pip install PySide6-ElaWidgetTools`,PySide6==6.6.2

Expand Down
36 changes: 32 additions & 4 deletions scripts/dobuild.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sys, os, subprocess, shutil, site
import sys, os, subprocess, shutil, site, io

print(sys.platform)
print(sys.executable)
Expand Down Expand Up @@ -41,7 +41,7 @@
if binding.lower().startswith("pyqt"):
if qtversion.startswith("6"):
subprocess.run(
f"{pyPath} -m pip install pyqt6==6.4.2 PyQt-builder sip", shell=True
f"{pyPath} -m pip install pyqt6==6.6.1 PyQt-builder sip", shell=True
)
else:
subprocess.run(
Expand All @@ -54,13 +54,18 @@
shell=True,
)

sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")


# 编译ela
def __parsefile(fn, cb):
def __parsefile(fn, cb, pr=False):
with open(fn, "r", encoding="utf8") as ff:
cml = ff.read()
with open(fn, "w", encoding="utf8") as ff:
ff.write(cb(cml))
_ = cb(cml)
if pr:
print(_)
ff.write(_)


__parsefile(
Expand All @@ -77,6 +82,29 @@ def __parsefile(fn, cb):
if sys.platform == "win32":
archA = ("win32", "x64")[arch == "x64"]
flags = f'-G "Visual Studio 18 2026" -A {archA} -T host={arch}'

if binding.lower() == "pyqt6":
fix = r"""
if(MSVC AND MSVC_VERSION GREATER_EQUAL 1940) # VS2026 的 _MSC_VER 约为 1940+
message(STATUS "Detected VS2026 or newer, adding compatibility definitions")
add_compile_definitions(
_SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS
_HAS_CXX17=1
_HAS_CXX20=1
_CRT_SECURE_NO_WARNINGS
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /Zc:__cplusplus")
endif()

"""
__parsefile(
"../ElaWidgetTools/CMakeLists.txt",
lambda c: c.replace(
"add_definitions(-DELAWIDGETTOOLS_LIBRARY)",
"add_definitions(-DELAWIDGETTOOLS_LIBRARY)\n" + fix,
),
pr=True,
)
else:
flags = ""
subprocess.run(
Expand Down
18 changes: 1 addition & 17 deletions scripts/pyside6/gen_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,22 +289,6 @@ def maybeparse(xx: str):
ff.write(wrapperbase.format(internal=H_internal + "\n" + h))


sysinclude = ""
if "msvc2019" in MY_QT_INSTALL:
# <=6.7必须使用msvc2019的头文件
vspath = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC"
if not os.path.exists(vspath):
vspath = (
"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC"
)
print(os.listdir(vspath))
for _ in os.listdir(vspath):
if _.startswith("14.29"):
msvc2019 = _
sysinclude = vspath + "/" + msvc2019 + "/include"
print(sysinclude)
sysinclude = f'--system-include-paths="{sysinclude}"'

if sys.platform=='linux':
inc='/usr/lib/gcc/x86_64-linux-gnu/14/include'
if not os.path.exists(inc):
Expand All @@ -315,7 +299,7 @@ def maybeparse(xx: str):
sysinclude = f' -I{inc} -I{pyDir} '

os.system(
f"""shiboken6 {sysinclude}
f"""shiboken6
--generator-set=shiboken
--output-directory=OUTPUTDIR
-I{ELA_INCLUDE_PATH}
Expand Down
2 changes: 1 addition & 1 deletion scripts/wheel/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def has_ext_modules(self):
if bindingfor == "PyQt5":
req = "PyQt5>=5.15.5"
elif bindingfor == "PyQt6":
req = "PyQt6>=6.4.2"
req = "PyQt6>=6.6.2"
elif bindingfor == "PySide6":
pass

Expand Down
Loading