@@ -117,7 +117,7 void peripheralWidget::mouseMoveEvent(QM | |||||
117 |
|
117 | |||
118 | void peripheralWidget::mouseReleaseEvent(QMouseEvent *event) |
|
118 | void peripheralWidget::mouseReleaseEvent(QMouseEvent *event) | |
119 | { |
|
119 | { | |
120 |
|
120 | Q_UNUSED(event) | ||
121 | } |
|
121 | } | |
122 |
|
122 | |||
123 | void peripheralWidget::keyPressEvent(QKeyEvent *event) |
|
123 | void peripheralWidget::keyPressEvent(QKeyEvent *event) |
@@ -36,8 +36,6 QPoint registerWidget::paint(QPainter* p | |||||
36 | painter->translate(p_fieldsEl->paint(painter)); |
|
36 | painter->translate(p_fieldsEl->paint(painter)); | |
37 | p_nameEl->paint(painter); |
|
37 | p_nameEl->paint(painter); | |
38 | painter->restore(); |
|
38 | painter->restore(); | |
39 | int h=p_boundingRect.height(); |
|
|||
40 | int y=p_boundingRect.y(); |
|
|||
41 | return QPoint(0,p_boundingRect.height()+p_boundingRect.y()+p_yMargins); |
|
39 | return QPoint(0,p_boundingRect.height()+p_boundingRect.y()+p_yMargins); | |
42 | } |
|
40 | } | |
43 |
|
41 | |||
@@ -126,7 +124,12 QString registerWidget::bitFieldToDec(in | |||||
126 |
|
124 | |||
127 | QString registerWidget::bitFieldToBin(int bitIndex) |
|
125 | QString registerWidget::bitFieldToBin(int bitIndex) | |
128 | { |
|
126 | { | |
129 |
|
127 | if(bitIndex>=0 && bitIndex<32) | ||
|
128 | { | |||
|
129 | // TODO do the convertion | |||
|
130 | return p_fieldsEl->valueDec(bitIndex); | |||
|
131 | } | |||
|
132 | return QString("Out of range"); | |||
130 | } |
|
133 | } | |
131 |
|
134 | |||
132 | void registerWidget::setValue(qint32 value) |
|
135 | void registerWidget::setValue(qint32 value) | |
@@ -218,9 +221,9 QPoint bitfieldsElement::paint(QPainter | |||||
218 | { |
|
221 | { | |
219 | for(int l = 0;l<4;l++) |
|
222 | for(int l = 0;l<4;l++) | |
220 | { |
|
223 | { | |
221 | if(p_cursorBlinkEnable == false || (31-p_cursorIndex) != ((i*4)+l)) |
|
224 | if(p_cursorBlinkEnable == false || (31-(int)p_cursorIndex) != ((i*4)+l)) | |
222 | { |
|
225 | { | |
223 | if(p_startSelectionIndex!=-1 && p_stopSelectionIndex!=-1 && p_startSelectionIndex <=31-((i*4)+l) && p_stopSelectionIndex >=31-((i*4)+l)) |
|
226 | if((int)p_startSelectionIndex!=-1 && (int)p_stopSelectionIndex!=-1 && p_startSelectionIndex <=(uint)31-(uint)((i*4)+l) && p_stopSelectionIndex >=(uint)31-(uint)((i*4)+l)) | |
224 | { |
|
227 | { | |
225 | QPen svg = painter->pen(); |
|
228 | QPen svg = painter->pen(); | |
226 | painter->setPen(p_blinkTextColor); |
|
229 | painter->setPen(p_blinkTextColor); | |
@@ -346,11 +349,11 void bitfieldsElement::setFont(QFont fon | |||||
346 |
|
349 | |||
347 | void bitfieldsElement::updateSelection(int index) |
|
350 | void bitfieldsElement::updateSelection(int index) | |
348 | { |
|
351 | { | |
349 | if(p_cursorIndex!=-1) |
|
352 | if((int)p_cursorIndex!=-1) | |
350 | { |
|
353 | { | |
351 | if(p_startSelectionIndex!=-1 && p_stopSelectionIndex!= -1) |
|
354 | if((int)p_startSelectionIndex!=-1 && (int)p_stopSelectionIndex!= -1) | |
352 | { |
|
355 | { | |
353 | if(index>=p_stopSelectionIndex) |
|
356 | if((uint)index>=p_stopSelectionIndex) | |
354 | { |
|
357 | { | |
355 | p_stopSelectionIndex = index; |
|
358 | p_stopSelectionIndex = index; | |
356 | p_cursorIndex = index; |
|
359 | p_cursorIndex = index; | |
@@ -363,7 +366,7 void bitfieldsElement::updateSelection(i | |||||
363 | } |
|
366 | } | |
364 | else |
|
367 | else | |
365 | { |
|
368 | { | |
366 | if(index>p_cursorIndex) |
|
369 | if((uint)index>p_cursorIndex) | |
367 | { |
|
370 | { | |
368 | p_startSelectionIndex = p_cursorIndex; |
|
371 | p_startSelectionIndex = p_cursorIndex; | |
369 | p_stopSelectionIndex = index; |
|
372 | p_stopSelectionIndex = index; |
General Comments 0
You need to be logged in to leave comments.
Login now