mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-22 21:55:52 +00:00
Fix enum flag usages in the qrenderdoc
There are a few places where the logical 'and' operator was used to check if a given flag is enabled however that is not the correct operator. The binary 'and' operator should be used where the enum acts as a flag.
This commit is contained in:
committed by
Baldur Karlsson
parent
ffcbf233d1
commit
4263b55ffa
@@ -49,11 +49,11 @@ void RDTextEdit::focusOutEvent(QFocusEvent *e)
|
||||
void RDTextEdit::keyPressEvent(QKeyEvent *e)
|
||||
{
|
||||
// add ctrl-end and ctrl-home shortcuts, which aren't implemented for read-only edits
|
||||
if(e->key() == Qt::Key_End && e->modifiers() && Qt::ControlModifier)
|
||||
if(e->key() == Qt::Key_End && (e->modifiers() & Qt::ControlModifier))
|
||||
{
|
||||
verticalScrollBar()->setValue(verticalScrollBar()->maximum());
|
||||
}
|
||||
else if(e->key() == Qt::Key_Home && e->modifiers() && Qt::ControlModifier)
|
||||
else if(e->key() == Qt::Key_Home && (e->modifiers() & Qt::ControlModifier))
|
||||
{
|
||||
verticalScrollBar()->setValue(verticalScrollBar()->minimum());
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
if(e->key() == Qt::Key_W || e->key() == Qt::Key_S)
|
||||
setMove(Direction::Fwd, 0);
|
||||
|
||||
if(e->modifiers() && Qt::ShiftModifier)
|
||||
if(e->modifiers() & Qt::ShiftModifier)
|
||||
m_CurrentSpeed = 3.0f;
|
||||
else
|
||||
m_CurrentSpeed = 1.0f;
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
if(e->key() == Qt::Key_A)
|
||||
setMove(Direction::Horiz, -1);
|
||||
|
||||
if(e->modifiers() && Qt::ShiftModifier)
|
||||
if(e->modifiers() & Qt::ShiftModifier)
|
||||
m_CurrentSpeed = 3.0f;
|
||||
else
|
||||
m_CurrentSpeed = 1.0f;
|
||||
|
||||
Reference in New Issue
Block a user