Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cura 8640 PyQt6 upgrade #11792

Merged
merged 145 commits into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from 143 commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
abe7c1b
Search/replace Qt5->Qt6.
rburema Dec 28, 2021
32b52c6
Qt5->Qt6: Rectify constant locations: UserRole, CppOwnership
rburema Dec 28, 2021
7021ff0
Qt5->Qt6: Replace QT_ENUMS with pyqtEnum.
rburema Dec 28, 2021
b62e708
Qt5->Qt6: (Until) attempted fix Python 3.10 'stack overflow' issue.
rburema Dec 28, 2021
6dc6020
Qt5->Qt6: GUI-attributes and flips params register singletons.
rburema Dec 28, 2021
895488a
Qt5->Qt6: Usee key-constants namespace.
rburema Dec 29, 2021
6586bcc
Qt5->Qt6: Fix cause of stack-overflow errors for newer Python/Qt.
rburema Dec 29, 2021
9d7b1e4
Qt5->Qt6: Make CrashHandler window show up again.
rburema Dec 29, 2021
97da0b9
Qt5->Qt6: Fix another stack-overflow error for newer Python/Qt.
rburema Dec 29, 2021
20b435a
Qt5->Qt6: More renamed stuff.
rburema Dec 29, 2021
448fbf7
Qt5->Qt6: Register QML enums as (uncreatable) meta object not type.
rburema Dec 29, 2021
c8ed363
Qt5->Qt6: Even more renaming stuff.
rburema Dec 29, 2021
ec5bb44
Don't change metadata if there is no global stack
Ghostkeeper Jan 5, 2022
3c12a26
Only attempt to remove hidden container stacks if the directory exists
Ghostkeeper Jan 5, 2022
28924a1
Merge branch 'CURA-8591_upgrade_to_qt62' of github.com:Ultimaker/Cura…
nallath Jan 6, 2022
c7d7dd1
Merge branch 'master' into PyQt6_upgrade
Ghostkeeper Feb 21, 2022
99449db
Get rid of some errors first.
rburema Feb 25, 2022
08c49c6
Changes needed wrt how we build Arcus with Sip 6.
rburema Feb 25, 2022
7511ac8
Changes needed wrt how we build Savitar with Sip 6.
rburema Feb 25, 2022
4758839
Use Arcus as namespace
Feb 28, 2022
ca430c8
Change imported namespace pySavitar to Savitar
Feb 28, 2022
4099655
Merge pull request #11571 from Ultimaker/CURA-7924_sip_cmake_build
nallath Feb 28, 2022
54ccc12
Drop support for CTM files
Mar 23, 2022
34d6a2b
Credits given where credits due
Mar 23, 2022
3f8907d
Merge branch 'master' into CURA-8640_PyQt6
jellespijker Mar 24, 2022
55cb86e
use namespace AlignmentFlag
Mar 24, 2022
bde680f
Use modern >=3.12 cmake find_package Python logic
Mar 24, 2022
4c837cd
Allow installing to a local sitelib
Mar 24, 2022
c3c59ef
fixed install dir
Mar 24, 2022
12ee57e
Merge branch 'master' into CURA-8640_PyQt6
jellespijker Mar 28, 2022
ff21c93
Qt6 dropped QtGraphicalEffects
Mar 28, 2022
f436c97
Roughly strip out the GraphicalEffects
nallath Mar 28, 2022
99a3a8d
QTQuick.Dialogs jumped to using 6.0 in QT6
Joeydelarago Mar 29, 2022
3c9e2a1
Update RegExpValidator to RegularExpressionValidator
casperlamboo Mar 30, 2022
337e2aa
Update set deamon logic
casperlamboo Mar 30, 2022
1acf96d
Update file dialog properties
casperlamboo Mar 30, 2022
4f70d34
wip qt changes
casperlamboo Mar 30, 2022
d240feb
Removing shit until works.
nallath Mar 30, 2022
5aceec6
Use right enum
nallath Mar 30, 2022
9f735a1
Bump up qtQuick version
nallath Mar 30, 2022
f176924
Renable MainWindow header by disabling account widget
nallath Mar 31, 2022
96444db
Use correct keyboard enums
nallath Mar 31, 2022
b4b7e6a
Fix warnings that "instanceContainer" is not a recognised type
nallath Mar 31, 2022
1df9ca5
Use correct default button for package install dialog
nallath Mar 31, 2022
af71278
No longer inject parameters into function handling in qml
nallath Mar 31, 2022
124602d
Return account widget to it's former glory
nallath Mar 31, 2022
2c09c83
Fix crash when opening marketplace
nallath Mar 31, 2022
814b706
Re-add header background
nallath Mar 31, 2022
cfad991
Popup will now resize based on the implicitWidth/implicitHeight of it…
Joeydelarago Apr 1, 2022
804a607
Merge remote-tracking branch 'origin/qt6_beyond_the_splash' into qt6_…
Joeydelarago Apr 1, 2022
19d82a7
Fix loading of files
nallath Apr 1, 2022
1279ba9
Merge branch 'qt6_beyond_the_splash' of github.com:Ultimaker/Cura int…
nallath Apr 1, 2022
3dc67f3
Height based on implicitHeight/implicitWidth now.
Joeydelarago Apr 1, 2022
748606e
Merge remote-tracking branch 'origin/qt6_beyond_the_splash' into qt6_…
Joeydelarago Apr 1, 2022
e40a219
Add back code for resizing contentContainer.
Joeydelarago Apr 1, 2022
0ab8f27
Add hack to get mouse handling working again
nallath Apr 1, 2022
eb4e27d
Merge branch 'qt6_beyond_the_splash' of github.com:Ultimaker/Cura int…
nallath Apr 1, 2022
a92a9dd
Fix context menu settings
nallath Apr 1, 2022
e0ec64e
Fix deleting item with backspace
nallath Apr 1, 2022
4520fc1
Fix display of UM monitor page
nallath Apr 1, 2022
3a1862f
Fix deprecation warning on recentfilesmenu
nallath Apr 1, 2022
c6d62c9
Update font weights
casperlamboo Apr 1, 2022
90f03be
Merge remote-tracking branch 'origin/qt6_beyond_the_splash' into qt6_…
casperlamboo Apr 1, 2022
2c09943
Remove opacity from menuItem
nallath Apr 1, 2022
f327c24
Update Dialog imports to remove version
Joeydelarago Apr 1, 2022
02e4f86
Merge remote-tracking branch 'origin/qt6_beyond_the_splash' into qt6_…
Joeydelarago Apr 1, 2022
baa1d9b
Use weights from figma
casperlamboo Apr 1, 2022
0c90d2e
Merge remote-tracking branch 'origin/qt6_beyond_the_splash' into qt6_…
casperlamboo Apr 1, 2022
402c53c
Fix warning about Duration
nallath Apr 1, 2022
d34d6f7
Merge branch 'qt6_beyond_the_splash' of github.com:Ultimaker/Cura int…
nallath Apr 1, 2022
5f71518
Use correct enum values for materialsview
nallath Apr 1, 2022
c9b9a41
Fix injection of parameters in signals
nallath Apr 1, 2022
bac9a0d
Fix textField vertical alignment
Joeydelarago Apr 1, 2022
0f84fc3
Merge remote-tracking branch 'origin/qt6_beyond_the_splash' into qt6_…
Joeydelarago Apr 1, 2022
e20ded2
Fix spinbox height being almost 0 and padding being missing between b…
Joeydelarago Apr 4, 2022
e593322
When getting active focus textinput value was being cleared. However …
Joeydelarago Apr 4, 2022
2f96f7b
RegularExpressionValidator requires newer version of QtQuick
Joeydelarago Apr 4, 2022
e2e0a5c
Inheriting components don't have full access to the context of their …
Joeydelarago Apr 4, 2022
359bcc1
Textfield was in incorrect style
Joeydelarago Apr 4, 2022
4ec2ede
Add replacement for QT.labs.models.TableModel
Joeydelarago Apr 5, 2022
b60156e
Remove unused import
Joeydelarago Apr 5, 2022
184f4b8
Bump QtQuick version to fix RegularExpressionValidator import
Joeydelarago Apr 5, 2022
e86f860
Update TableView and TableModel in DigitalLibrary plugin.
Joeydelarago Apr 5, 2022
fd07de9
Update DiscardOrKeepProfileChangesDialog.qml TableModel
Joeydelarago Apr 5, 2022
6d2293d
Remove unused Table in DigitalLibary Plugin
Joeydelarago Apr 5, 2022
aa19002
Update enum, this fixes connecting to printers
Joeydelarago Apr 5, 2022
9812dad
Fix drag & drop
nallath Apr 5, 2022
fa2ebf3
Merge branch 'qt6_beyond_the_splash' of github.com:Ultimaker/Cura int…
nallath Apr 5, 2022
2ffcfaf
Some place RegularExpressionValidator can't be found in QtQuick 2.10 …
Joeydelarago Apr 5, 2022
f57c30f
Merge remote-tracking branch 'origin/qt6_beyond_the_splash' into qt6_…
Joeydelarago Apr 5, 2022
53efb78
Fix combobox and label heights in general page
Joeydelarago Apr 5, 2022
62c1e37
Fix button heights
Joeydelarago Apr 5, 2022
3c6412d
FIx deprecation warning
nallath Apr 6, 2022
6052802
Use right enum for alignment
nallath Apr 6, 2022
c88ed07
Fix resolving of URL's
nallath Apr 6, 2022
00c7c37
LinearGradient is not available for 2d shapes in QT6
Joeydelarago Apr 6, 2022
b2eec5f
Fix height for swatch in extruder settings
nallath Apr 6, 2022
1158856
Merge branch 'qt6_beyond_the_splash' of github.com:Ultimaker/Cura int…
nallath Apr 6, 2022
ef6f76f
Fix parameter injection deprecation warning
nallath Apr 6, 2022
b2b1961
Merge branch 'master' into qt6_beyond_the_splash
Joeydelarago Apr 6, 2022
6bb4f52
Fix crash on slicing.
Joeydelarago Apr 6, 2022
455c163
Merge branch 'master' into qt6_beyond_the_splash
jellespijker Apr 7, 2022
262520f
Remove setting parent from basematerial
nallath Apr 7, 2022
9e4798c
Set ownership of MaterialBrandsModel to cpp
nallath Apr 7, 2022
efc5438
Remove unneeded clear
nallath Apr 8, 2022
4abdd67
Merge branch 'master' into qt6_beyond_the_splash
jellespijker Apr 8, 2022
11b557b
Replace material sub-menus with custom Popup
Ghostkeeper Apr 8, 2022
3de824e
Show submenu with material types
Ghostkeeper Apr 8, 2022
45bc498
Replace `RecolorImage` with `ColorImage`
casperlamboo Apr 8, 2022
b40900e
Fix layout of subitems
Ghostkeeper Apr 8, 2022
7aafd95
Implement sub-submenus for material selection
Ghostkeeper Apr 8, 2022
d94ef39
Fix warnings for extruder icon
nallath Apr 8, 2022
938ff69
Add arrows in submenus
Joeydelarago Apr 8, 2022
5df5d6c
Fix popup alignment
Joeydelarago Apr 8, 2022
5a76cd1
Select material from menu when user clicks on it
Ghostkeeper Apr 8, 2022
e7de7bb
Add a checkmark to indicate the selected material
Ghostkeeper Apr 8, 2022
d46679c
Fix popups closing on selecting a material bug
Joeydelarago Apr 8, 2022
af33073
Properly limit width of text in subsubmenu
Ghostkeeper Apr 8, 2022
90a3b4c
Use 250ms delay everywhere
Ghostkeeper Apr 8, 2022
fb22a04
Add search path for the pyinstaller locations
jellespijker Apr 8, 2022
c4baece
Remove reference to nonexistent property source size in UM.ColorImage…
Joeydelarago Apr 11, 2022
0deac84
NetworkError is an enum, no longer comparable as int
Ghostkeeper Apr 11, 2022
17e7c26
Remove fill from extruderColor icon
nallath Apr 11, 2022
2797190
Also remove fill from default extruderCOlor icon
nallath Apr 11, 2022
e076779
Remove fill from Check.svg which was overriding attempts to recolor i…
Joeydelarago Apr 11, 2022
5bec905
Remove fill from multiple SVG's
nallath Apr 11, 2022
70fdffb
Allow redirects when talking with printer API
Ghostkeeper Apr 11, 2022
d1d45b4
Fix enum to FormDataType
Ghostkeeper Apr 11, 2022
94e5a4e
Masking is not avaliable after the QT6 upgrade, this does a kind of p…
Joeydelarago Apr 11, 2022
3674af0
selectExisting is replaced with using fileMode:FileDialog.OpenFile in…
Joeydelarago Apr 12, 2022
6f83927
Merge branch 'qt6_beyond_the_splash' of github.com:Ultimaker/Cura int…
Ghostkeeper Apr 12, 2022
cb9b596
Removed last remnants of RecolorImage
Apr 13, 2022
dd037fa
Make "create new" button visible
nallath Apr 13, 2022
a6db27d
Prevent tootltip from showing during "processing" of slice button
nallath Apr 13, 2022
111d335
Give text more room on splashscreen
nallath Apr 13, 2022
c9e6257
Use right enum for message dialog
nallath Apr 13, 2022
204eeaf
Add extra warnings if it failed to create snapshot
nallath Apr 13, 2022
5095455
Fix thumbnail creation
nallath Apr 13, 2022
ddb3ed1
Fix crash in image reader and ensure it actually works
nallath Apr 13, 2022
25839c6
Fix direction of pointing rectangle
nallath Apr 13, 2022
b3cd1fe
Merge remote-tracking branch 'origin/qt6_beyond_the_splash' into qt6_…
jellespijker Apr 14, 2022
aef4830
Fix version on splash screen
Apr 14, 2022
52a6da2
Use minus sign for extra version info
Apr 14, 2022
02a2d9c
Update plugins/ModelChecker/ModelChecker.qml
jellespijker Apr 14, 2022
981df9f
Update resources/qml/TableView.qml
jellespijker Apr 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 27 additions & 43 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.

project(cura)
cmake_minimum_required(VERSION 3.6)
cmake_minimum_required(VERSION 3.18)

include(GNUInstallDirs)

Expand All @@ -8,9 +11,6 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
set(URANIUM_DIR "${CMAKE_SOURCE_DIR}/../Uranium" CACHE PATH "The location of the Uranium repository")
set(URANIUM_SCRIPTS_DIR "${URANIUM_DIR}/scripts" CACHE PATH "The location of the scripts directory of the Uranium repository")

# Tests
include(CuraTests)

option(CURA_DEBUGMODE "Enable debug dialog and other debug features" OFF)
if(CURA_DEBUGMODE)
set(_cura_debugmode "ON")
Expand All @@ -32,17 +32,25 @@ configure_file(${CMAKE_SOURCE_DIR}/com.ultimaker.cura.desktop.in ${CMAKE_BINARY_

configure_file(cura/CuraVersion.py.in CuraVersion.py @ONLY)

if(NOT DEFINED Python_VERSION)
set(Python_VERSION
3.10
CACHE STRING "Python Version" FORCE)
message(STATUS "Setting Python version to ${Python_VERSION}. Set Python_VERSION if you want to compile against an other version.")
endif()
if(APPLE)
set(Python_FIND_FRAMEWORK NEVER)
endif()
find_package(Python ${Python_VERSION} EXACT REQUIRED COMPONENTS Interpreter)
message(STATUS "Linking and building ${project_name} against Python ${Python_VERSION}")
if(NOT DEFINED Python_SITELIB_LOCAL)
set(Python_SITELIB_LOCAL
"${Python_SITELIB}"
CACHE PATH "Local alternative site-package location to install Cura" FORCE)
endif()

# FIXME: The new FindPython3 finds the system's Python3.6 rather than the Python3.5 that we built for Cura's environment.
# So we're using the old method here, with FindPythonInterp for now.
find_package(PythonInterp 3 REQUIRED)

set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})

set(Python3_VERSION ${PYTHON_VERSION_STRING})
set(Python3_VERSION_MAJOR ${PYTHON_VERSION_MAJOR})
set(Python3_VERSION_MINOR ${PYTHON_VERSION_MINOR})
set(Python3_VERSION_PATCH ${PYTHON_VERSION_PATCH})
# Tests
include(CuraTests)

if(NOT ${URANIUM_DIR} STREQUAL "")
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${URANIUM_DIR}/cmake")
Expand All @@ -58,30 +66,15 @@ if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "")
endif()
endif()


install(DIRECTORY resources
DESTINATION ${CMAKE_INSTALL_DATADIR}/cura)
install(DIRECTORY resources DESTINATION ${CMAKE_INSTALL_DATADIR}/cura)

include(CuraPluginInstall)

install(FILES cura_app.py DESTINATION ${CMAKE_INSTALL_BINDIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(DIRECTORY cura DESTINATION "${Python_SITELIB_LOCAL}")
install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py DESTINATION "${Python_SITELIB_LOCAL}/cura/")
if(NOT APPLE AND NOT WIN32)
install(FILES cura_app.py
DESTINATION ${CMAKE_INSTALL_BINDIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
RENAME cura)
if(EXISTS /etc/debian_version)
install(DIRECTORY cura
DESTINATION lib${LIB_SUFFIX}/python${Python3_VERSION_MAJOR}/dist-packages
FILES_MATCHING PATTERN *.py)
install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py
DESTINATION lib${LIB_SUFFIX}/python${Python3_VERSION_MAJOR}/dist-packages/cura)
else()
install(DIRECTORY cura
DESTINATION lib${LIB_SUFFIX}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages
FILES_MATCHING PATTERN *.py)
install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py
DESTINATION lib${LIB_SUFFIX}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/cura)
endif()
install(FILES ${CMAKE_BINARY_DIR}/com.ultimaker.cura.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
install(FILES ${CMAKE_SOURCE_DIR}/resources/images/cura-icon.png
Expand All @@ -91,13 +84,4 @@ if(NOT APPLE AND NOT WIN32)
install(FILES cura.sharedmimeinfo
DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages/
RENAME cura.xml )
else()
install(FILES cura_app.py
DESTINATION ${CMAKE_INSTALL_BINDIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(DIRECTORY cura
DESTINATION lib${LIB_SUFFIX}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages
FILES_MATCHING PATTERN *.py)
install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py
DESTINATION lib${LIB_SUFFIX}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/cura)
endif()
17 changes: 2 additions & 15 deletions cmake/CuraPluginInstall.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019 Ultimaker B.V.
# Copyright (c) 2022 Ultimaker B.V.
# CuraPluginInstall.cmake is released under the terms of the LGPLv3 or higher.

#
Expand All @@ -11,19 +11,6 @@

option(PRINT_PLUGIN_LIST "Should the list of plugins that are installed be printed?" ON)

# FIXME: Remove the code for CMake <3.12 once we have switched over completely.
# FindPython3 is a new module since CMake 3.12. It deprecates FindPythonInterp and FindPythonLibs. The FindPython3
# module is copied from the CMake repository here so in CMake <3.12 we can still use it.
if(${CMAKE_VERSION} VERSION_LESS 3.12)
# Use FindPythonInterp and FindPythonLibs for CMake <3.12
find_package(PythonInterp 3 REQUIRED)

set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
else()
# Use FindPython3 for CMake >=3.12
find_package(Python3 REQUIRED COMPONENTS Interpreter)
endif()

# Options or configuration variables
set(CURA_NO_INSTALL_PLUGINS "" CACHE STRING "A list of plugins that should not be installed, separated with ';' or ','.")

Expand Down Expand Up @@ -97,7 +84,7 @@ foreach(_plugin_json_path ${_plugin_json_list})
if(${PRINT_PLUGIN_LIST})
message(STATUS "[-] PLUGIN TO REMOVE : ${_rel_plugin_dir}")
endif()
execute_process(COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/mod_bundled_packages_json.py
execute_process(COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/mod_bundled_packages_json.py
-d ${CMAKE_CURRENT_SOURCE_DIR}/resources/bundled_packages
${_plugin_dir_name}
RESULT_VARIABLE _mod_json_result)
Expand Down
16 changes: 5 additions & 11 deletions cmake/CuraTests.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
# Copyright (c) 2018 Ultimaker B.V.
# Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.

include(CTest)
include(CMakeParseArguments)

# FIXME: The new FindPython3 finds the system's Python3.6 rather than the Python3.5 that we built for Cura's environment.
# So we're using the old method here, with FindPythonInterp for now.
find_package(PythonInterp 3 REQUIRED)

set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})

add_custom_target(test-verbose COMMAND ${CMAKE_CTEST_COMMAND} --verbose)

function(cura_add_test)
Expand Down Expand Up @@ -40,7 +34,7 @@ function(cura_add_test)
if (NOT ${test_exists})
add_test(
NAME ${_NAME}
COMMAND ${Python3_EXECUTABLE} -m pytest --junitxml=${CMAKE_BINARY_DIR}/junit-${_NAME}.xml ${_DIRECTORY}
COMMAND ${Python_EXECUTABLE} -m pytest --junitxml=${CMAKE_BINARY_DIR}/junit-${_NAME}.xml ${_DIRECTORY}
)
set_tests_properties(${_NAME} PROPERTIES ENVIRONMENT LANG=C)
set_tests_properties(${_NAME} PROPERTIES ENVIRONMENT "PYTHONPATH=${_PYTHONPATH}")
Expand All @@ -53,14 +47,14 @@ endfunction()
#Add code style test.
add_test(
NAME "code-style"
COMMAND ${Python3_EXECUTABLE} run_mypy.py
COMMAND ${Python_EXECUTABLE} run_mypy.py
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)

#Add test for import statements which are not compatible with all builds
add_test(
NAME "invalid-imports"
COMMAND ${Python3_EXECUTABLE} scripts/check_invalid_imports.py
COMMAND ${Python_EXECUTABLE} scripts/check_invalid_imports.py
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)

Expand All @@ -78,6 +72,6 @@ endforeach()
#Add test for whether the shortcut alt-keys are unique in every translation.
add_test(
NAME "shortcut-keys"
COMMAND ${Python3_EXECUTABLE} scripts/check_shortcut_keys.py
COMMAND ${Python_EXECUTABLE} scripts/check_shortcut_keys.py
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
12 changes: 6 additions & 6 deletions cura/API/Account.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.

import enum
from datetime import datetime
from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot, pyqtProperty, QTimer, Q_ENUMS
from PyQt6.QtCore import QObject, pyqtSignal, pyqtSlot, pyqtProperty, QTimer, pyqtEnum
from typing import Any, Optional, Dict, TYPE_CHECKING, Callable

from UM.Logger import Logger
Expand All @@ -18,7 +18,7 @@
i18n_catalog = i18nCatalog("cura")


class SyncState:
class SyncState(enum.IntEnum):
"""QML: Cura.AccountSyncState"""
SYNCING = 0
SUCCESS = 1
Expand All @@ -41,7 +41,7 @@ class Account(QObject):

# The interval in which sync services are automatically triggered
SYNC_INTERVAL = 60.0 # seconds
Q_ENUMS(SyncState)
pyqtEnum(SyncState)

loginStateChanged = pyqtSignal(bool)
"""Signal emitted when user logged in or out"""
Expand Down Expand Up @@ -269,10 +269,10 @@ def accessToken(self) -> Optional[str]:
return self._authorization_service.getAccessToken()

@pyqtProperty("QVariantMap", notify = userProfileChanged)
def userProfile(self) -> Optional[Dict[str, Optional[str]]]:
def userProfile(self) -> Dict[str, Optional[str]]:
"""None if no user is logged in otherwise the logged in user as a dict containing containing user_id, username and profile_image_url """
if not self._user_profile:
return None
return {}
return self._user_profile.__dict__

@pyqtProperty(str, notify=lastSyncDateTimeChanged)
Expand Down
2 changes: 1 addition & 1 deletion cura/API/ConnectionStatus.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from PyQt5.QtCore import QObject, pyqtSignal, pyqtProperty
from PyQt6.QtCore import QObject, pyqtSignal, pyqtProperty

from UM.TaskManagement.HttpRequestManager import HttpRequestManager

Expand Down
7 changes: 4 additions & 3 deletions cura/API/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Optional, TYPE_CHECKING

from PyQt5.QtCore import QObject, pyqtProperty
from PyQt6.QtCore import QObject, pyqtProperty

from cura.API.Backups import Backups
from cura.API.ConnectionStatus import ConnectionStatus
Expand Down Expand Up @@ -34,12 +34,13 @@ def __new__(cls, application: Optional["CuraApplication"] = None):
raise RuntimeError("Tried to create singleton '{class_name}' more than once.".format(class_name = CuraAPI.__name__))
if application is None:
raise RuntimeError("Upon first time creation, the application must be set.")
cls.__instance = super(CuraAPI, cls).__new__(cls)
instance = super(CuraAPI, cls).__new__(cls)
cls._application = application
return cls.__instance
return instance

def __init__(self, application: Optional["CuraApplication"] = None) -> None:
super().__init__(parent = CuraAPI._application)
CuraAPI.__instance = self

self._account = Account(self._application)

Expand Down
2 changes: 1 addition & 1 deletion cura/AutoSave.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.

from PyQt5.QtCore import QTimer
from PyQt6.QtCore import QTimer
from typing import Any, TYPE_CHECKING

from UM.Logger import Logger
Expand Down
2 changes: 1 addition & 1 deletion cura/BuildVolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from cura.Scene.CuraSceneNode import CuraSceneNode
from cura.Settings.ExtruderManager import ExtruderManager

from PyQt5.QtCore import QTimer
from PyQt6.QtCore import QTimer


if TYPE_CHECKING:
Expand Down
6 changes: 3 additions & 3 deletions cura/CameraAnimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Cura is released under the terms of the LGPLv3 or higher.


from PyQt5.QtCore import QVariantAnimation, QEasingCurve
from PyQt5.QtGui import QVector3D
from PyQt6.QtCore import QVariantAnimation, QEasingCurve
from PyQt6.QtGui import QVector3D

from UM.Math.Vector import Vector

Expand All @@ -13,7 +13,7 @@ def __init__(self, parent = None):
super().__init__(parent)
self._camera_tool = None
self.setDuration(300)
self.setEasingCurve(QEasingCurve.OutQuad)
self.setEasingCurve(QEasingCurve.Type.OutQuad)

def setCameraTool(self, camera_tool):
self._camera_tool = camera_tool
Expand Down
18 changes: 9 additions & 9 deletions cura/CrashHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
except ImportError:
with_sentry_sdk = False

from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QUrl
from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit, QGroupBox, QCheckBox, QPushButton
from PyQt5.QtGui import QDesktopServices
from PyQt6.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QUrl
from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit, QGroupBox, QCheckBox, QPushButton
from PyQt6.QtGui import QDesktopServices

from UM.Application import Application
from UM.Logger import Logger
Expand Down Expand Up @@ -136,8 +136,8 @@ def _createEarlyCrashDialog(self):

# "backup and start clean" and "close" buttons
buttons = QDialogButtonBox()
buttons.addButton(QDialogButtonBox.Close)
buttons.addButton(catalog.i18nc("@action:button", "Backup and Reset Configuration"), QDialogButtonBox.AcceptRole)
buttons.addButton(QDialogButtonBox.StandardButton.Close)
buttons.addButton(catalog.i18nc("@action:button", "Backup and Reset Configuration"), QDialogButtonBox.ButtonRole.AcceptRole)
buttons.rejected.connect(self._closeEarlyCrashDialog)
buttons.accepted.connect(self._backupAndStartClean)

Expand All @@ -161,7 +161,7 @@ def _showConfigurationFolder(self):
QDesktopServices.openUrl(QUrl.fromLocalFile( path ))

def _showDetailedReport(self):
self.dialog.exec_()
self.dialog.exec()

def _createDialog(self):
"""Creates a modal dialog."""
Expand Down Expand Up @@ -409,12 +409,12 @@ def _logInfoWidget(self):

def _buttonsWidget(self):
buttons = QDialogButtonBox()
buttons.addButton(QDialogButtonBox.Close)
buttons.addButton(QDialogButtonBox.StandardButton.Close)
# Like above, this will be served as a separate detailed report dialog if the application has not yet been
# fully loaded. In this case, "send report" will be a check box in the early crash dialog, so there is no
# need for this extra button.
if self.has_started:
buttons.addButton(catalog.i18nc("@action:button", "Send report"), QDialogButtonBox.AcceptRole)
buttons.addButton(catalog.i18nc("@action:button", "Send report"), QDialogButtonBox.ButtonRole.AcceptRole)
buttons.accepted.connect(self._sendCrashReport)
buttons.rejected.connect(self.dialog.close)

Expand Down Expand Up @@ -456,5 +456,5 @@ def show(self):
def _show(self):
# When the exception is in the skip_exception_types list, the dialog is not created, so we don't need to show it
if self.dialog:
self.dialog.exec_()
self.dialog.exec()
os._exit(1)
4 changes: 2 additions & 2 deletions cura/CuraActions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.

from PyQt5.QtCore import QObject, QUrl
from PyQt5.QtGui import QDesktopServices
from PyQt6.QtCore import QObject, QUrl
from PyQt6.QtGui import QDesktopServices
from typing import List, cast

from UM.Event import CallFunctionEvent
Expand Down
Loading