Rework button interface inheritance

pull/201/head
Michael Zanetti 2019-08-31 00:31:38 +02:00
parent 09fb3ef4c5
commit 94ebdd66dc
7 changed files with 29 additions and 19 deletions

View File

@ -1,2 +1,8 @@
{
"description": "The base for all buttons that emit a pressed event.",
"events": [
{
"name": "pressed"
}
]
}

View File

@ -20,6 +20,7 @@
<file>battery.json</file>
<file>batterylevel.json</file>
<file>button.json</file>
<file>multibutton.json</file>
<file>simplebutton.json</file>
<file>longpressbutton.json</file>
<file>simplemultibutton.json</file>

View File

@ -1,5 +1,6 @@
{
"extends": "simplebutton",
"description": "A button that emits different events, pressed and longpressed, depending on how long the user presses it. Note that the button should only emit one of them at a time. I.e. don't emit pressed on botton down and later longPressed if the user keeps on holding the button. Such a longpress should only emit longPressed. Common practice is to emit pressed if a release event is received before a timeout expires, else emit longpress when the timeout expires.",
"extends": "button",
"events": [
{
"name": "longPressed"

View File

@ -1,5 +1,6 @@
{
"extends": "longpressbutton",
"description": "A remote control with multiple buttons that can distinguish between short and long presses. Note that the button should only emit one of them at a time. I.e. don't emit pressed on botton down and later longPressed if the user keeps on holding the button. Such a longpress should only emit longPressed. Common practice is to emit pressed if a release event is received before a timeout expires, else emit longpress when the timeout expires.",
"extends": "simplemultibutton",
"events": [
{
"name": "longPressed",

View File

@ -0,0 +1,15 @@
{
"description": "A remote control with multiple buttons. Emits pressed(buttonName) on button presses.",
"extends": "button",
"events": [
{
"name": "pressed",
"params": [
{
"name": "buttonName",
"type": "QString"
}
]
}
]
}

View File

@ -1,8 +1,4 @@
{
"extends": "button",
"events": [
{
"name": "pressed"
}
]
"description": "Deprecated - Use button instead."
}

View File

@ -1,14 +1,4 @@
{
"extends": "button",
"events": [
{
"name": "pressed",
"params": [
{
"name": "buttonName",
"type": "QString"
}
]
}
]
"description": "Deprecated - Use multibutton instead",
"extends": "multibutton"
}