Unsolved ignore shift to move between edit text
-
but witch one of the variables gets me the key pressed? i tried something like this !event->key() == Qt::ShiftModifier and doesnt work, there is another way to check?
-
@rest said in ignore shift to move between edit text:
Qt::ShiftModifier
if(event->modifiers() & Qt::ShiftModifier){...}
-
@mrjj thank you so much, i will try everything and see what works
-
@rest
Be careful: I'm thinking you will get one event for just the SHIFT press, and thenQt::ShiftModifier
will also still be true for the event which arrives for theB
.I don't get the whole intention of what you're trying to achieve with your code. You decide where input is to go based on:
if(focusWidget() == ui->lePath && !ui->lePath->text().isEmpty())
Why? What's the logic here? What's the idea of switching focus here?
-
@JonB if i scanned a barcode means that focus is on first edit and he is not empty means i should change focus on second edit for scanning there, this is what i thought i don t have so much experience on this i don t really know how i can make this work
-
@rest
How do you know first barcode data is 100% received ?
Since it comes key pr key. Is there an end of input char ? -
@rest
But aren't you saying the "key presses for the barcode" are for each letter? When the second key arrives inlePath
(it has the focus, and it's no longer empty), won't your code send it toleInformation
? -
No, i dont have something like that .. i don t know how to check this.. gets so difficult. first i had just one edit text and everything worked fine..
-
@JonB what you mean with second key? everything is well until the uppercase gets in, if i scan only digits everything is fine for both edits
-
You can try to use only click focus and not strong focus.
-
I realised i was doing something not necessary and my key event exactly checking that shift so i put my setfocus for first edit text in constructor and verified in key pressed event if event->text is empty to ignore it.