comparison libgui/graphics/PopupMenuControl.cc @ 20045:b08c13ed4a8c

Qt PopupMenuControl: son creation se index to Value, and dont fire callback on programatic value set (Bug #44687) * libgui/graphics/PopupMenuControl.cc (PopupMenuControl::PopupMenuControl): call update to ID_VALUE (PopupMenuControl::update): set m_blockUpdate whilst in update for ID_VALUE
author John Donoghue
date Wed, 01 Apr 2015 15:16:14 -0400
parents f0e61a67ad9f
children 519eb032ac35
comparison
equal deleted inserted replaced
20044:f2dea119369e 20045:b08c13ed4a8c
54 { 54 {
55 uicontrol::properties& up = properties<uicontrol> (); 55 uicontrol::properties& up = properties<uicontrol> ();
56 56
57 box->addItems (Utils::fromStdString (up.get_string_string ()).split ('|')); 57 box->addItems (Utils::fromStdString (up.get_string_string ()).split ('|'));
58 58
59 update (uicontrol::properties::ID_VALUE);
60
59 connect (box, SIGNAL (currentIndexChanged (int)), 61 connect (box, SIGNAL (currentIndexChanged (int)),
60 SLOT (currentIndexChanged (int))); 62 SLOT (currentIndexChanged (int)));
61 } 63 }
62 64
63 PopupMenuControl::~PopupMenuControl (void) 65 PopupMenuControl::~PopupMenuControl (void)
95 } 97 }
96 m_blockUpdate = false; 98 m_blockUpdate = false;
97 break; 99 break;
98 100
99 case uicontrol::properties::ID_VALUE: 101 case uicontrol::properties::ID_VALUE:
102 m_blockUpdate = true;
100 { 103 {
101 Matrix value = up.get_value ().matrix_value (); 104 Matrix value = up.get_value ().matrix_value ();
102 105
103 if (value.numel () > 0) 106 if (value.numel () > 0)
104 { 107 {
109 { 112 {
110 box->setCurrentIndex (newIndex); 113 box->setCurrentIndex (newIndex);
111 } 114 }
112 } 115 }
113 } 116 }
117 m_blockUpdate = false;
114 break; 118 break;
115 119
116 default: 120 default:
117 BaseControl::update (pId); 121 BaseControl::update (pId);
118 break; 122 break;