diff options
author | Laszlo Papp <lpapp@kde.org> | 2013-03-21 10:11:15 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-22 12:33:18 +0100 |
commit | 395e8ab275e280a3f9e4a67d56b791cb6c55872d (patch) | |
tree | 14eaa174d3aa38058d57a4ca33347114f0609291 | |
parent | 92577874f9fdfcc655510394c38ba70f9e5503b7 (diff) | |
download | qtserialport-395e8ab275e280a3f9e4a67d56b791cb6c55872d.tar.gz |
Demonstrate the error notification through the terminal example
I have received a couple of requests recently whether it is planned to support
error notification and hence I think it would be a good idea to demonstrate its
usage inside the examples as much as possible. Here you can find the first
attempt for that.
As the library aims to provide the error strings as well, all that has to be
done is to setup a handler for the notification and display a message box and
conditionally close the serial port in case of critical errors.
The string will also be provided by the library which makes the interface
unified across certain projects. However, the clients can also use their strings
if they wish. It is up to their decision. The error strings are already
localized and internationalized inside the library.
The handler is now also tagged properly for the documentation so that it is more
appropriate for end users reading the documentation to get these bits right as
it is probably a severe issue for many developers and end users.
This will also allow us to be very careful about the error strings inside the
library that is among my next goals to make it even nicer than before because
currently there is no "high-level" error message prepended to the more detailed
one. Hence, this could still be improved in the near future.
Some errors are already tested when opening the serial port. Hence, the example
can demonstrate both types of error management: sync and async. It might be
sometimes more feasible to have a sync error management in place even if async
can also work.
The change has been tested on Linux and Windows with Qt4, and with Qt5 on Linux
for the time being.
Thank you for Denis to revealing the importance of the issue even if this patch
is representing a bit different approach.
Change-Id: If0274e684fd5da08b32bbf0227bfb98784c3a78f
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
0 files changed, 0 insertions, 0 deletions