PythonQwt 0.10.4__py2.py3-none-any.whl → 0.10.6__py2.py3-none-any.whl

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 (42) hide show
  1. {PythonQwt-0.10.4.dist-info → PythonQwt-0.10.6.dist-info}/METADATA +1 -1
  2. {PythonQwt-0.10.4.dist-info → PythonQwt-0.10.6.dist-info}/RECORD +42 -34
  3. qwt/__init__.py +1 -1
  4. qwt/dyngrid_layout.py +5 -3
  5. qwt/graphic.py +6 -13
  6. qwt/legend.py +9 -7
  7. qwt/painter.py +15 -31
  8. qwt/plot.py +86 -134
  9. qwt/plot_canvas.py +12 -14
  10. qwt/plot_layout.py +8 -2
  11. qwt/plot_renderer.py +37 -23
  12. qwt/scale_map.py +13 -21
  13. qwt/scale_widget.py +4 -1
  14. qwt/symbol.py +15 -18
  15. qwt/tests/data/basesymbol.png +0 -0
  16. qwt/tests/data/bodedemo.png +0 -0
  17. qwt/tests/data/builtinsymbol.png +0 -0
  18. qwt/tests/data/curvebenchmark1.png +0 -0
  19. qwt/tests/data/curvebenchmark2.png +0 -0
  20. qwt/tests/data/data.png +0 -0
  21. qwt/tests/data/graphic.png +0 -0
  22. qwt/tests/data/image.png +0 -0
  23. qwt/tests/data/loadtest.png +0 -0
  24. qwt/tests/data/mapdemo.png +0 -0
  25. qwt/tests/data/path.png +0 -0
  26. qwt/tests/data/pixmap.png +0 -0
  27. qwt/tests/data/simple.png +0 -0
  28. qwt/tests/data/svgdocument.png +0 -0
  29. qwt/tests/data/symbol.svg +411 -0
  30. qwt/tests/data/testlauncher.png +0 -0
  31. qwt/tests/test_bodedemo.py +43 -24
  32. qwt/tests/test_curvebenchmark1.py +12 -10
  33. qwt/tests/test_curvebenchmark2.py +1 -1
  34. qwt/tests/test_loadtest.py +4 -4
  35. qwt/tests/test_simple.py +15 -2
  36. qwt/tests/test_symbols.py +201 -0
  37. qwt/tests/utils.py +17 -8
  38. qwt/text.py +13 -10
  39. {PythonQwt-0.10.4.dist-info → PythonQwt-0.10.6.dist-info}/LICENSE +0 -0
  40. {PythonQwt-0.10.4.dist-info → PythonQwt-0.10.6.dist-info}/WHEEL +0 -0
  41. {PythonQwt-0.10.4.dist-info → PythonQwt-0.10.6.dist-info}/entry_points.txt +0 -0
  42. {PythonQwt-0.10.4.dist-info → PythonQwt-0.10.6.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PythonQwt
3
- Version: 0.10.4
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,78 +1,86 @@
1
- qwt/__init__.py,sha256=KtaS7yoAuV0dieZcZhp7CxEUCiTsTUoJpFP1-t4I474,5800
1
+ qwt/__init__.py,sha256=CklnpMd6ZslJAB9_HCKOfGSaBDBVmP6E51kpQwpGo7Q,5800
2
2
  qwt/_math.py,sha256=Xut9qwwwnzykC5YV2H3h9F4W9z8jv61ckPtMt941hVQ,1584
3
3
  qwt/color_map.py,sha256=LkeEyZcZ60rfceZ-G6YwuY6ljjBoDfYr9NDJtX_hqGE,11824
4
4
  qwt/column_symbol.py,sha256=gY57VFgmLo0JwT-7AK7ITli61WzUAdQptQTcYHQbUdo,5720
5
- qwt/dyngrid_layout.py,sha256=QHbyVX1Y4YAuTaPhlxL2AXluLD8-L521N-Y22bzfY-M,13367
6
- qwt/graphic.py,sha256=hPnjRF08foEsUW1i1UVe-t_jDIqjWWL7No5_c_ebH3M,28446
5
+ qwt/dyngrid_layout.py,sha256=cakSak1zfqucK6ULe1eWdBgOhfQA9sCmkJXwpo_458U,13433
6
+ qwt/graphic.py,sha256=f6IcwY5uxJ3v13xvG0aaF8b8puyuLlB9Yy_ukw6Syj0,28051
7
7
  qwt/interval.py,sha256=PMrCQxV9NXGk2JG0MNjJ3zGTNTSSRfa_noxbpm-Okns,12287
8
- qwt/legend.py,sha256=N455HProPp7mbFrBls5bqCP0q2qblSg4NxM6hU5E6i4,31082
8
+ qwt/legend.py,sha256=mEssQrvFmldRNH7I4rCmDtdK30enH1Nwwq0LgGsDZ-w,31236
9
9
  qwt/null_paintdevice.py,sha256=09zYxGLCkdlRhP4hbNIUz4RzEr1Rteso2Ex55PqOEWA,9136
10
- qwt/painter.py,sha256=E3QeJwrn7cS5aCS5mV9QrkwHqv5U_ZYZcnrhur4I-0k,19343
10
+ qwt/painter.py,sha256=su89df7OzEzH23ImahH2F_mhG_oDThHuBGvDIP8rPO0,18652
11
11
  qwt/painter_command.py,sha256=WMHeAWn5ngsmX8hoIVgICTaD1YPYWzGnfUvy0OVO9wA,6955
12
- qwt/plot.py,sha256=y-rF3x_ulwAvI6k1amJ0-2tpvOMlCt8_AfHFVFp803g,76213
13
- qwt/plot_canvas.py,sha256=eXFnJ26e_Bbo6jf1qwRRShRqUo16rDgOmGDcIBErvhM,30850
12
+ qwt/plot.py,sha256=O0S5MRcYZNB5bIgXxyZnLBksuitMLa5DBeRcW3fRNwU,74910
13
+ qwt/plot_canvas.py,sha256=biNd-JWUAbwFF1uLW0Yg9sWQ-Eoofdj37qKpp7MrlBo,30791
14
14
  qwt/plot_curve.py,sha256=6B3MAPN9-aethy8eqZo4ADtlSBrQO9ggY1z0JkvoKxQ,37270
15
15
  qwt/plot_directpainter.py,sha256=TrgiFLdHu2DH-V_aOfH4DQawTaZUaS3EZxTQ-eWRyJc,10537
16
16
  qwt/plot_grid.py,sha256=w4bJhR5VDvoXF0dwjcejYIF6t5nZz7vG1Jdq5g3h_1c,16563
17
- qwt/plot_layout.py,sha256=FhQVYDtvsuvJJqhUAcBbGUt4uUBQZ_N7UrZEvJUrzjk,45829
17
+ qwt/plot_layout.py,sha256=4efiyTSMkw1lW3XuOtQWGjUvkgWh8ybOV3VT_klqZjw,46027
18
18
  qwt/plot_marker.py,sha256=ADrdoYaaRqTiyHt3ypAX_9CQvRPyE6GV3Vrm-6K2m88,21272
19
- qwt/plot_renderer.py,sha256=Tf5aHc3mCs7YlClBEsyXozoMAMenxtt24MHJ7gOUklQ,26663
19
+ qwt/plot_renderer.py,sha256=I4YvEDgA2CTEDq6bj_ptGI214R-QAc184Yp_x7yA-Cg,27166
20
20
  qwt/plot_series.py,sha256=H-fUfw-0Edfrn8PIpaRQ1T1yqrHMuMDcNJffrM61aHE,11043
21
21
  qwt/qthelpers.py,sha256=koM5xFt2WQCG4JZyu96AdSB4END_CoFn4ivd1rVXcnU,1585
22
22
  qwt/scale_div.py,sha256=pZmsg-PIof3yAeLTfiFMC3tMvNSSMHomkYWnAe3eEjw,9276
23
23
  qwt/scale_draw.py,sha256=V2sYXOdMN7PF-6oYpJs6XDt8fgXsApj3YUswE-cjGfA,37720
24
24
  qwt/scale_engine.py,sha256=2eA491abgPpcIBarszCFSk3IQTy8vGvATDzjzRm6ewo,29070
25
- qwt/scale_map.py,sha256=pw3FHwrxilof9kdkPSHmrbp_HA96eRWF7apZlPwSPvM,9576
26
- qwt/scale_widget.py,sha256=XPD0hvB91pQGkRH9czd-YFhuZiNAC7Q1MdhSmjdx-U4,26978
27
- qwt/symbol.py,sha256=Op-8_A7FpwIncsORTsbmV8abLhovzYN9AV9dIIeCiN4,41434
28
- qwt/text.py,sha256=MenZcme72HH_7O5fsYqdlFJGyNmUGDBXhugGtgH2_EA,41977
25
+ qwt/scale_map.py,sha256=WobkNna6_RPXYZjGK7gZLykNxN_kYnrcB6fEaWgnL2w,9182
26
+ qwt/scale_widget.py,sha256=L5QbEM5E26bd50JD8mMdKrjO_x2ovzopzrulTfjOd1Q,27077
27
+ qwt/symbol.py,sha256=3kcS0cszZiJwcWK_Nj86b8rfAtYYChmaQ-gSohK0GJY,41347
28
+ qwt/text.py,sha256=Z3qg6HBKqgCuTPhJ4VpKTqUBGbLtbPMJ-UBI9V6DAGI,42074
29
29
  qwt/toqimage.py,sha256=XBd1qYgv_FqqmP7BNIWP_5pGDqIwQLUa7Giuj1voEmg,1725
30
30
  qwt/transform.py,sha256=XgKuvG5odsjBObwDaPYOnM1QVidFFIPaKDPiCl_fg1E,6001
31
31
  qwt/tests/__init__.py,sha256=hdqKy7NmYU1UX6Nv0-WNLeq84BjglHtAWdtnd2K5U28,1117
32
32
  qwt/tests/comparative_benchmarks.py,sha256=unAmhNvIo-BexOX0UfsJo7v5_SrBXlEyCJ6SRfgZP6E,1883
33
33
  qwt/tests/conftest.py,sha256=JHMXAgmHphJ8hWXjqVBBLxe0XlRb3rKOu9GRKVbcr_A,272
34
- qwt/tests/test_bodedemo.py,sha256=s_rd0OTTQGWhXyQjmNZXaDgxB1xfPxOsClVt04JmTmg,9304
34
+ qwt/tests/test_bodedemo.py,sha256=_ya6NroUuvGs0BaUcAGn8Adp0ek90JTDevfqN9ew_LE,9691
35
35
  qwt/tests/test_cartesian.py,sha256=8rA4CgZ8M73-AmOgLDERuW9-3rjD8jVumcV96LPhSbM,3966
36
36
  qwt/tests/test_cpudemo.py,sha256=uT6KRnDupH3LAC9U0CM6yUf346VH_CGX6xPpLpjwogo,13196
37
- qwt/tests/test_curvebenchmark1.py,sha256=8dmfLznqbSvTP0eNKpBwgwMdyjEgt6fHErDO3UcYXkc,6075
38
- qwt/tests/test_curvebenchmark2.py,sha256=NrrJTuCGXgtfiUxciT0j3ZbsNVT_kmoqgs0BYTTssmQ,2888
37
+ qwt/tests/test_curvebenchmark1.py,sha256=8aT3tjm6VyzIhEtPPNdILZhGoS1uXVhtgCUFTwfA3nY,6200
38
+ qwt/tests/test_curvebenchmark2.py,sha256=QQDnQQdlW3VDDNlkchdqDrPqGomdy83Ae9sGt5Wojn8,2900
39
39
  qwt/tests/test_curvedemo1.py,sha256=P_Dz4ZaH_Nw7cO2EHKz2NKiuGuBGfBtCr22W8N82uc8,4311
40
40
  qwt/tests/test_curvedemo2.py,sha256=xh25WN3Wayh8QF2Rh4GCSVI6M3Q50QqymgkEB5XdF78,4233
41
41
  qwt/tests/test_data.py,sha256=Qj_sNJHd0o3UF6CI_d-jo5KWLt2bEJzpwF7SRyPm98M,3255
42
42
  qwt/tests/test_errorbar.py,sha256=WRGm3YqyuC0P8OlC77Zpk1-v6HlgTkNTAyfQREJYrd8,11021
43
43
  qwt/tests/test_eventfilter.py,sha256=hzjZhms1pDg_7RTMXj9O7uYW9Qy1ec_9qVRyX0fi83Q,16927
44
44
  qwt/tests/test_image.py,sha256=1lgyBRmy98RYCFh4IR4Z2Wxe0f5l6H-UiKtI2hO2Amo,6755
45
- qwt/tests/test_loadtest.py,sha256=4Ge0-S70v_0eBX4CJYky3-IPjm97Tm4iLZUAoUuc8D8,1845
45
+ qwt/tests/test_loadtest.py,sha256=B1pqFfYgmpgOpFYAxHmM-IJccLU_Fr2gK-1DG9wbHeM,1915
46
46
  qwt/tests/test_logcurve.py,sha256=oPmaqSWmAvO38aXUAuvWI7SeWqAGNdXYE2l7mJ6iPvQ,1169
47
47
  qwt/tests/test_mapdemo.py,sha256=Dilldf16_PToTUgsvLV2oBetCPsriGoSNQa8ceueIPk,3529
48
48
  qwt/tests/test_multidemo.py,sha256=FqPB8GKALwon42_EifyB5Fa7nQkawKkGh0Jb2Tkrx7Q,2611
49
- qwt/tests/test_simple.py,sha256=jHIGqQltIs2EZj8bAooJ-VrHf9EHyMwpo6cHVSo2CwM,1934
49
+ qwt/tests/test_simple.py,sha256=JSh4b59RHLSiyIPQi6NLEVdsmZPZywndeuk87NCCi4M,2342
50
50
  qwt/tests/test_stylesheet.py,sha256=xpb5S3PLjOTFy1xq94RYIpUqWvfoIr5Qt1o5oEcmiMA,764
51
+ qwt/tests/test_symbols.py,sha256=scPrQmUTd5m7HY7kYP_hCANyqRs51xTeONVTo1n0YKE,5798
51
52
  qwt/tests/test_vertical.py,sha256=15ohX935KDB1Ze7QpDiJcusnMVc1wOiLMKBEA7Dd3s8,4183
52
- qwt/tests/utils.py,sha256=p09KDxZC4zM6iTPLf2ifpzY9kgp_neVy1l_UgqFgbJo,10496
53
+ qwt/tests/utils.py,sha256=cZ_qBvLbK2MoH_ZcZfOqYQeWJ3tTMN6fLYwatIF6448,10810
53
54
  qwt/tests/data/PythonQwt.svg,sha256=t-NYdVPqz7BcqtXNWCJvo8udrRmtGh57ksSYWUl1h4o,15232
54
- qwt/tests/data/bodedemo.png,sha256=8jP1YLE6HdwjEmrQyJclLxiYI4Zs4t0z0BoN1JT3GPQ,24414
55
+ qwt/tests/data/basesymbol.png,sha256=dTXegLKruQ4D5IZL3eEAWw1nUdN06KIyPjQWip9AIfI,7167
56
+ qwt/tests/data/bodedemo.png,sha256=RnYYEP3vcfFEceU1rtml-V2OgVXx4RSiJ4gWpcETpME,24441
57
+ qwt/tests/data/builtinsymbol.png,sha256=pb1BBkWcqk8CfyZyhWSIpcOUKGJH27ItvNC0hbXytxw,55307
55
58
  qwt/tests/data/cartesian.png,sha256=Cwbn5Jy3VT-OisFHxzMCVbfdbJacUMZ9uGCD9sCxA-Q,51094
56
59
  qwt/tests/data/cpudemo.png,sha256=1sy4hkiT3J7rs0FHQoFNnHtqEzFsP888Cfq27GY-pJI,30241
57
- qwt/tests/data/curvebenchmark1.png,sha256=a6skUJGNEFhL0kbJAM2Mhs6NpTKav1gJbcsRx4NSfbQ,40992
58
- qwt/tests/data/curvebenchmark2.png,sha256=L9vgabmzewWLCtlsHg1zzoEylHxpJ6bbz3yj2_4nTuI,126537
60
+ qwt/tests/data/curvebenchmark1.png,sha256=Fp_OWHT8bBufG-R7v8dGrcc7fEg19tWrpgE-ywcdYvk,59171
61
+ qwt/tests/data/curvebenchmark2.png,sha256=CqOZsZzWvIXzALzntYf8PChQAw1vV6mDzhG4CckfgaQ,126528
59
62
  qwt/tests/data/curvedemo1.png,sha256=PPYNtnxWdoqsxK3QXo615H-aRTYb71zLyuMEAsZhooc,13908
60
63
  qwt/tests/data/curvedemo2.png,sha256=1rnIMEEJCFjYic1wNGP1oyATUt_8VirB7O4PyHPeUfw,8909
61
- qwt/tests/data/data.png,sha256=NNPnE0PZfRC7dNse1Ia4P3n1rM_ADRfCvXA4I10nLOk,15940
64
+ qwt/tests/data/data.png,sha256=xBD82U2a8gmc8cCDIR4_WeDFZE5nq7oIwvcgvKeCyBg,16179
62
65
  qwt/tests/data/errorbar.png,sha256=zqD2aPwPqTm18VuoLAUQPUnSgJfr-NTviPJXm4oLwco,13696
63
66
  qwt/tests/data/eventfilter.png,sha256=CUgvSZcoADX_DwW5Lmq_iSMNc7L4Jfk16tXsNexG3ew,9199
64
- qwt/tests/data/image.png,sha256=Pdz4mMGzzAOTbdKQBwnBscc4JwJxr3dWlUX4yOUCGjg,57728
65
- qwt/tests/data/loadtest.png,sha256=PmeAPBsKx38rKeHjuyF4CDM7pg4CcI4F_juKv_BBFL8,128560
67
+ qwt/tests/data/graphic.png,sha256=vkOFucftBmCVqCcQj3GwIadvhmRpVLXMnOv79zWbBhw,9148
68
+ qwt/tests/data/image.png,sha256=Bki5gBbfyOBVvEWcurCK5EaZ2--vf7bL6rt5ElnCr9E,57730
69
+ qwt/tests/data/loadtest.png,sha256=KHt--3OCe_z0oaa9KN-ZsBEIAXnl-c84_RNBugfGfcQ,127864
66
70
  qwt/tests/data/logcurve.png,sha256=aH9grJlKXUjOjgGO0PVrzTpvXA9Kb6DtU-EL_O8ia_U,16633
67
- qwt/tests/data/mapdemo.png,sha256=S2xvGNvoTgukvrqWTOIpPQQVtAsWeyFbUkoG4-Wq_TU,19713
71
+ qwt/tests/data/mapdemo.png,sha256=LxQ3uk4ZxJ0bxUfbpCZjI33fINtBRsOV78D6mcdc35k,21828
68
72
  qwt/tests/data/multidemo.png,sha256=1nthNyuxz6H_SIKjLdoyS-X-mxOWlW_nxRzRe2V2M5A,8805
69
- qwt/tests/data/simple.png,sha256=78MdmZfA4F4tyjnvEw0jWD5wh5OEK1LjUb_Mxo7QHok,15709
73
+ qwt/tests/data/path.png,sha256=Uw1V2dkV36e8VqwTe9H6As8bR1TdWnlIU3cOGUPROKk,7897
74
+ qwt/tests/data/pixmap.png,sha256=oKVwNB1Al1UFEykceVAUw7I5Sor1YnB0dFMxdJNy-hg,10784
75
+ qwt/tests/data/simple.png,sha256=sBY1nBfHuxtpMvaMDRAQwxbSauvk5OY7XnICwFj8CxQ,15697
70
76
  qwt/tests/data/stylesheet.png,sha256=ZjWURAS_eYB5cyLmkQrUg7bTSv-V3uIm6q8FGQjGnFc,13160
71
- qwt/tests/data/testlauncher.png,sha256=lb6rUnlpY1Q-rezdG6gAtWMWwY5PX58Zuq6338bI8kY,110858
77
+ qwt/tests/data/svgdocument.png,sha256=i8Y_PEnjV-iGW6oZ_oNsjS1ECbJVdP2is14zT0z0TrY,9275
78
+ qwt/tests/data/symbol.svg,sha256=ONkkohVqpg3OO2-XEZge7UZLqqNyOQXbSpLgHXcTBFU,12795
79
+ qwt/tests/data/testlauncher.png,sha256=EYwQk3dtMepxN44U1YcR7LeyYsO7jXbu3KVyQnDcwts,117589
72
80
  qwt/tests/data/vertical.png,sha256=EvyG6q6rZm6pTT08Y_nzdBYCnqmoX1QDuEQtp2pyGlw,34076
73
- PythonQwt-0.10.4.dist-info/LICENSE,sha256=qjEk8TRuXmFS7QC-omINvD1UPGqWaOs6CzcCZoMEhdI,33457
74
- PythonQwt-0.10.4.dist-info/METADATA,sha256=UF-RXk3Z0zncgGNjCOtluEU6ZXXeKen7oHyNAYGJfnI,3317
75
- PythonQwt-0.10.4.dist-info/WHEEL,sha256=a-zpFRIJzOq5QfuhBzbhiA1eHTzNCJn8OdRvhdNX0Rk,110
76
- PythonQwt-0.10.4.dist-info/entry_points.txt,sha256=wSH-OHXrA7c0ymhYRcBFLhBsMqOiw9gofXVe_5UIBYA,107
77
- PythonQwt-0.10.4.dist-info/top_level.txt,sha256=KB1IBdWRWnaItyJMaECwZiEi1jWt3IvqCrRVVhMjTu8,4
78
- PythonQwt-0.10.4.dist-info/RECORD,,
81
+ PythonQwt-0.10.6.dist-info/LICENSE,sha256=qjEk8TRuXmFS7QC-omINvD1UPGqWaOs6CzcCZoMEhdI,33457
82
+ PythonQwt-0.10.6.dist-info/METADATA,sha256=HnAHJuZfVLENSh0CLu9HT9UrqVPXBasdgmBJwCaoHaA,3317
83
+ PythonQwt-0.10.6.dist-info/WHEEL,sha256=a-zpFRIJzOq5QfuhBzbhiA1eHTzNCJn8OdRvhdNX0Rk,110
84
+ PythonQwt-0.10.6.dist-info/entry_points.txt,sha256=wSH-OHXrA7c0ymhYRcBFLhBsMqOiw9gofXVe_5UIBYA,107
85
+ PythonQwt-0.10.6.dist-info/top_level.txt,sha256=KB1IBdWRWnaItyJMaECwZiEi1jWt3IvqCrRVVhMjTu8,4
86
+ PythonQwt-0.10.6.dist-info/RECORD,,
qwt/__init__.py CHANGED
@@ -27,7 +27,7 @@ External resources:
27
27
  .. _GitHub: https://github.com/PlotPyStack/PythonQwt
28
28
  """
29
29
 
30
- __version__ = "0.10.4"
30
+ __version__ = "0.10.6"
31
31
  QWT_VERSION_STR = "6.1.5"
32
32
 
33
33
  import warnings
qwt/dyngrid_layout.py CHANGED
@@ -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:
qwt/graphic.py CHANGED
@@ -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()
qwt/legend.py CHANGED
@@ -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(),
qwt/painter.py CHANGED
@@ -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())
qwt/plot.py CHANGED
@@ -21,34 +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
45
-
46
-
47
- def qwtEnableLegendItems(plot, on):
48
- if on:
49
- plot.legendDataChanged.connect(plot.updateLegendItems)
50
- else:
51
- plot.legendDataChanged.disconnect(plot.updateLegendItems)
37
+ from qwt.scale_widget import QwtScaleWidget
38
+ from qwt.text import QwtText, QwtTextLabel
52
39
 
53
40
 
54
41
  def qwtSetTabOrder(first, second, with_children):
@@ -88,111 +75,10 @@ class ItemList(list):
88
75
  self.sortItems()
89
76
 
90
77
 
91
- class QwtPlotDict_PrivateData(object):
92
- def __init__(self):
93
- self.itemList = ItemList()
94
- self.autoDelete = True
95
-
96
-
97
- class QwtPlotDict(object):
98
- """
99
- A dictionary for plot items
100
-
101
- `QwtPlotDict` organizes plot items in increasing z-order.
102
- If `autoDelete()` is enabled, all attached items will be deleted
103
- in the destructor of the dictionary.
104
- `QwtPlotDict` can be used to get access to all `QwtPlotItem` items - or
105
- all items of a specific type - that are currently on the plot.
106
-
107
- .. seealso::
108
-
109
- :py:meth:`QwtPlotItem.attach()`, :py:meth:`QwtPlotItem.detach()`,
110
- :py:meth:`QwtPlotItem.z()`
111
- """
112
-
113
- def __init__(self):
114
- self.__data = QwtPlotDict_PrivateData()
115
-
116
- def setAutoDelete(self, autoDelete):
117
- """
118
- En/Disable Auto deletion
119
-
120
- If Auto deletion is on all attached plot items will be deleted
121
- in the destructor of `QwtPlotDict`. The default value is on.
122
-
123
- :param bool autoDelete: enable/disable
124
-
125
- .. seealso::
126
-
127
- :py:meth:`autoDelete()`, :py:meth:`insertItem()`
128
- """
129
- self.__data.autoDelete = autoDelete
130
-
131
- def autoDelete(self):
132
- """
133
- :return: true if auto deletion is enabled
134
-
135
- .. seealso::
136
-
137
- :py:meth:`setAutoDelete()`, :py:meth:`insertItem()`
138
- """
139
- return self.__data.autoDelete
140
-
141
- def insertItem(self, item):
142
- """
143
- Insert a plot item
144
-
145
- :param qwt.plot.QwtPlotItem item: PlotItem
146
-
147
- .. seealso::
148
-
149
- :py:meth:`removeItem()`
150
- """
151
- self.__data.itemList.insertItem(item)
152
-
153
- def removeItem(self, item):
154
- """
155
- Remove a plot item
156
-
157
- :param qwt.plot.QwtPlotItem item: PlotItem
158
-
159
- .. seealso::
160
-
161
- :py:meth:`insertItem()`
162
- """
163
- self.__data.itemList.removeItem(item)
164
-
165
- def detachItems(self, rtti=None):
166
- """
167
- Detach items from the dictionary
168
-
169
- :param rtti: In case of `QwtPlotItem.Rtti_PlotItem` or None (default) detach all items otherwise only those items of the type rtti.
170
- :type rtti: int or None
171
- """
172
- for item in self.__data.itemList[:]:
173
- if rtti in (None, QwtPlotItem.Rtti_PlotItem) or item.rtti() == rtti:
174
- item.attach(None)
175
-
176
- def itemList(self, rtti=None):
177
- """
178
- A list of attached plot items.
179
-
180
- Use caution when iterating these lists, as removing/detaching an
181
- item will invalidate the iterator. Instead you can place pointers
182
- to objects to be removed in a removal list, and traverse that list
183
- later.
184
-
185
- :param int rtti: In case of `QwtPlotItem.Rtti_PlotItem` detach all items otherwise only those items of the type rtti.
186
- :return: List of all attached plot items of a specific type. If rtti is None, return a list of all attached plot items.
187
- """
188
- if rtti is None or rtti == QwtPlotItem.Rtti_PlotItem:
189
- return self.__data.itemList
190
- return [item for item in self.__data.itemList if item.rtti() == rtti]
191
-
192
-
193
- class QwtPlot_PrivateData(QwtPlotDict_PrivateData):
78
+ class QwtPlot_PrivateData(object):
194
79
  def __init__(self):
195
80
  super(QwtPlot_PrivateData, self).__init__()
81
+ self.itemList = ItemList()
196
82
  self.titleLabel = None
197
83
  self.footerLabel = None
198
84
  self.canvas = None
@@ -217,7 +103,7 @@ class AxisData(object):
217
103
  self.scaleWidget = None # QwtScaleWidget
218
104
 
219
105
 
220
- class QwtPlot(QwtPlotDict, QFrame):
106
+ class QwtPlot(QFrame):
221
107
  """
222
108
  A 2-D plotting widget
223
109
 
@@ -300,7 +186,6 @@ class QwtPlot(QwtPlotDict, QFrame):
300
186
  "%s() takes 0, 1 or 2 argument(s) (%s given)"
301
187
  % (self.__class__.__name__, len(args))
302
188
  )
303
- QwtPlotDict.__init__(self)
304
189
  QFrame.__init__(self, parent)
305
190
 
306
191
  self.__layout_state = None
@@ -359,7 +244,74 @@ class QwtPlot(QwtPlotDict, QFrame):
359
244
  for idx in range(len(focusChain) - 1):
360
245
  qwtSetTabOrder(focusChain[idx], focusChain[idx + 1], False)
361
246
 
362
- qwtEnableLegendItems(self, True)
247
+ self.legendDataChanged.connect(self.updateLegendItems)
248
+
249
+ def insertItem(self, item):
250
+ """
251
+ Insert a plot item
252
+
253
+ :param qwt.plot.QwtPlotItem item: PlotItem
254
+
255
+ .. seealso::
256
+
257
+ :py:meth:`removeItem()`
258
+
259
+ .. note::
260
+
261
+ This was a member of QwtPlotDict in older versions.
262
+ """
263
+ self.__data.itemList.insertItem(item)
264
+
265
+ def removeItem(self, item):
266
+ """
267
+ Remove a plot item
268
+
269
+ :param qwt.plot.QwtPlotItem item: PlotItem
270
+
271
+ .. seealso::
272
+
273
+ :py:meth:`insertItem()`
274
+
275
+ .. note::
276
+
277
+ This was a member of QwtPlotDict in older versions.
278
+ """
279
+ self.__data.itemList.removeItem(item)
280
+
281
+ def detachItems(self, rtti=None):
282
+ """
283
+ Detach items from the dictionary
284
+
285
+ :param rtti: In case of `QwtPlotItem.Rtti_PlotItem` or None (default) detach all items otherwise only those items of the type rtti.
286
+ :type rtti: int or None
287
+
288
+ .. note::
289
+
290
+ This was a member of QwtPlotDict in older versions.
291
+ """
292
+ for item in self.__data.itemList[:]:
293
+ if rtti in (None, QwtPlotItem.Rtti_PlotItem) or item.rtti() == rtti:
294
+ item.attach(None)
295
+
296
+ def itemList(self, rtti=None):
297
+ """
298
+ A list of attached plot items.
299
+
300
+ Use caution when iterating these lists, as removing/detaching an
301
+ item will invalidate the iterator. Instead you can place pointers
302
+ to objects to be removed in a removal list, and traverse that list
303
+ later.
304
+
305
+ :param int rtti: In case of `QwtPlotItem.Rtti_PlotItem` detach all items otherwise only those items of the type rtti.
306
+ :return: List of all attached plot items of a specific type. If rtti is None, return a list of all attached plot items.
307
+
308
+ .. note::
309
+
310
+ This was a member of QwtPlotDict in older versions.
311
+ """
312
+ if rtti is None or rtti == QwtPlotItem.Rtti_PlotItem:
313
+ return self.__data.itemList
314
+ return [item for item in self.__data.itemList if item.rtti() == rtti]
363
315
 
364
316
  def setFlatStyle(self, state):
365
317
  """
@@ -1573,9 +1525,9 @@ class QwtPlot(QwtPlotDict, QFrame):
1573
1525
  if self.__data.legend.parent() is not self:
1574
1526
  self.__data.legend.setParent(self)
1575
1527
 
1576
- qwtEnableLegendItems(self, False)
1528
+ self.blockSignals(True)
1577
1529
  self.updateLegend()
1578
- qwtEnableLegendItems(self, True)
1530
+ self.blockSignals(False)
1579
1531
 
1580
1532
  lpos = self.__data.layout.legendPosition()
1581
1533
 
@@ -1686,7 +1638,7 @@ class QwtPlot(QwtPlotDict, QFrame):
1686
1638
  renderer.renderTo(self, printer)
1687
1639
 
1688
1640
  def exportTo(
1689
- 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
1690
1642
  ):
1691
1643
  """
1692
1644
  Export plot to PDF or image file (SVG, PNG, ...)
@@ -1694,7 +1646,7 @@ class QwtPlot(QwtPlotDict, QFrame):
1694
1646
  :param str filename: Filename
1695
1647
  :param tuple size: (width, height) size in pixels
1696
1648
  :param tuple size_mm: (width, height) size in millimeters
1697
- :param float resolution: Image resolution
1649
+ :param int resolution: Resolution in dots per Inch (dpi)
1698
1650
  :param str format_: File format (PDF, SVG, PNG, ...)
1699
1651
  """
1700
1652
  if size_mm is None:
qwt/plot_canvas.py CHANGED
@@ -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(