PythonQwt 0.10.5__tar.gz → 0.10.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/CHANGELOG.md +18 -0
  2. {PythonQwt-0.10.5/PythonQwt.egg-info → PythonQwt-0.10.6}/PKG-INFO +1 -1
  3. {PythonQwt-0.10.5 → PythonQwt-0.10.6/PythonQwt.egg-info}/PKG-INFO +1 -1
  4. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/PythonQwt.egg-info/SOURCES.txt +8 -0
  5. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/README.md +9 -0
  6. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/__init__.py +1 -1
  7. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/dyngrid_layout.py +5 -3
  8. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/graphic.py +6 -13
  9. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/legend.py +9 -7
  10. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/painter.py +15 -31
  11. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/plot.py +13 -19
  12. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/plot_canvas.py +12 -14
  13. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/plot_layout.py +8 -2
  14. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/plot_renderer.py +37 -23
  15. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/scale_map.py +13 -21
  16. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/scale_widget.py +4 -1
  17. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/symbol.py +15 -18
  18. PythonQwt-0.10.6/qwt/tests/data/basesymbol.png +0 -0
  19. PythonQwt-0.10.6/qwt/tests/data/bodedemo.png +0 -0
  20. PythonQwt-0.10.6/qwt/tests/data/builtinsymbol.png +0 -0
  21. PythonQwt-0.10.6/qwt/tests/data/curvebenchmark1.png +0 -0
  22. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/data/curvebenchmark2.png +0 -0
  23. PythonQwt-0.10.6/qwt/tests/data/data.png +0 -0
  24. PythonQwt-0.10.6/qwt/tests/data/graphic.png +0 -0
  25. PythonQwt-0.10.6/qwt/tests/data/image.png +0 -0
  26. PythonQwt-0.10.6/qwt/tests/data/loadtest.png +0 -0
  27. PythonQwt-0.10.6/qwt/tests/data/mapdemo.png +0 -0
  28. PythonQwt-0.10.6/qwt/tests/data/path.png +0 -0
  29. PythonQwt-0.10.6/qwt/tests/data/pixmap.png +0 -0
  30. PythonQwt-0.10.6/qwt/tests/data/simple.png +0 -0
  31. PythonQwt-0.10.6/qwt/tests/data/svgdocument.png +0 -0
  32. PythonQwt-0.10.6/qwt/tests/data/symbol.svg +411 -0
  33. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/data/testlauncher.png +0 -0
  34. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_bodedemo.py +43 -24
  35. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_curvebenchmark1.py +12 -10
  36. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_curvebenchmark2.py +1 -1
  37. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_loadtest.py +4 -4
  38. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_simple.py +15 -2
  39. PythonQwt-0.10.6/qwt/tests/test_symbols.py +201 -0
  40. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/utils.py +17 -8
  41. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/text.py +13 -10
  42. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/setup.py +2 -2
  43. PythonQwt-0.10.5/qwt/tests/data/bodedemo.png +0 -0
  44. PythonQwt-0.10.5/qwt/tests/data/curvebenchmark1.png +0 -0
  45. PythonQwt-0.10.5/qwt/tests/data/data.png +0 -0
  46. PythonQwt-0.10.5/qwt/tests/data/image.png +0 -0
  47. PythonQwt-0.10.5/qwt/tests/data/loadtest.png +0 -0
  48. PythonQwt-0.10.5/qwt/tests/data/mapdemo.png +0 -0
  49. PythonQwt-0.10.5/qwt/tests/data/simple.png +0 -0
  50. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/LICENSE +0 -0
  51. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/MANIFEST.in +0 -0
  52. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/PythonQwt.egg-info/dependency_links.txt +0 -0
  53. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/PythonQwt.egg-info/entry_points.txt +0 -0
  54. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/PythonQwt.egg-info/requires.txt +0 -0
  55. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/PythonQwt.egg-info/top_level.txt +0 -0
  56. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/_static/PythonQwt_logo.png +0 -0
  57. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/_static/QwtPlot_example.png +0 -0
  58. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/_static/panorama.png +0 -0
  59. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/_static/symbol_path_example.png +0 -0
  60. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/conf.py +0 -0
  61. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/examples/bodedemo.rst +0 -0
  62. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/examples/cartesian.rst +0 -0
  63. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/examples/cpudemo.rst +0 -0
  64. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/examples/curvebenchmark1.rst +0 -0
  65. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/examples/curvebenchmark2.rst +0 -0
  66. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/examples/curvedemo1.rst +0 -0
  67. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/examples/curvedemo2.rst +0 -0
  68. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/examples/data.rst +0 -0
  69. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/examples/errorbar.rst +0 -0
  70. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/examples/eventfilter.rst +0 -0
  71. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/examples/image.rst +0 -0
  72. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/examples/index.rst +0 -0
  73. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/examples/logcurve.rst +0 -0
  74. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/examples/mapdemo.rst +0 -0
  75. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/examples/multidemo.rst +0 -0
  76. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/examples/simple.rst +0 -0
  77. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/examples/vertical.rst +0 -0
  78. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/index.rst +0 -0
  79. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/installation.rst +0 -0
  80. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/overview.rst +0 -0
  81. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/plot_example.py +0 -0
  82. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/reference/graphic.rst +0 -0
  83. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/reference/index.rst +0 -0
  84. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/reference/interval.rst +0 -0
  85. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/reference/plot.rst +0 -0
  86. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/reference/plot_directpainter.rst +0 -0
  87. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/reference/plot_layout.rst +0 -0
  88. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/reference/plot_series.rst +0 -0
  89. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/reference/scale.rst +0 -0
  90. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/reference/symbol.rst +0 -0
  91. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/reference/text.rst +0 -0
  92. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/reference/toqimage.rst +0 -0
  93. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/reference/transform.rst +0 -0
  94. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/doc/symbol_path_example.py +0 -0
  95. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/_math.py +0 -0
  96. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/color_map.py +0 -0
  97. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/column_symbol.py +0 -0
  98. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/interval.py +0 -0
  99. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/null_paintdevice.py +0 -0
  100. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/painter_command.py +0 -0
  101. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/plot_curve.py +0 -0
  102. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/plot_directpainter.py +0 -0
  103. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/plot_grid.py +0 -0
  104. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/plot_marker.py +0 -0
  105. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/plot_series.py +0 -0
  106. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/qthelpers.py +0 -0
  107. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/scale_div.py +0 -0
  108. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/scale_draw.py +0 -0
  109. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/scale_engine.py +0 -0
  110. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/__init__.py +0 -0
  111. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/comparative_benchmarks.py +0 -0
  112. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/conftest.py +0 -0
  113. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/data/PythonQwt.svg +0 -0
  114. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/data/cartesian.png +0 -0
  115. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/data/cpudemo.png +0 -0
  116. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/data/curvedemo1.png +0 -0
  117. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/data/curvedemo2.png +0 -0
  118. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/data/errorbar.png +0 -0
  119. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/data/eventfilter.png +0 -0
  120. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/data/logcurve.png +0 -0
  121. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/data/multidemo.png +0 -0
  122. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/data/stylesheet.png +0 -0
  123. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/data/vertical.png +0 -0
  124. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_cartesian.py +0 -0
  125. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_cpudemo.py +0 -0
  126. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_curvedemo1.py +0 -0
  127. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_curvedemo2.py +0 -0
  128. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_data.py +0 -0
  129. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_errorbar.py +0 -0
  130. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_eventfilter.py +0 -0
  131. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_image.py +0 -0
  132. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_logcurve.py +0 -0
  133. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_mapdemo.py +0 -0
  134. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_multidemo.py +0 -0
  135. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_stylesheet.py +0 -0
  136. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/tests/test_vertical.py +0 -0
  137. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/toqimage.py +0 -0
  138. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/qwt/transform.py +0 -0
  139. {PythonQwt-0.10.5 → PythonQwt-0.10.6}/setup.cfg +0 -0
@@ -1,5 +1,23 @@
1
1
  # PythonQwt Releases
2
2
 
3
+ ## Version 0.10.6
4
+
5
+ - Qt6 support:
6
+ - Handled all occurences of deprecated ``QWidget.getContentsMargins`` method.
7
+ - Removed references to NonCosmeticDefaultPen
8
+ - Fixed `QApplication.desktop` `AttributeError`
9
+ - Fixed `QPrinter.HighResolution` `AttributeError` on Linux
10
+ - Fixed `QPrinter.setColorMode` `AttributeError` on PyQt6/Linux
11
+ - Fixed `QPrinter.setOrientation` deprecation issue
12
+ - Fixed `QPrinter.setPaperSize` deprecation issue
13
+ - Improved unit tests:
14
+ - Ensure that tests are entirely executed before quitting (in unattended mode)
15
+ - Added more tests on `qwt.symbols`
16
+ - Added tests on `qwt.plot_renderer`
17
+ - `qwt.plot_renderer`: fixed resolution type
18
+ - `qwt.symbols`: fixed `QPointF` type mismatch
19
+ - Removed CHM help file generation (obsolete)
20
+
3
21
  ## Version 0.10.5
4
22
 
5
23
  - [Issue #81](https://github.com/PlotPyStack/PythonQwt/issues/81) - Signal disconnection issue with PySide 6.5.3
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PythonQwt
3
- Version: 0.10.5
3
+ Version: 0.10.6
4
4
  Summary: Qt plotting widgets for Python
5
5
  Home-page: https://github.com/PlotPyStack/PythonQwt
6
6
  Author: Pierre Raybaut
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PythonQwt
3
- Version: 0.10.5
3
+ Version: 0.10.6
4
4
  Summary: Qt plotting widgets for Python
5
5
  Home-page: https://github.com/PlotPyStack/PythonQwt
6
6
  Author: Pierre Raybaut
@@ -98,10 +98,13 @@ qwt/tests/test_mapdemo.py
98
98
  qwt/tests/test_multidemo.py
99
99
  qwt/tests/test_simple.py
100
100
  qwt/tests/test_stylesheet.py
101
+ qwt/tests/test_symbols.py
101
102
  qwt/tests/test_vertical.py
102
103
  qwt/tests/utils.py
103
104
  qwt/tests/data/PythonQwt.svg
105
+ qwt/tests/data/basesymbol.png
104
106
  qwt/tests/data/bodedemo.png
107
+ qwt/tests/data/builtinsymbol.png
105
108
  qwt/tests/data/cartesian.png
106
109
  qwt/tests/data/cpudemo.png
107
110
  qwt/tests/data/curvebenchmark1.png
@@ -111,12 +114,17 @@ qwt/tests/data/curvedemo2.png
111
114
  qwt/tests/data/data.png
112
115
  qwt/tests/data/errorbar.png
113
116
  qwt/tests/data/eventfilter.png
117
+ qwt/tests/data/graphic.png
114
118
  qwt/tests/data/image.png
115
119
  qwt/tests/data/loadtest.png
116
120
  qwt/tests/data/logcurve.png
117
121
  qwt/tests/data/mapdemo.png
118
122
  qwt/tests/data/multidemo.png
123
+ qwt/tests/data/path.png
124
+ qwt/tests/data/pixmap.png
119
125
  qwt/tests/data/simple.png
120
126
  qwt/tests/data/stylesheet.png
127
+ qwt/tests/data/svgdocument.png
128
+ qwt/tests/data/symbol.svg
121
129
  qwt/tests/data/testlauncher.png
122
130
  qwt/tests/data/vertical.png
@@ -85,6 +85,15 @@ plot items needed by `guiqwt`): `QwtPlotItem` (base class), `QwtPlotItem`,
85
85
  See "Overview" section in [documentation](https://pythonqwt.readthedocs.io/en/latest/)
86
86
  for more details on API limitations when comparing to Qwt.
87
87
 
88
+ ## Roadmap
89
+
90
+ The `qwt` package short-term roadmap is the following:
91
+
92
+ - [ ] Drop support for PyQt4 and PySide2
93
+ - [ ] Drop support for Python < 3.8
94
+ - [ ] Replace `setup.py` by `pyproject.toml`, using `setuptools` (e.g. see `guidata`)
95
+ - [ ] Add more unit tests: the ultimate goal is to reach 90% code coverage
96
+
88
97
  ## Dependencies
89
98
 
90
99
  ### Requirements
@@ -27,7 +27,7 @@ External resources:
27
27
  .. _GitHub: https://github.com/PlotPyStack/PythonQwt
28
28
  """
29
29
 
30
- __version__ = "0.10.5"
30
+ __version__ = "0.10.6"
31
31
  QWT_VERSION_STR = "6.1.5"
32
32
 
33
33
  import warnings
@@ -299,9 +299,11 @@ class QwtDynGridLayout(QLayout):
299
299
  return
300
300
  expandH = self.expandingDirections() & Qt.Horizontal
301
301
  expandV = self.expandingDirections() & Qt.Vertical
302
- mleft, mtop, mright, mbottom = self.getContentsMargins()
302
+ margins = self.contentsMargins()
303
+ wmargins = margins.left() + margins.right()
304
+ hmargins = margins.top() + margins.bottom()
303
305
  if expandH:
304
- xDelta = rect.width() - (mleft + mright) - (numColumns - 1) * self.spacing()
306
+ xDelta = rect.width() - wmargins - (numColumns - 1) * self.spacing()
305
307
  for col in range(numColumns):
306
308
  xDelta -= colWidth[col]
307
309
  if xDelta > 0:
@@ -313,7 +315,7 @@ class QwtDynGridLayout(QLayout):
313
315
  numRows = self.itemCount() / numColumns
314
316
  if self.itemCount() % numColumns:
315
317
  numRows += 1
316
- yDelta = rect.height() - (mtop + mbottom) - (numRows - 1) * self.spacing()
318
+ yDelta = rect.height() - hmargins - (numRows - 1) * self.spacing()
317
319
  for row in range(numRows):
318
320
  yDelta -= rowHeight[row]
319
321
  if yDelta > 0:
@@ -14,18 +14,19 @@ QwtGraphic
14
14
  """
15
15
 
16
16
  import math
17
- from qwt.null_paintdevice import QwtNullPaintDevice
18
- from qwt.painter_command import QwtPainterCommand
19
17
 
18
+ from qtpy.QtCore import QPointF, QRect, QRectF, QSize, QSizeF, Qt
20
19
  from qtpy.QtGui import (
20
+ QImage,
21
+ QPaintEngine,
21
22
  QPainter,
22
23
  QPainterPathStroker,
23
- QPaintEngine,
24
24
  QPixmap,
25
25
  QTransform,
26
- QImage,
27
26
  )
28
- from qtpy.QtCore import Qt, QRectF, QSizeF, QSize, QPointF, QRect
27
+
28
+ from qwt.null_paintdevice import QwtNullPaintDevice
29
+ from qwt.painter_command import QwtPainterCommand
29
30
 
30
31
 
31
32
  def qwtHasScalablePen(painter):
@@ -33,10 +34,6 @@ def qwtHasScalablePen(painter):
33
34
  scalablePen = False
34
35
  if pen.style() != Qt.NoPen and pen.brush().style() != Qt.NoBrush:
35
36
  scalablePen = not pen.isCosmetic()
36
- if not scalablePen and pen.widthF() == 0.0:
37
- hints = painter.renderHints()
38
- if hints & QPainter.NonCosmeticDefaultPen:
39
- scalablePen = True
40
37
  return scalablePen
41
38
 
42
39
 
@@ -65,10 +62,6 @@ def qwtExecCommand(painter, cmd, renderHints, transform, initialTransform):
65
62
  and painter.transform().isScaling()
66
63
  ):
67
64
  isCosmetic = painter.pen().isCosmetic()
68
- if isCosmetic and painter.pen().widthF() == 0.0:
69
- hints = painter.renderHints()
70
- if hints & QPainter.NonCosmeticDefaultPen:
71
- isCosmetic = False
72
65
  doMap = not isCosmetic
73
66
  if doMap:
74
67
  tr = painter.transform()
@@ -308,7 +308,8 @@ class QwtLegendLabel(QwtTextLabel):
308
308
  spacing = max([spacing, 0])
309
309
  if spacing != self.__data.spacing:
310
310
  self.__data.spacing = spacing
311
- margin = max(self.getContentsMargins())
311
+ mgn = self.contentsMargins()
312
+ margin = max([mgn.left(), mgn.top(), mgn.right(), mgn.bottom()])
312
313
  indent = margin + self.__data.spacing
313
314
  if self.__data.icon.width() > 0:
314
315
  indent += self.__data.icon.width() + self.__data.spacing
@@ -912,12 +913,12 @@ class QwtLegend(QwtAbstractLegend):
912
913
  legendLayout = self.__data.view.contentsWidget.layout()
913
914
  if legendLayout is None:
914
915
  return
915
- left, right, top, bottom = self.layout().getContentsMargins()
916
+ margins = self.layout().contentsMargins()
916
917
  layoutRect = QRect()
917
- layoutRect.setLeft(math.ceil(rect.left()) + left)
918
- layoutRect.setTop(math.ceil(rect.top()) + top)
919
- layoutRect.setRight(math.ceil(rect.right()) - right)
920
- layoutRect.setBottom(math.ceil(rect.bottom()) - bottom)
918
+ layoutRect.setLeft(math.ceil(rect.left()) + margins.left())
919
+ layoutRect.setTop(math.ceil(rect.top()) + margins.top())
920
+ layoutRect.setRight(math.ceil(rect.right()) - margins.right())
921
+ layoutRect.setBottom(math.ceil(rect.bottom()) - margins.bottom())
921
922
  numCols = legendLayout.columnsForWidth(layoutRect.width())
922
923
  itemRects = legendLayout.layoutItems(layoutRect, numCols)
923
924
  index = 0
@@ -949,7 +950,8 @@ class QwtLegend(QwtAbstractLegend):
949
950
  if label is not None:
950
951
  icon = label.data().icon()
951
952
  sz = icon.defaultSize()
952
- margin = max(label.getContentsMargins())
953
+ mgn = label.contentsMargins()
954
+ margin = max([mgn.left(), mgn.top(), mgn.right(), mgn.bottom()])
953
955
  iconRect = QRectF(
954
956
  rect.x() + margin,
955
957
  rect.center().y() - 0.5 * sz.height(),
@@ -13,24 +13,24 @@ QwtPainterClass
13
13
  :members:
14
14
  """
15
15
 
16
- from qwt.color_map import QwtColorMap
17
- from qwt.scale_map import QwtScaleMap
18
-
16
+ from qtpy import QtCore as QC
17
+ from qtpy.QtCore import QLineF, QPoint, QRect, QRectF, Qt
19
18
  from qtpy.QtGui import (
19
+ QBrush,
20
+ QColor,
21
+ QLinearGradient,
20
22
  QPaintEngine,
21
- QPixmap,
22
23
  QPainter,
24
+ QPainterPath,
23
25
  QPalette,
24
26
  QPen,
25
- QBrush,
27
+ QPixmap,
26
28
  QRegion,
27
- QLinearGradient,
28
- QPainterPath,
29
- QColor,
30
29
  )
31
- from qtpy.QtWidgets import QFrame, QStyle, QStyleOptionFocusRect, QStyleOption
32
- from qtpy.QtCore import Qt, QRect, QPoint, QRectF, QLineF
33
- from qtpy import QtCore as QC
30
+ from qtpy.QtWidgets import QFrame, QStyle, QStyleOption, QStyleOptionFocusRect
31
+
32
+ from qwt.color_map import QwtColorMap
33
+ from qwt.scale_map import QwtScaleMap
34
34
 
35
35
  QT_MAJOR_VERSION = int(QC.__version__.split(".")[0])
36
36
 
@@ -64,26 +64,10 @@ class QwtPainterClass(object):
64
64
  """A collection of `QPainter` workarounds"""
65
65
 
66
66
  def drawImage(self, painter, rect, image):
67
- alignedRect = rect.toAlignedRect()
68
- if alignedRect != rect:
69
- clipRect = rect.adjusted(0.0, 0.0, -1.0, -1.0)
70
- painter.save()
71
- painter.setClipRect(clipRect, Qt.IntersectClip)
72
- painter.drawImage(alignedRect, image)
73
- painter.restore()
74
- else:
75
- painter.drawImage(alignedRect, image)
67
+ painter.drawImage(rect, image)
76
68
 
77
69
  def drawPixmap(self, painter, rect, pixmap):
78
- alignedRect = rect.toAlignedRect()
79
- if alignedRect != rect:
80
- clipRect = rect.adjusted(0.0, 0.0, -1.0, -1.0)
81
- painter.save()
82
- painter.setClipRect(clipRect, Qt.IntersectClip)
83
- painter.drawPixmap(alignedRect, pixmap)
84
- painter.restore()
85
- else:
86
- painter.drawPixmap(alignedRect, pixmap)
70
+ painter.drawPixmap(rect, pixmap)
87
71
 
88
72
  def drawFocusRect(self, *args):
89
73
  if len(args) == 2:
@@ -397,7 +381,7 @@ class QwtPainterClass(object):
397
381
  pmPainter.setPen(c)
398
382
  pmPainter.drawLine(QLineF(devRect.left(), y, devRect.right(), y))
399
383
  pmPainter.end()
400
- self.drawPixmap(painter, rect, pixmap)
384
+ self.drawPixmap(painter, devRect, pixmap)
401
385
 
402
386
  def fillPixmap(self, widget, pixmap, offset=None):
403
387
  """
@@ -447,7 +431,7 @@ class QwtPainterClass(object):
447
431
  if widget.testAttribute(Qt.WA_StyledBackground):
448
432
  opt = QStyleOption()
449
433
  opt.initFrom(widget)
450
- opt.rect = QRectF(rect).toAlignedRect()
434
+ opt.rect = rect
451
435
  widget.style().drawPrimitive(QStyle.PE_Widget, opt, painter, widget)
452
436
  else:
453
437
  brush = widget.palette().brush(widget.backgroundRole())
@@ -21,27 +21,21 @@ QwtPlotItem
21
21
 
22
22
  import math
23
23
 
24
- from qtpy.QtWidgets import (
25
- QWidget,
26
- QSizePolicy,
27
- QFrame,
28
- QApplication,
29
- )
30
- from qtpy.QtGui import QFont, QPainter, QPalette, QColor, QBrush
31
- from qtpy.QtCore import Qt, Signal, QEvent, QSize, QRectF
24
+ import numpy as np
25
+ from qtpy.QtCore import QEvent, QRectF, QSize, Qt, Signal
26
+ from qtpy.QtGui import QBrush, QColor, QFont, QPainter, QPalette
27
+ from qtpy.QtWidgets import QApplication, QFrame, QSizePolicy, QWidget
32
28
 
33
- from qwt.text import QwtText, QwtTextLabel
34
- from qwt.scale_widget import QwtScaleWidget
35
- from qwt.scale_draw import QwtScaleDraw
36
- from qwt.scale_engine import QwtLinearScaleEngine
29
+ from qwt.graphic import QwtGraphic
30
+ from qwt.interval import QwtInterval
31
+ from qwt.legend import QwtLegendData
37
32
  from qwt.plot_canvas import QwtPlotCanvas
38
33
  from qwt.scale_div import QwtScaleDiv
34
+ from qwt.scale_draw import QwtScaleDraw
35
+ from qwt.scale_engine import QwtLinearScaleEngine
39
36
  from qwt.scale_map import QwtScaleMap
40
- from qwt.graphic import QwtGraphic
41
- from qwt.legend import QwtLegendData
42
- from qwt.interval import QwtInterval
43
-
44
- import numpy as np
37
+ from qwt.scale_widget import QwtScaleWidget
38
+ from qwt.text import QwtText, QwtTextLabel
45
39
 
46
40
 
47
41
  def qwtSetTabOrder(first, second, with_children):
@@ -1644,7 +1638,7 @@ class QwtPlot(QFrame):
1644
1638
  renderer.renderTo(self, printer)
1645
1639
 
1646
1640
  def exportTo(
1647
- self, filename, size=(800, 600), size_mm=None, resolution=72.0, format_=None
1641
+ self, filename, size=(800, 600), size_mm=None, resolution=85, format_=None
1648
1642
  ):
1649
1643
  """
1650
1644
  Export plot to PDF or image file (SVG, PNG, ...)
@@ -1652,7 +1646,7 @@ class QwtPlot(QFrame):
1652
1646
  :param str filename: Filename
1653
1647
  :param tuple size: (width, height) size in pixels
1654
1648
  :param tuple size_mm: (width, height) size in millimeters
1655
- :param float resolution: Image resolution
1649
+ :param int resolution: Resolution in dots per Inch (dpi)
1656
1650
  :param str format_: File format (PDF, SVG, PNG, ...)
1657
1651
  """
1658
1652
  if size_mm is None:
@@ -15,26 +15,25 @@ QwtPlotCanvas
15
15
 
16
16
  import os
17
17
 
18
- from qwt.null_paintdevice import QwtNullPaintDevice
19
- from qwt.painter import QwtPainter
20
-
18
+ from qtpy import QtCore as QC
19
+ from qtpy.QtCore import QEvent, QPointF, QRect, QRectF, QSizeF, Qt
21
20
  from qtpy.QtGui import (
22
- QPaintEngine,
23
- QPen,
24
21
  QBrush,
25
- QRegion,
22
+ QGradient,
26
23
  QImage,
24
+ QPaintEngine,
25
+ QPainter,
27
26
  QPainterPath,
27
+ QPen,
28
28
  QPixmap,
29
- QGradient,
30
- QPainter,
31
- qAlpha,
32
29
  QPolygonF,
30
+ QRegion,
31
+ qAlpha,
33
32
  )
34
- from qtpy.QtWidgets import QFrame, QStyleOption, QStyle
35
- from qtpy.QtCore import Qt, QSizeF, QEvent, QPointF, QRectF, QRect
36
- from qtpy import QtCore as QC
33
+ from qtpy.QtWidgets import QFrame, QStyle, QStyleOption
37
34
 
35
+ from qwt.null_paintdevice import QwtNullPaintDevice
36
+ from qwt.painter import QwtPainter
38
37
 
39
38
  QT_MAJOR_VERSION = int(QC.__version__.split(".")[0])
40
39
  QT_API = os.environ["QT_API"]
@@ -310,8 +309,7 @@ def qwtFillBackground(*args):
310
309
  else:
311
310
  clipRegion = widget.contentsRect()
312
311
  bgWidget = qwtBackgroundWidget(widget.parentWidget())
313
- for fillRect in fillRects:
314
- rect = QRectF(fillRect).toAlignedRect()
312
+ for rect in fillRects:
315
313
  if clipRegion.intersects(rect):
316
314
  pm = QPixmap(rect.size())
317
315
  QwtPainter.fillPixmap(
@@ -135,7 +135,10 @@ class QwtPlotLayout_LayoutData(object):
135
135
  self.scale[axis].dimWithoutTitle = 0
136
136
  layout = plot.canvas().layout()
137
137
  if layout is not None:
138
- self.canvas.contentsMargins = layout.getContentsMargins()
138
+ mgn = layout.contentsMargins()
139
+ self.canvas.contentsMargins = [
140
+ mgn.left(), mgn.top(), mgn.right(), mgn.bottom()
141
+ ]
139
142
 
140
143
 
141
144
  class QwtPlotLayout_PrivateData(object):
@@ -571,7 +574,10 @@ class QwtPlotLayout(object):
571
574
  if layout is None:
572
575
  left, top, right, bottom = 0, 0, 0, 0
573
576
  else:
574
- left, top, right, bottom = layout.getContentsMargins()
577
+ mgn = layout.contentsMargins()
578
+ left, top, right, bottom = (
579
+ mgn.left(), mgn.top(), mgn.right(), mgn.bottom()
580
+ )
575
581
  for axis in QwtPlot.AXES:
576
582
  if plot.axisEnabled(axis):
577
583
  scl = plot.axisWidget(axis)
@@ -13,31 +13,32 @@ QwtPlotRenderer
13
13
  :members:
14
14
  """
15
15
 
16
- from qwt.painter import QwtPainter
17
- from qwt.plot import QwtPlot
18
- from qwt.plot_layout import QwtPlotLayout
19
- from qwt.scale_draw import QwtScaleDraw
20
- from qwt.scale_map import QwtScaleMap
16
+ import math
17
+ import os.path as osp
21
18
 
19
+ from qtpy.compat import getsavefilename
20
+ from qtpy.QtCore import QObject, QRect, QRectF, QSizeF, Qt
22
21
  from qtpy.QtGui import (
23
- QPainter,
24
- QImageWriter,
25
- QImage,
26
22
  QColor,
23
+ QImage,
24
+ QImageWriter,
25
+ QPageSize,
27
26
  QPaintDevice,
28
- QTransform,
29
- QPalette,
27
+ QPainter,
30
28
  QPainterPath,
29
+ QPalette,
31
30
  QPen,
31
+ QTransform,
32
32
  )
33
- from qtpy.QtWidgets import QFileDialog
34
33
  from qtpy.QtPrintSupport import QPrinter
35
- from qtpy.QtCore import Qt, QRect, QRectF, QObject, QSizeF
36
34
  from qtpy.QtSvg import QSvgGenerator
37
- from qtpy.compat import getsavefilename
35
+ from qtpy.QtWidgets import QFileDialog
38
36
 
39
- import math
40
- import os.path as osp
37
+ from qwt.painter import QwtPainter
38
+ from qwt.plot import QwtPlot
39
+ from qwt.plot_layout import QwtPlotLayout
40
+ from qwt.scale_draw import QwtScaleDraw
41
+ from qwt.scale_map import QwtScaleMap
41
42
 
42
43
 
43
44
  def qwtCanvasClip(canvas, canvasRect):
@@ -241,12 +242,20 @@ class QwtPlotRenderer(QObject):
241
242
  if fmt in ("pdf", "ps"):
242
243
  printer = QPrinter()
243
244
  if fmt == "pdf":
244
- printer.setOutputFormat(QPrinter.PdfFormat)
245
+ try:
246
+ printer.setOutputFormat(QPrinter.PdfFormat)
247
+ except AttributeError:
248
+ # PyQt6 on Linux
249
+ printer.setPrinterName("")
245
250
  else:
246
251
  printer.setOutputFormat(QPrinter.PostScriptFormat)
247
- printer.setColorMode(QPrinter.Color)
252
+ try:
253
+ printer.setColorMode(QPrinter.Color)
254
+ except AttributeError:
255
+ # PyQt6 on Linux
256
+ pass
248
257
  printer.setFullPage(True)
249
- printer.setPaperSize(sizeMM, QPrinter.Millimeter)
258
+ printer.setPageSize(QPageSize(sizeMM, QPageSize.Millimeter))
250
259
  printer.setDocName(title)
251
260
  printer.setOutputFileName(filename)
252
261
  printer.setResolution(resolution)
@@ -356,8 +365,8 @@ class QwtPlotRenderer(QObject):
356
365
  invtrans, _ok = transform.inverted()
357
366
  layoutRect = invtrans.mapRect(plotRect)
358
367
  if not (self.__data.discardFlags & self.DiscardBackground):
359
- left, top, right, bottom = plot.getContentsMargins()
360
- layoutRect.adjust(left, top, -right, -bottom)
368
+ mg = plot.contentsMargins()
369
+ layoutRect.adjust(mg.left(), mg.top(), -mg.right(), -mg.bottom())
361
370
 
362
371
  layout = plot.plotLayout()
363
372
  baseLineDists = canvasMargins = [None] * len(QwtPlot.AXES)
@@ -367,7 +376,10 @@ class QwtPlotRenderer(QObject):
367
376
  if self.__data.layoutFlags & self.FrameWithScales:
368
377
  scaleWidget = plot.axisWidget(axisId)
369
378
  if scaleWidget:
370
- baseLineDists[axisId] = max(scaleWidget.getContentsMargins())
379
+ mgn = scaleWidget.contentsMargins()
380
+ baseLineDists[axisId] = max(
381
+ [mgn.left(), mgn.top(), mgn.right(), mgn.bottom()]
382
+ )
371
383
  scaleWidget.setMargin(0)
372
384
  if not plot.axisEnabled(axisId):
373
385
  # When we have a scale the frame is painted on
@@ -430,7 +442,8 @@ class QwtPlotRenderer(QObject):
430
442
  for axisId in QwtPlot.AXES:
431
443
  scaleWidget = plot.axisWidget(axisId)
432
444
  if scaleWidget:
433
- baseDist = max(scaleWidget.getContentsMargins())
445
+ mgn = scaleWidget.contentsMargins()
446
+ baseDist = max([mgn.left(), mgn.top(), mgn.right(), mgn.bottom()])
434
447
  startDist, endDist = scaleWidget.getBorderDistHint()
435
448
  self.renderScale(
436
449
  plot,
@@ -552,8 +565,8 @@ class QwtPlotRenderer(QObject):
552
565
 
553
566
  :param qwt.plot.QwtPlot plot: Plot widget
554
567
  :param QPainter painter: Painter
555
- :param qwt.scale_map.QwtScaleMap maps: mapping between plot and paint device coordinates
556
568
  :param QRectF rect: Bounding rectangle
569
+ :param qwt.scale_map.QwtScaleMap maps: mapping between plot and paint device coordinates
557
570
  """
558
571
  canvas = plot.canvas()
559
572
  r = canvasRect.adjusted(0.0, 0.0, -1.0, 1.0)
@@ -721,3 +734,4 @@ class QwtPlotRenderer(QObject):
721
734
  return False
722
735
  self.renderDocument(plot, filename, sizeMM, resolution)
723
736
  return True
737
+ return True
@@ -13,9 +13,9 @@ QwtScaleMap
13
13
  :members:
14
14
  """
15
15
 
16
- from qwt._math import qwtFuzzyCompare
16
+ from qtpy.QtCore import QPointF, QRectF
17
17
 
18
- from qtpy.QtCore import QRectF, QPointF
18
+ from qwt._math import qwtFuzzyCompare
19
19
 
20
20
 
21
21
  class QwtScaleMap(object):
@@ -223,31 +223,23 @@ class QwtScaleMap(object):
223
223
 
224
224
  def transform(self, *args):
225
225
  """
226
- Transform a rectangle from scale to paint coordinates
227
-
228
- .. py:method:: transform(scalar)
229
-
230
- :param float scalar: Scalar
231
-
232
- .. py:method:: transform(xMap, yMap, rect)
226
+ Transform a rectangle from scale to paint coordinates.
233
227
 
234
- Transform a rectangle from scale to paint coordinates
228
+ Transfom a scalar:
235
229
 
236
- :param qwt.scale_map.QwtScaleMap xMap: X map
237
- :param qwt.scale_map.QwtScaleMap yMap: Y map
238
- :param QRectF rect: Rectangle in paint coordinates
230
+ :param float scalar: Scalar
239
231
 
240
- .. py:method:: transform(xMap, yMap, pos)
232
+ Transfom a rectangle:
241
233
 
242
- Transform a point from scale to paint coordinates
234
+ :param qwt.scale_map.QwtScaleMap xMap: X map
235
+ :param qwt.scale_map.QwtScaleMap yMap: Y map
236
+ :param QRectF rect: Rectangle in paint coordinates
243
237
 
244
- :param qwt.scale_map.QwtScaleMap xMap: X map
245
- :param qwt.scale_map.QwtScaleMap yMap: Y map
246
- :param QPointF pos: Position in scale coordinates
238
+ Transfom a point:
247
239
 
248
- Scalar: scalemap.transform(scalar)
249
- Point (QPointF): scalemap.transform(xMap, yMap, pos)
250
- Rectangle (QRectF): scalemap.transform(xMap, yMap, rect)
240
+ :param qwt.scale_map.QwtScaleMap xMap: X map
241
+ :param qwt.scale_map.QwtScaleMap yMap: Y map
242
+ :param QPointF pos: Position in scale coordinates
251
243
 
252
244
  .. seealso::
253
245
 
@@ -637,7 +637,10 @@ class QwtScaleWidget(QWidget):
637
637
  if self.layout() is None:
638
638
  left, top, right, bottom = 0, 0, 0, 0
639
639
  else:
640
- left, top, right, bottom = self.layout().getContentsMargins()
640
+ mgn = self.layout().contentsMargins()
641
+ left, top, right, bottom = (
642
+ mgn.left(), mgn.top(), mgn.right(), mgn.bottom()
643
+ )
641
644
  return size + QSize(left + right, top + bottom)
642
645
 
643
646
  def titleHeightForWidth(self, width):