summaryrefslogtreecommitdiffstats
path: root/examples/serialbus/can/mainwindow.ui
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2017-07-02 12:23:01 +0200
committerAndré Hartmann <aha_1980@gmx.de>2017-07-17 19:52:22 +0000
commitf152024f15eeba7da222664b79bd275755b39360 (patch)
tree75f8c8ab09a1eba7b6211f9ab79f85ea1255d161 /examples/serialbus/can/mainwindow.ui
parent41b46ae9fe32481582bf07cd48bda2d3595c90f7 (diff)
CAN-Example: Add a dedicated send frame group box
By moving the send frame logic to a separate panel, the MainWindow gets easier to understand as it only connects signals to slots. The new SendFramesBox also does more sanity check on the parameters (options that exclude each other are checked) and forbids invalid input by using QValidators. The payload input is also prettified with spaces. This was first done by InputMasks but this had strange side effects so now the input validator is used for this task also. Change-Id: Ib95605ce4bc23b52d1cf5d082b1533b2a59f7749 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'examples/serialbus/can/mainwindow.ui')
-rw-r--r--examples/serialbus/can/mainwindow.ui125
1 files changed, 11 insertions, 114 deletions
diff --git a/examples/serialbus/can/mainwindow.ui b/examples/serialbus/can/mainwindow.ui
index 04f8c93..1d5a657 100644
--- a/examples/serialbus/can/mainwindow.ui
+++ b/examples/serialbus/can/mainwindow.ui
@@ -14,123 +14,12 @@
<string>CAN Example</string>
</property>
<widget class="QWidget" name="centralWidget">
- <layout class="QVBoxLayout" name="verticalLayout_3">
+ <layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="QGroupBox" name="sendMessagesBox">
+ <widget class="SendFrameBox" name="sendFrameBox">
<property name="title">
- <string>Send CAN message</string>
+ <string>Send CAN frame</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>&amp;ID (hex)</string>
- </property>
- <property name="buddy">
- <cstring>idEdit</cstring>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="idEdit">
- <property name="placeholderText">
- <string>123</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2" rowspan="4">
- <widget class="QGroupBox" name="groupBox">
- <property name="title">
- <string>Frame Type</string>
- </property>
- <property name="checkable">
- <bool>false</bool>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QRadioButton" name="dataFrame">
- <property name="text">
- <string>D&amp;ata</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="remoteFrame">
- <property name="text">
- <string>Re&amp;mote Request</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QRadioButton" name="errorFrame">
- <property name="text">
- <string>&amp;Error</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QCheckBox" name="fdBox">
- <property name="text">
- <string>&amp;Flexible Data-Rate
-(64 byte payload)</string>
- </property>
- </widget>
- </item>
- <item row="2" column="3">
- <widget class="QCheckBox" name="effBox">
- <property name="toolTip">
- <string>Allow extended frames with 29 bit identifier.
-Otherwise, the standard format with 11 bit idenfier is used.</string>
- </property>
- <property name="text">
- <string>E&amp;xtended Frame
-(29 bit identifier)</string>
- </property>
- </widget>
- </item>
- <item row="3" column="3">
- <widget class="QPushButton" name="sendButton">
- <property name="text">
- <string>&amp;Send</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QLineEdit" name="lineEdit">
- <property name="placeholderText">
- <string>12 34 AB CE</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>&amp;Data (hex)</string>
- </property>
- <property name="buddy">
- <cstring>lineEdit</cstring>
- </property>
- </widget>
- </item>
- <item row="1" column="3">
- <widget class="QCheckBox" name="bitrateSwitchBox">
- <property name="text">
- <string>&amp;Bitrate Switch
-(Higher data rate)</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
</widget>
</item>
<item>
@@ -276,6 +165,14 @@ Otherwise, the standard format with 11 bit idenfier is used.</string>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
+ <customwidgets>
+ <customwidget>
+ <class>SendFrameBox</class>
+ <extends>QGroupBox</extends>
+ <header location="global">sendframebox.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
<resources>
<include location="can.qrc"/>
</resources>