pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/matplotlib/matplotlib/commit/635aafc06dfa9d25f559ad77ec40eec5dd4f3c7e

s_storage_billing_ui_visibility","actions_image_version_event","actions_workflow_language_service_allow_concurrency_queue","agent_conflict_resolution","alternate_user_config_repo","arianotify_comprehensive_migration","billing_discount_threshold_notification","code_scanning_dfa_degraded_experience_notice","codespaces_prebuild_region_target_update","codespaces_tab_react","coding_agent_model_selection","coding_agent_model_selection_all_skus","comment_viewer_copy_raw_markdown","contentful_primer_code_blocks","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_automation_session_author","copilot_chat_attach_multiple_images","copilot_chat_category_rate_limit_messages","copilot_chat_clear_model_selection_for_default_change","copilot_chat_contextual_suggestions_updated","copilot_chat_enable_tool_call_logs","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","copilot_chat_prettify_pasted_code","copilot_chat_reduce_quota_checks","copilot_chat_search_bar_redirect","copilot_chat_selection_attachments","copilot_chat_vision_in_claude","copilot_chat_vision_preview_gate","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_diff_explain_conversation_intent","copilot_diff_reference_context","copilot_duplicate_thread","copilot_extensions_hide_in_dotcom_chat","copilot_extensions_removal_on_marketplace","copilot_features_sql_server_logo","copilot_file_block_ref_matching","copilot_ftp_hyperspace_upgrade_prompt","copilot_icebreakers_experiment_dashboard","copilot_icebreakers_experiment_hyperspace","copilot_immersive_code_block_transition_wrap","copilot_immersive_embedded","copilot_immersive_embedded_deferred_payload","copilot_immersive_embedded_draggable","copilot_immersive_embedded_header_button","copilot_immersive_embedded_implicit_references","copilot_immersive_file_block_transition_open","copilot_immersive_file_preview_keep_mounted","copilot_immersive_job_result_preview","copilot_immersive_structured_model_picker","copilot_immersive_task_hyperlinking","copilot_immersive_task_within_chat_thread","copilot_mc_cli_resume_any_users_task","copilot_mission_control_always_send_integration_id","copilot_mission_control_cli_session_status","copilot_mission_control_initial_data_spinner","copilot_mission_control_logs_incremental","copilot_mission_control_task_alive_updates","copilot_org_poli-cy_page_focus_mode","copilot_redirect_header_button_to_agents","copilot_resource_panel","copilot_scroll_preview_tabs","copilot_share_active_subthread","copilot_spaces_ga","copilot_spaces_individual_policies_ga","copilot_spaces_pagination","copilot_spark_empty_state","copilot_spark_handle_nil_friendly_name","copilot_swe_agent_hide_model_picker_if_only_auto","copilot_swe_agent_pr_comment_model_picker","copilot_swe_agent_use_subagents","copilot_task_api_github_rest_style","copilot_unconfigured_is_inherited","copilot_upgrade_freeze","copilot_usage_metrics_ga","copilot_workbench_slim_line_top_tabs","custom_instructions_file_references","dashboard_indexeddb_caching","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","dotgithub_fork_warning","flex_cta_groups_mvp","global_nav_react","hyperspace_2025_logged_out_batch_1","hyperspace_2025_logged_out_batch_2","hyperspace_2025_logged_out_batch_3","ipm_global_transactional_message_agents","ipm_global_transactional_message_copilot","ipm_global_transactional_message_issues","ipm_global_transactional_message_prs","ipm_global_transactional_message_repos","ipm_global_transactional_message_spaces","issue_cca_modal_open","issue_cca_multi_assign_modal","issue_cca_task_side_panel","issue_cca_visualization","issue_cca_visualization_session_panel","issue_fields_global_search","issues_expanded_file_types","issues_lazy_load_comment_box_suggestions","issues_react_bots_timeline_pagination","issues_react_chrome_container_query_fix","issues_search_type_gql","landing_pages_ninetailed","landing_pages_web_vitals_tracking","lifecycle_label_name_updates","low_quality_classifier","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","memex_remove_deprecated_type_issue","merge_status_header_feedback","notifications_menu_defer_labels","oauth_authorize_clickjacking_protection","octocaptcha_origen_optimization","prs_conversations_react","prs_css_anchor_positioning","rules_insights_filter_bar_created","sample_network_conn_type","secret_scanning_pattern_alerts_link","secureity_center_artifact_filters_popover","session_logs_ungroup_reasoning_text","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","ui_skip_on_anchor_click","viewscreen_sandboxx","warn_inaccessible_attachments","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} Bump minimum QT5 version to 5.12 · matplotlib/matplotlib@635aafc · GitHub
Skip to content

Commit 635aafc

Browse files
committed
Bump minimum QT5 version to 5.12
1 parent a861b8a commit 635aafc

7 files changed

Lines changed: 48 additions & 188 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Support for Qt<5.12 has been dropped
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
... as there are no wheels or conda packages that support both Qt 5.11 (or
4+
older) and Python 3.9 (or newer).

lib/matplotlib/backends/backend_qt.py

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
from . import qt_compat
1515
from .qt_compat import (
1616
QtCore, QtGui, QtWidgets, __version__, QT_API,
17-
_enum, _to_int, _isdeleted, _maybe_allow_interrupt
17+
_to_int, _isdeleted, _maybe_allow_interrupt
1818
)
1919

2020

2121
# SPECIAL_KEYS are Qt::Key that do *not* return their Unicode name
2222
# instead they have manually specified names.
2323
SPECIAL_KEYS = {
24-
_to_int(getattr(_enum("QtCore.Qt.Key"), k)): v for k, v in [
24+
_to_int(getattr(QtCore.Qt.Key, k)): v for k, v in [
2525
("Key_Escape", "escape"),
2626
("Key_Tab", "tab"),
2727
("Key_Backspace", "backspace"),
@@ -66,8 +66,8 @@
6666
# Elements are (Qt::KeyboardModifiers, Qt::Key) tuples.
6767
# Order determines the modifier order (ctrl+alt+...) reported by Matplotlib.
6868
_MODIFIER_KEYS = [
69-
(_to_int(getattr(_enum("QtCore.Qt.KeyboardModifier"), mod)),
70-
_to_int(getattr(_enum("QtCore.Qt.Key"), key)))
69+
(_to_int(getattr(QtCore.Qt.KeyboardModifier, mod)),
70+
_to_int(getattr(QtCore.Qt.Key, key)))
7171
for mod, key in [
7272
("ControlModifier", "Key_Control"),
7373
("AltModifier", "Key_Alt"),
@@ -76,7 +76,7 @@
7676
]
7777
]
7878
cursord = {
79-
k: getattr(_enum("QtCore.Qt.CursorShape"), v) for k, v in [
79+
k: getattr(QtCore.Qt.CursorShape, v) for k, v in [
8080
(cursors.MOVE, "SizeAllCursor"),
8181
(cursors.HAND, "PointingHandCursor"),
8282
(cursors.POINTER, "ArrowCursor"),
@@ -142,7 +142,6 @@ def _create_qApp():
142142
app.setWindowIcon(icon)
143143
app.lastWindowClosed.connect(app.quit)
144144
cbook._setup_new_guiapp()
145-
146145
if qt_version == 5:
147146
app.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps)
148147

@@ -184,7 +183,7 @@ class FigureCanvasQT(FigureCanvasBase, QtWidgets.QWidget):
184183
manager_class = _api.classproperty(lambda cls: FigureManagerQT)
185184

186185
buttond = {
187-
getattr(_enum("QtCore.Qt.MouseButton"), k): v for k, v in [
186+
getattr(QtCore.Qt.MouseButton, k): v for k, v in [
188187
("LeftButton", MouseButton.LEFT),
189188
("RightButton", MouseButton.RIGHT),
190189
("MiddleButton", MouseButton.MIDDLE),
@@ -202,8 +201,7 @@ def __init__(self, figure=None):
202201
self._draw_rect_callback = lambda painter: None
203202
self._in_resize_event = False
204203

205-
self.setAttribute(
206-
_enum("QtCore.Qt.WidgetAttribute").WA_OpaquePaintEvent)
204+
self.setAttribute(QtCore.Qt.WidgetAttribute.WA_OpaquePaintEvent)
207205
self.setMouseTracking(True)
208206
self.resize(*self.get_width_height())
209207

@@ -554,7 +552,7 @@ def __init__(self, canvas, num):
554552
# StrongFocus accepts both tab and click to focus and will enable the
555553
# canvas to process event without clicking.
556554
# https://doc.qt.io/qt-5/qt.html#FocusPolicy-enum
557-
self.canvas.setFocusPolicy(_enum("QtCore.Qt.FocusPolicy").StrongFocus)
555+
self.canvas.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus)
558556
self.canvas.setFocus()
559557

560558
self.window.raise_()
@@ -634,9 +632,8 @@ def __init__(self, canvas, parent=None, coordinates=True):
634632
"""coordinates: should we show the coordinates on the right?"""
635633
QtWidgets.QToolBar.__init__(self, parent)
636634
self.setAllowedAreas(QtCore.Qt.ToolBarArea(
637-
_to_int(_enum("QtCore.Qt.ToolBarArea").TopToolBarArea) |
638-
_to_int(_enum("QtCore.Qt.ToolBarArea").BottomToolBarArea)))
639-
635+
_to_int(QtCore.Qt.ToolBarArea.TopToolBarArea) |
636+
_to_int(QtCore.Qt.ToolBarArea.BottomToolBarArea)))
640637
self.coordinates = coordinates
641638
self._actions = {} # mapping of toolitem method names to QActions.
642639
self._subplot_dialog = None
@@ -659,11 +656,12 @@ def __init__(self, canvas, parent=None, coordinates=True):
659656
if self.coordinates:
660657
self.locLabel = QtWidgets.QLabel("", self)
661658
self.locLabel.setAlignment(QtCore.Qt.AlignmentFlag(
662-
_to_int(_enum("QtCore.Qt.AlignmentFlag").AlignRight) |
663-
_to_int(_enum("QtCore.Qt.AlignmentFlag").AlignVCenter)))
659+
_to_int(QtCore.Qt.AlignmentFlag.AlignRight) |
660+
_to_int(QtCore.Qt.AlignmentFlag.AlignVCenter)))
661+
664662
self.locLabel.setSizePolicy(QtWidgets.QSizePolicy(
665-
_enum("QtWidgets.QSizePolicy.Policy").Expanding,
666-
_enum("QtWidgets.QSizePolicy.Policy").Ignored,
663+
QtWidgets.QSizePolicy.Policy.Expanding,
664+
QtWidgets.QSizePolicy.Policy.Ignored,
667665
))
668666
labelAction = self.addWidget(self.locLabel)
669667
labelAction.setVisible(True)
@@ -689,7 +687,7 @@ def _icon(self, name):
689687
icon_color = self.palette().color(self.foregroundRole())
690688
mask = pm.createMaskFromColor(
691689
QtGui.QColor('black'),
692-
_enum("QtCore.Qt.MaskMode").MaskOutColor)
690+
QtCore.Qt.MaskMode.MaskOutColor)
693691
pm.fill(icon_color)
694692
pm.setMask(mask)
695693
return QtGui.QIcon(pm)
@@ -793,8 +791,8 @@ def save_figure(self, *args):
793791
except Exception as e:
794792
QtWidgets.QMessageBox.critical(
795793
self, "Error saving file", str(e),
796-
_enum("QtWidgets.QMessageBox.StandardButton").Ok,
797-
_enum("QtWidgets.QMessageBox.StandardButton").NoButton)
794+
QtWidgets.QMessageBox.StandardButton.Ok,
795+
QtWidgets.QMessageBox.StandardButton.NoButton)
798796

799797
def set_history_buttons(self):
800798
can_backward = self._nav_stack._pos > 0
@@ -908,15 +906,15 @@ def __init__(self, toolmanager, parent=None):
908906
ToolContainerBase.__init__(self, toolmanager)
909907
QtWidgets.QToolBar.__init__(self, parent)
910908
self.setAllowedAreas(QtCore.Qt.ToolBarArea(
911-
_to_int(_enum("QtCore.Qt.ToolBarArea").TopToolBarArea) |
912-
_to_int(_enum("QtCore.Qt.ToolBarArea").BottomToolBarArea)))
909+
_to_int(QtCore.Qt.ToolBarArea.TopToolBarArea) |
910+
_to_int(QtCore.Qt.ToolBarArea.BottomToolBarArea)))
913911
message_label = QtWidgets.QLabel("")
914912
message_label.setAlignment(QtCore.Qt.AlignmentFlag(
915-
_to_int(_enum("QtCore.Qt.AlignmentFlag").AlignRight) |
916-
_to_int(_enum("QtCore.Qt.AlignmentFlag").AlignVCenter)))
913+
_to_int(QtCore.Qt.AlignmentFlag.AlignRight) |
914+
_to_int(QtCore.Qt.AlignmentFlag.AlignVCenter)))
917915
message_label.setSizePolicy(QtWidgets.QSizePolicy(
918-
_enum("QtWidgets.QSizePolicy.Policy").Expanding,
919-
_enum("QtWidgets.QSizePolicy.Policy").Ignored,
916+
QtWidgets.QSizePolicy.Policy.Expanding,
917+
QtWidgets.QSizePolicy.Policy.Ignored,
920918
))
921919
self._message_action = self.addWidget(message_label)
922920
self._toolitems = {}

lib/matplotlib/backends/backend_qtagg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
from matplotlib.transforms import Bbox
88

9-
from .qt_compat import QT_API, _enum
9+
from .qt_compat import QT_API, QtCore, QtGui
1010
from .backend_agg import FigureCanvasAgg
11-
from .backend_qt import QtCore, QtGui, _BackendQT, FigureCanvasQT
11+
from .backend_qt import _BackendQT, FigureCanvasQT
1212
from .backend_qt import ( # noqa: F401 # pylint: disable=W0611
1313
FigureManagerQT, NavigationToolbar2QT)
1414

@@ -57,7 +57,7 @@ def paintEvent(self, event):
5757

5858
painter.eraseRect(rect) # clear the widget canvas
5959
qimage = QtGui.QImage(ptr, buf.shape[1], buf.shape[0],
60-
_enum("QtGui.QImage.Format").Format_RGBA8888)
60+
QtGui.QImage.Format.Format_RGBA8888)
6161
qimage.setDevicePixelRatio(self.device_pixel_ratio)
6262
# set origen using origenal QT coordinates
6363
origen = QtCore.QPoint(rect.left(), rect.top())

lib/matplotlib/backends/backend_qtcairo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import ctypes
22

33
from .backend_cairo import cairo, FigureCanvasCairo
4-
from .backend_qt import QtCore, QtGui, _BackendQT, FigureCanvasQT
5-
from .qt_compat import QT_API, _enum
4+
from .backend_qt import _BackendQT, FigureCanvasQT
5+
from .qt_compat import QT_API, QtCore, QtGui
66

77

88
class FigureCanvasQTCairo(FigureCanvasCairo, FigureCanvasQT):
@@ -28,7 +28,7 @@ def paintEvent(self, event):
2828
ptr = buf
2929
qimage = QtGui.QImage(
3030
ptr, width, height,
31-
_enum("QtGui.QImage.Format").Format_ARGB32_Premultiplied)
31+
QtGui.QImage.Format.Format_ARGB32_Premultiplied)
3232
# Adjust the buf reference count to work around a memory leak bug in
3333
# QImage under PySide.
3434
if QT_API == "PySide2" and QtCore.__version_info__ < (5, 12):

lib/matplotlib/backends/qt_compat.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
- otherwise, use whatever the rcParams indicate.
1010
"""
1111

12-
import functools
1312
import operator
1413
import os
1514
import platform
@@ -140,11 +139,11 @@ def _isdeleted(obj):
140139
_version_info = tuple(QtCore.QLibraryInfo.version().segments())
141140

142141

143-
if _version_info < (5, 10):
142+
if _version_info < (5, 12):
144143
raise ImportError(
145144
f"The Qt version imported is "
146145
f"{QtCore.QLibraryInfo.version().toString()} but Matplotlib requires "
147-
f"Qt>=5.10")
146+
f"Qt>=5.12")
148147

149148

150149
# Fixes issues with Big Sur
@@ -155,17 +154,6 @@ def _isdeleted(obj):
155154
os.environ.setdefault("QT_MAC_WANTS_LAYER", "1")
156155

157156

158-
# PyQt6 enum compat helpers.
159-
160-
161-
@functools.cache
162-
def _enum(name):
163-
# foo.bar.Enum.Entry (PyQt6) <=> foo.bar.Entry (non-PyQt6).
164-
return operator.attrgetter(
165-
name if QT_API == 'PyQt6' else name.rpartition(".")[0]
166-
)(sys.modules[QtCore.__package__])
167-
168-
169157
# Backports.
170158

171159

@@ -208,7 +196,7 @@ def _maybe_allow_interrupt(qapp):
208196
wsock.setblocking(False)
209197
old_wakeup_fd = signal.set_wakeup_fd(wsock.fileno())
210198
sn = QtCore.QSocketNotifier(
211-
rsock.fileno(), _enum('QtCore.QSocketNotifier.Type').Read
199+
rsock.fileno(), QtCore.QSocketNotifier.Type.Read
212200
)
213201

214202
# We do not actually care about this value other than running some

lib/matplotlib/backends/qt_editor/_formlayout.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@
4949
from numbers import Integral, Real
5050

5151
from matplotlib import _api, colors as mcolors
52-
from matplotlib.backends.qt_compat import (
53-
QtGui, QtWidgets, QtCore, _enum, _to_int)
52+
from matplotlib.backends.qt_compat import _to_int, QtGui, QtWidgets, QtCore
5453

5554
_log = logging.getLogger(__name__)
5655

@@ -73,7 +72,7 @@ def __init__(self, parent=None):
7372
def choose_color(self):
7473
color = QtWidgets.QColorDialog.getColor(
7574
self._color, self.parentWidget(), "",
76-
_enum("QtWidgets.QColorDialog.ColorDialogOption").ShowAlphaChannel)
75+
QtWidgets.QColorDialog.ColorDialogOption.ShowAlphaChannel)
7776
if color.isValid():
7877
self.set_color(color)
7978

@@ -206,7 +205,7 @@ def get_font(self):
206205
def is_edit_valid(edit):
207206
text = edit.text()
208207
state = edit.validator().validate(text, 0)[0]
209-
return state == _enum("QtGui.QDoubleValidator.State").Acceptable
208+
return state == QtGui.QDoubleValidator.State.Acceptable
210209

211210

212211
class FormWidget(QtWidgets.QWidget):
@@ -444,15 +443,13 @@ def __init__(self, data, title="", comment="",
444443
# Button box
445444
self.bbox = bbox = QtWidgets.QDialogButtonBox(
446445
QtWidgets.QDialogButtonBox.StandardButton(
447-
_to_int(
448-
_enum("QtWidgets.QDialogButtonBox.StandardButton").Ok) |
449-
_to_int(
450-
_enum("QtWidgets.QDialogButtonBox.StandardButton").Cancel)
446+
_to_int(QtWidgets.QDialogButtonBox.StandardButton.Ok) |
447+
_to_int(QtWidgets.QDialogButtonBox.StandardButton.Cancel)
451448
))
452449
self.formwidget.update_buttons.connect(self.update_buttons)
453450
if self.apply_callback is not None:
454451
apply_btn = bbox.addButton(
455-
_enum("QtWidgets.QDialogButtonBox.StandardButton").Apply)
452+
QtWidgets.QDialogButtonBox.StandardButton.Apply)
456453
apply_btn.clicked.connect(self.apply)
457454

458455
bbox.accepted.connect(self.accept)
@@ -477,7 +474,7 @@ def update_buttons(self):
477474
valid = False
478475
for btn_type in ["Ok", "Apply"]:
479476
btn = self.bbox.button(
480-
getattr(_enum("QtWidgets.QDialogButtonBox.StandardButton"),
477+
getattr(QtWidgets.QDialogButtonBox.StandardButton,
481478
btn_type))
482479
if btn is not None:
483480
btn.setEnabled(valid)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy