Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
'L' Shaped Enter Button
rchamberlin last edited by
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.
onek24 last edited by
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.
Jens last edited by
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.