mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 17:25:13 +03:00
Merge pull request #2245 from opentx/romolo/potreset_next
Reset pots to the middle by right double clicking them
This commit is contained in:
commit
3e37b9c256
3 changed files with 50 additions and 19 deletions
21
companion/src/simulation/myqdial.h
Normal file
21
companion/src/simulation/myqdial.h
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#ifndef MYQDIAL_H
|
||||||
|
#define MYQDIAL_H
|
||||||
|
|
||||||
|
|
||||||
|
class myQDial : public QDial
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit myQDial(QWidget *parent = 0) : QDial(parent) {}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void mousePressEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
if (event->button() == Qt::RightButton && event->type() == QEvent::MouseButtonDblClick) {
|
||||||
|
setValue(0);
|
||||||
|
event->accept();
|
||||||
|
}
|
||||||
|
QDial::mousePressEvent(event);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -974,8 +974,8 @@ QPushButton:checked {
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_9" stretch="0,1,0,0,1,0,0,1,0,0,1">
|
<layout class="QGridLayout" name="gridLayout_7">
|
||||||
<item>
|
<item row="0" column="0">
|
||||||
<widget class="QFrame" name="beep_frame">
|
<widget class="QFrame" name="beep_frame">
|
||||||
<property name="autoFillBackground">
|
<property name="autoFillBackground">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
@ -1006,7 +1006,7 @@ QPushButton:checked {
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="1" column="0">
|
||||||
<spacer name="verticalSpacer_4">
|
<spacer name="verticalSpacer_4">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
@ -1019,8 +1019,8 @@ QPushButton:checked {
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="2" column="0">
|
||||||
<widget class="QDial" name="dialP_1">
|
<widget class="myQDial" name="dialP_1">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
@ -1053,7 +1053,7 @@ QPushButton:checked {
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="dialP_1value">
|
<widget class="QLabel" name="dialP_1value">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true">0 %</string>
|
<string notr="true">0 %</string>
|
||||||
|
@ -1063,7 +1063,7 @@ QPushButton:checked {
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="4" column="0">
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
@ -1076,8 +1076,8 @@ QPushButton:checked {
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="5" column="0">
|
||||||
<widget class="QDial" name="dialP_2">
|
<widget class="myQDial" name="dialP_2">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
@ -1113,7 +1113,7 @@ QPushButton:checked {
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="6" column="0">
|
||||||
<widget class="QLabel" name="dialP_2value">
|
<widget class="QLabel" name="dialP_2value">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true">0 %</string>
|
<string notr="true">0 %</string>
|
||||||
|
@ -1123,7 +1123,7 @@ QPushButton:checked {
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="7" column="0">
|
||||||
<spacer name="verticalSpacer_2">
|
<spacer name="verticalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
@ -1136,8 +1136,8 @@ QPushButton:checked {
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="8" column="0">
|
||||||
<widget class="QDial" name="dialP_3">
|
<widget class="myQDial" name="dialP_3">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
@ -1170,7 +1170,7 @@ QPushButton:checked {
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="9" column="0">
|
||||||
<widget class="QLabel" name="dialP_3value">
|
<widget class="QLabel" name="dialP_3value">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true">0 %</string>
|
<string notr="true">0 %</string>
|
||||||
|
@ -1180,7 +1180,7 @@ QPushButton:checked {
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="10" column="0">
|
||||||
<spacer name="verticalSpacer_3">
|
<spacer name="verticalSpacer_3">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
@ -1491,6 +1491,11 @@ QPushButton:checked {
|
||||||
<header>menuwidget.h</header>
|
<header>menuwidget.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>myQDial</class>
|
||||||
|
<extends>QDial</extends>
|
||||||
|
<header location="global">myqdial.h</header>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../companion.qrc"/>
|
<include location="../companion.qrc"/>
|
||||||
|
|
|
@ -570,7 +570,7 @@ QPushButton:checked {
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="10">
|
<item row="2" column="10">
|
||||||
<widget class="QDial" name="dialP_1">
|
<widget class="myQDial" name="dialP_1">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
@ -826,7 +826,7 @@ QPushButton:checked {
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="3">
|
<item row="2" column="3">
|
||||||
<widget class="QDial" name="dialP_3">
|
<widget class="myQDial" name="dialP_3">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
@ -1065,7 +1065,7 @@ QPushButton:checked {
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QDial" name="dialP_2">
|
<widget class="myQDial" name="dialP_2">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
@ -1430,7 +1430,7 @@ QPushButton:checked {
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="8">
|
<item row="2" column="8">
|
||||||
<widget class="QDial" name="dialP_4">
|
<widget class="myQDial" name="dialP_4">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
@ -1687,6 +1687,11 @@ QPushButton:checked {
|
||||||
<header>xmenuwidget.h</header>
|
<header>xmenuwidget.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>myQDial</class>
|
||||||
|
<extends>QDial</extends>
|
||||||
|
<header location="global">myqdial.h</header>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../companion.qrc"/>
|
<include location="../companion.qrc"/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue