diff options
author | Evgeny Shtanov <shtanov_evgenii@mail.ru> | 2021-03-10 22:33:56 +0300 |
---|---|---|
committer | Evgeny Shtanov <shtanov_evgenii@mail.ru> | 2021-03-19 00:48:34 +0300 |
commit | a72f9e33dc8fe60ef80eee0ecf97965fc8482fe9 (patch) | |
tree | 6af3cd4cbdfdef1a137bb690f076bb15608eb414 /examples/serialbus/can/mainwindow.ui | |
parent | 55f97fd0178485bafed1e97eaf0d4ebf91a312b5 (diff) |
CAN example: Replace received frames edit with proper table and model
Add a class based on QAbstractTableModel to show the received frames.
Also add a configurable queue to buffer the frames before displaying
them. This should avoid frames loss in flood traffic mode.
Task-number: QTBUG-85611
Change-Id: Iac4671096c1cbfdc8297acf3c99be960b7eaf010
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Diffstat (limited to 'examples/serialbus/can/mainwindow.ui')
-rw-r--r-- | examples/serialbus/can/mainwindow.ui | 100 |
1 files changed, 52 insertions, 48 deletions
diff --git a/examples/serialbus/can/mainwindow.ui b/examples/serialbus/can/mainwindow.ui index f773ffb..b67490d 100644 --- a/examples/serialbus/can/mainwindow.ui +++ b/examples/serialbus/can/mainwindow.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>551</width> - <height>481</height> + <width>634</width> + <height>527</height> </rect> </property> <property name="windowTitle"> @@ -27,51 +27,50 @@ <property name="title"> <string>Received CAN messages</string> </property> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <item> - <widget class="QLabel" name="label_3"> - <property name="font"> - <font> - <family>Courier</family> - <kerning>false</kerning> - </font> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="text"> - <string>Timestamp Flags CAN-ID DLC Data</string> - </property> - </widget> - </item> - <item> - <widget class="QTextEdit" name="receivedMessagesEdit"> - <property name="font"> - <font> - <family>Courier</family> - <kerning>false</kerning> - </font> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="undoRedoEnabled"> - <bool>false</bool> - </property> - <property name="lineWrapMode"> - <enum>QTextEdit::NoWrap</enum> - </property> - <property name="readOnly"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="busStatus"> - <property name="text"> - <string/> - </property> - </widget> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="ReceivedFramesView" name="receivedFramesView"> + <property name="editTriggers"> + <set>QAbstractItemView::NoEditTriggers</set> + </property> + <property name="showDropIndicator" stdset="0"> + <bool>false</bool> + </property> + <property name="dragDropOverwriteMode"> + <bool>false</bool> + </property> + <property name="selectionBehavior"> + <enum>QAbstractItemView::SelectRows</enum> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="busStatus"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> </item> </layout> </widget> @@ -83,7 +82,7 @@ <rect> <x>0</x> <y>0</y> - <width>551</width> + <width>634</width> <height>22</height> </rect> </property> @@ -189,6 +188,11 @@ <header location="global">sendframebox.h</header> <container>1</container> </customwidget> + <customwidget> + <class>ReceivedFramesView</class> + <extends>QTableView</extends> + <header location="global">receivedframesview.h</header> + </customwidget> </customwidgets> <resources> <include location="can.qrc"/> |