'L' Shaped Enter Button
I'm trying to implement a QWERTY keyboard using buttons like below:
See the enter button is an 'L' shape. Is this possible?
Thanks in advance for any help/direction.
Hello and welcome to qt-project.org. Where should the L-shaped enter button be? Or is it the inversed L on the bottom right?
To answer your question: it is basically possible. What are you using for the buttons? If you are using default Rectangles, then you can implement another Rectangle which color is your Backgroundcolor, example:
width: 200; height: 200
width: 100; height: 100
You'll probably need a MouseArea so you have to move the inner Rectangle outside so its also a child of the parent of your mainrectangle and put a mousearea on your mainrectangle. the second rectangle will overlay it and it wont trigger the mousearea.
Please provide more information for a more helpfull answer.
I think the easiest solution is just to combine two MouseAreas:
import QtQuick 2.0
readonly property color color: mouse1.pressed || mouse2.pressed ? "gray" : "white"
onClicked: print("button clicked")
If you need a button of arbitrary shape, you can also filter the click in the MouseArea:onPressed function and for instance only accept the event if it is inside a certain shape.