diff --git a/src/peripheralwidget.cpp b/src/peripheralwidget.cpp --- a/src/peripheralwidget.cpp +++ b/src/peripheralwidget.cpp @@ -117,7 +117,7 @@ void peripheralWidget::mouseMoveEvent(QM void peripheralWidget::mouseReleaseEvent(QMouseEvent *event) { - + Q_UNUSED(event) } void peripheralWidget::keyPressEvent(QKeyEvent *event) diff --git a/src/registerwidget.cpp b/src/registerwidget.cpp --- a/src/registerwidget.cpp +++ b/src/registerwidget.cpp @@ -36,8 +36,6 @@ QPoint registerWidget::paint(QPainter* p painter->translate(p_fieldsEl->paint(painter)); p_nameEl->paint(painter); painter->restore(); - int h=p_boundingRect.height(); - int y=p_boundingRect.y(); return QPoint(0,p_boundingRect.height()+p_boundingRect.y()+p_yMargins); } @@ -126,7 +124,12 @@ QString registerWidget::bitFieldToDec(in QString registerWidget::bitFieldToBin(int bitIndex) { - + if(bitIndex>=0 && bitIndex<32) + { + // TODO do the convertion + return p_fieldsEl->valueDec(bitIndex); + } + return QString("Out of range"); } void registerWidget::setValue(qint32 value) @@ -218,9 +221,9 @@ QPoint bitfieldsElement::paint(QPainter { for(int l = 0;l<4;l++) { - if(p_cursorBlinkEnable == false || (31-p_cursorIndex) != ((i*4)+l)) + if(p_cursorBlinkEnable == false || (31-(int)p_cursorIndex) != ((i*4)+l)) { - if(p_startSelectionIndex!=-1 && p_stopSelectionIndex!=-1 && p_startSelectionIndex <=31-((i*4)+l) && p_stopSelectionIndex >=31-((i*4)+l)) + 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)) { QPen svg = painter->pen(); painter->setPen(p_blinkTextColor); @@ -346,11 +349,11 @@ void bitfieldsElement::setFont(QFont fon void bitfieldsElement::updateSelection(int index) { - if(p_cursorIndex!=-1) + if((int)p_cursorIndex!=-1) { - if(p_startSelectionIndex!=-1 && p_stopSelectionIndex!= -1) + if((int)p_startSelectionIndex!=-1 && (int)p_stopSelectionIndex!= -1) { - if(index>=p_stopSelectionIndex) + if((uint)index>=p_stopSelectionIndex) { p_stopSelectionIndex = index; p_cursorIndex = index; @@ -363,7 +366,7 @@ void bitfieldsElement::updateSelection(i } else { - if(index>p_cursorIndex) + if((uint)index>p_cursorIndex) { p_startSelectionIndex = p_cursorIndex; p_stopSelectionIndex = index;