MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / mouseDoubleClickEvent

Method mouseDoubleClickEvent

src/openms_gui/source/VISUAL/MultiGradientSelector.cpp:167–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165 }
166
167 void MultiGradientSelector::mouseDoubleClickEvent(QMouseEvent * e)
168 {
169 for (UInt i = 0; i < (UInt)gradient_.size(); ++i)
170 {
171 Int pos = Int(float(gradient_.position(i)) / 100.0 * gradient_area_width_ + margin_ + 1);
172 if (e->x() >= pos - 3 && e->x() <= pos + 4 && e->y() >= height() - margin_ - lever_area_height_ + 8 && e->y() <= height() - margin_ - lever_area_height_ + 15)
173 {
174 gradient_.insert(gradient_.position(i), QColorDialog::getColor(gradient_.color(i), this));
175 if (Int(gradient_.position(i)) == selected_)
176 {
177 selected_color_ = gradient_.color(i);
178 }
179 return;
180 }
181 }
182 }
183
184 void MultiGradientSelector::keyPressEvent(QKeyEvent * e)
185 {

Callers

nothing calls this directly

Calls 4

colorMethod · 0.80
sizeMethod · 0.45
positionMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected