Mercurial > hg > octave-nkf
comparison libgui/graphics/ContextMenu.cc @ 19121:dbb207d10d7c
eliminate some shadowed variable declaration warnings
* BaseControl.cc, Container.cc, ContextMenu.cc, Figure.cc,
FigureWindow.cc, GLCanvas.cc, GenericEventNotify.h, Menu.cc,
MouseModeActionGroup.cc, Panel.cc, TextEdit.cc, TextEdit.h,
ToolBar.cc: Avoid shadowed variable declaration warnings.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 17 Jul 2014 10:27:24 -0400 |
parents | dff05c124017 |
children | 2f4406e9dad6 |
comparison
equal
deleted
inserted
replaced
19120:f1edad3b4106 | 19121:dbb207d10d7c |
---|---|
33 namespace QtHandles | 33 namespace QtHandles |
34 { | 34 { |
35 | 35 |
36 ContextMenu* ContextMenu::create (const graphics_object& go) | 36 ContextMenu* ContextMenu::create (const graphics_object& go) |
37 { | 37 { |
38 Object* parent = Object::parentObject (go); | 38 Object* xparent = Object::parentObject (go); |
39 | 39 |
40 if (parent) | 40 if (xparent) |
41 { | 41 { |
42 QWidget* w = parent->qWidget<QWidget> (); | 42 QWidget* w = xparent->qWidget<QWidget> (); |
43 | 43 |
44 return new ContextMenu (go, new QMenu (w)); | 44 return new ContextMenu (go, new QMenu (w)); |
45 } | 45 } |
46 | 46 |
47 return 0; | 47 return 0; |
48 } | 48 } |
49 | 49 |
50 ContextMenu::ContextMenu (const graphics_object& go, QMenu* menu) | 50 ContextMenu::ContextMenu (const graphics_object& go, QMenu* xmenu) |
51 : Object (go, menu) | 51 : Object (go, xmenu) |
52 { | 52 { |
53 menu->setAutoFillBackground (true); | 53 xmenu->setAutoFillBackground (true); |
54 | 54 |
55 connect (menu, SIGNAL (aboutToShow (void)), SLOT (aboutToShow (void))); | 55 connect (xmenu, SIGNAL (aboutToShow (void)), SLOT (aboutToShow (void))); |
56 connect (menu, SIGNAL (aboutToHide (void)), SLOT (aboutToHide (void))); | 56 connect (xmenu, SIGNAL (aboutToHide (void)), SLOT (aboutToHide (void))); |
57 } | 57 } |
58 | 58 |
59 ContextMenu::~ContextMenu (void) | 59 ContextMenu::~ContextMenu (void) |
60 { | 60 { |
61 } | 61 } |
62 | 62 |
63 void ContextMenu::update (int pId) | 63 void ContextMenu::update (int pId) |
64 { | 64 { |
65 uicontextmenu::properties& up = properties<uicontextmenu> (); | 65 uicontextmenu::properties& up = properties<uicontextmenu> (); |
66 QMenu* menu = qWidget<QMenu> (); | 66 QMenu* xmenu = qWidget<QMenu> (); |
67 | 67 |
68 switch (pId) | 68 switch (pId) |
69 { | 69 { |
70 case base_properties::ID_VISIBLE: | 70 case base_properties::ID_VISIBLE: |
71 if (up.is_visible ()) | 71 if (up.is_visible ()) |
72 { | 72 { |
73 Matrix pos = up.get_position ().matrix_value (); | 73 Matrix pos = up.get_position ().matrix_value (); |
74 QWidget* parentW = menu->parentWidget (); | 74 QWidget* parentW = xmenu->parentWidget (); |
75 QPoint pt; | 75 QPoint pt; |
76 | 76 |
77 pt.rx () = xround (pos(0)); | 77 pt.rx () = xround (pos(0)); |
78 pt.ry () = parentW->height () - xround (pos(1)); | 78 pt.ry () = parentW->height () - xround (pos(1)); |
79 pt = parentW->mapToGlobal (pt); | 79 pt = parentW->mapToGlobal (pt); |
80 | 80 |
81 menu->popup (pt); | 81 xmenu->popup (pt); |
82 } | 82 } |
83 else | 83 else |
84 menu->hide (); | 84 xmenu->hide (); |
85 break; | 85 break; |
86 default: | 86 default: |
87 Object::update (pId); | 87 Object::update (pId); |
88 break; | 88 break; |
89 } | 89 } |