MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / wheelEvent

Method wheelEvent

DSView/pv/dock/keywordlineedit.cpp:112–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112void KeyLineEdit::wheelEvent(QWheelEvent *event)
113{
114 if (_is_number_mode && _is_spin_mode)
115 {
116 QString new_text = text();
117
118 if (new_text != "")
119 {
120 int v = new_text.toInt();
121 int old_v = v;
122
123 if (event->delta() > 0){
124 v++;
125 }
126 else{
127 v--;
128 }
129
130 if (_min != 0 || _max != 0)
131 {
132 if (v < _min ){
133 v = _min;
134 }
135 else if (v > _max){
136 v = _max;
137 }
138 }
139
140 if (v != old_v){
141 setText(QString::number(v));
142 valueChanged(v);
143 }
144 }
145
146 event->accept();
147 return;
148 }
149
150 QLineEdit::wheelEvent(event);
151}
152
153void KeyLineEdit::setValue(int v)
154{

Callers

nothing calls this directly

Calls 1

acceptMethod · 0.45

Tested by

no test coverage detected