Commit 7d7014d
authored
Fix: legend now showing up when enabled later
In our code base we had code which does:
1. Create a plot
2. Attach a curve
3. Enable legend
This worked in Qwt 5, but with PythonQwt the legend was not showing up. Switching the order of 2 and 3 caused the legend to then appear.
Debugging I found out blocking signals around `updateLegend` inside `insertLegend` was the culprit. The original source code [does not block signals](https://sourceforge.net/p/qwt/code/HEAD/tree/trunk/qwt/src/qwt_plot.cpp#l943), but calls [`qwtEnableLegendItems`](https://sourceforge.net/p/qwt/code/HEAD/tree/trunk/qwt/src/qwt_plot.cpp#l27), which only disconnects/connects `updateLegendItems`.
Doing the same here fixed the issue: now enabling the legend in a plot which already has curves causes the legend to appear correctly.1 parent 35c9fc2 commit 7d7014d
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1560 | 1560 | | |
1561 | 1561 | | |
1562 | 1562 | | |
1563 | | - | |
| 1563 | + | |
1564 | 1564 | | |
1565 | | - | |
| 1565 | + | |
1566 | 1566 | | |
1567 | 1567 | | |
1568 | 1568 | | |
| |||
0 commit comments