From b6cfa1583cb2c44d2c72b00d08829fa6831d3ff4 Mon Sep 17 00:00:00 2001 From: Phil Olynyk Date: Sun, 17 Mar 2019 16:03:08 -0400 Subject: [PATCH] Changed some boolean operators to bit-wise operators --- oscar/Graphs/gGraphView.cpp | 4 ++-- oscar/Graphs/gdailysummary.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/oscar/Graphs/gGraphView.cpp b/oscar/Graphs/gGraphView.cpp index 19d464b0..3f68ceb8 100644 --- a/oscar/Graphs/gGraphView.cpp +++ b/oscar/Graphs/gGraphView.cpp @@ -2566,7 +2566,7 @@ void gGraphView::mousePressEvent(QMouseEvent *event) m_button_down = true; - m_metaselect = event->modifiers() && Qt::AltModifier; + m_metaselect = event->modifiers() & Qt::AltModifier; m_horiz_travel = 0; m_graph_index = i; m_selected_graph = g; @@ -2640,7 +2640,7 @@ void gGraphView::mousePressEvent(QMouseEvent *event) m_point_clicked = QPoint(event->x(), event->y()); //QMouseEvent e(event->type(),m_point_clicked,event->button(),event->buttons(),event->modifiers()); m_button_down = true; - m_metaselect = event->modifiers() && Qt::AltModifier; + m_metaselect = event->modifiers() & Qt::AltModifier; m_horiz_travel = 0; m_graph_index = i; diff --git a/oscar/Graphs/gdailysummary.cpp b/oscar/Graphs/gdailysummary.cpp index 4a3bbaf1..6da12b55 100644 --- a/oscar/Graphs/gdailysummary.cpp +++ b/oscar/Graphs/gdailysummary.cpp @@ -234,7 +234,7 @@ void gDailySummary::paint(QPainter &painter, gGraph &w, const QRegion ®ion) rect1 = QRectF(xpos, ypos, 0, 0); QString txt = info.at(i); - rect1 = painter.boundingRect(rect1, Qt::AlignTop || Qt::AlignLeft, txt); + rect1 = painter.boundingRect(rect1, Qt::AlignTop | Qt::AlignLeft, txt); rect1.setHeight(rect1.height() * 1.25); maxwidth = qMax(rect1.width(), maxwidth); @@ -246,7 +246,7 @@ void gDailySummary::paint(QPainter &painter, gGraph &w, const QRegion ®ion) rect1 = QRectF(xpos, tpos, 0, 0); QString txt = settings.at(i); - rect1 = painter.boundingRect(rect1, Qt::AlignTop || Qt::AlignLeft, txt); + rect1 = painter.boundingRect(rect1, Qt::AlignTop | Qt::AlignLeft, txt); rect1.setHeight(rect1.height() * 1.25); maxwidth = qMax(rect1.width(), maxwidth); @@ -258,7 +258,7 @@ void gDailySummary::paint(QPainter &painter, gGraph &w, const QRegion ®ion) QRectF rect3 = QRectF(xpos, tpos, 0, 0); QString machinfo = QObject::tr("Machine Information"); - rect3 = painter.boundingRect(rect1, Qt::AlignTop || Qt::AlignLeft, machinfo); + rect3 = painter.boundingRect(rect1, Qt::AlignTop | Qt::AlignLeft, machinfo); maxwidth = qMax(rect1.width(), maxwidth); painter.drawRect(QRect(xpos, ypos + rect3.height()+4, maxwidth, tpos-ypos)); @@ -269,7 +269,7 @@ void gDailySummary::paint(QPainter &painter, gGraph &w, const QRegion ®ion) rect1 = QRectF(xpos, ypos, 0, 0); QString txt = info.at(i); - rect1 = painter.boundingRect(rect1, Qt::AlignTop || Qt::AlignLeft, txt); + rect1 = painter.boundingRect(rect1, Qt::AlignTop | Qt::AlignLeft, txt); rect1.setWidth(maxwidth); rect1.setHeight(rect1.height() * 1.25); painter.fillRect(rect1, QColor(info_background.at(i))); @@ -295,7 +295,7 @@ void gDailySummary::paint(QPainter &painter, gGraph &w, const QRegion ®ion) rect1 = QRectF(xpos, ypos, 0, 0); QString txt = settings.at(i); - rect1 = painter.boundingRect(rect1, Qt::AlignTop || Qt::AlignLeft, txt); + rect1 = painter.boundingRect(rect1, Qt::AlignTop | Qt::AlignLeft, txt); rect1.setWidth(maxwidth); rect1.setHeight(rect1.height() * 1.25); // painter.fillRect(rect1, QColor("orange"));