comparison libgui/graphics/Canvas.h @ 20629:46edfbd31ad7

Fix execution of "windowbuttonmotionfcn" with uipanels (bug #46151) * Canvas.cc (Canvas::canvasMouseMoveEvent): decide here to update the currentpoint and run "windowbuttonmotionfcn" if the latter is not empty * Canvas.h: remove unused "enableCurrentPointUpdates" method and "m_updateCurrentPoint" attribute * Figure.h: declare a new private method "enableMouseTracking" * Figure.cc (Figure::Figure): use "enableMouseTracking" instead of "update" on "windowbuttonmotionfcn". * Figure.cc (Figure::update): mouse tracking is now enabled unconditionally so remove unused case "windowbuttonmotionfcn". *Figure.cc(Figure::eventNotifyAfter): enable mouse tracking on new children widgets.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Sat, 10 Oct 2015 12:21:37 +0200
parents dcfbf4c1c3c8
children
comparison
equal deleted inserted replaced
20628:3af34e1ef330 20629:46edfbd31ad7
68 const graphics_handle& handle); 68 const graphics_handle& handle);
69 69
70 virtual void toggleAxes (const graphics_handle& handle) = 0; 70 virtual void toggleAxes (const graphics_handle& handle) = 0;
71 virtual void toggleGrid (const graphics_handle& handle) = 0; 71 virtual void toggleGrid (const graphics_handle& handle) = 0;
72 virtual void autoAxes (const graphics_handle& handle) = 0; 72 virtual void autoAxes (const graphics_handle& handle) = 0;
73 void enableCurrentPointUpdates (bool on) { m_updateCurrentPoint = on; }
74 73
75 protected: 74 protected:
76 virtual void draw (const graphics_handle& handle) = 0; 75 virtual void draw (const graphics_handle& handle) = 0;
77 virtual void drawZoomBox (const QPoint& p1, const QPoint& p2) = 0; 76 virtual void drawZoomBox (const QPoint& p1, const QPoint& p2) = 0;
78 virtual void resize (int x, int y, int width, int height) = 0; 77 virtual void resize (int x, int y, int width, int height) = 0;
84 : m_handle (handle), 83 : m_handle (handle),
85 m_redrawBlocked (false), 84 m_redrawBlocked (false),
86 m_mouseMode (NoMode), 85 m_mouseMode (NoMode),
87 m_clickMode (false), 86 m_clickMode (false),
88 m_eventMask (0), 87 m_eventMask (0),
89 m_rectMode (false), 88 m_rectMode (false)
90 m_updateCurrentPoint (false)
91 { } 89 { }
92 90
93 void canvasToggleAxes (const graphics_handle& handle); 91 void canvasToggleAxes (const graphics_handle& handle);
94 void canvasToggleGrid (const graphics_handle& handle); 92 void canvasToggleGrid (const graphics_handle& handle);
95 void canvasAutoAxes (const graphics_handle& handle); 93 void canvasAutoAxes (const graphics_handle& handle);
120 QPoint m_mouseAnchor; 118 QPoint m_mouseAnchor;
121 QPoint m_mouseCurrent; 119 QPoint m_mouseCurrent;
122 graphics_handle m_mouseAxes; 120 graphics_handle m_mouseAxes;
123 int m_eventMask; 121 int m_eventMask;
124 bool m_rectMode; 122 bool m_rectMode;
125 bool m_updateCurrentPoint;
126 }; 123 };
127 124
128 }; // namespace QtHandles 125 }; // namespace QtHandles
129 126
130 #endif 127 #endif