summaryrefslogtreecommitdiff
path: root/examples/terminal/settingsdialog.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix examples directory layoutKai Koehne2013-05-031-204/+0
| | | | | | | | | | | | | Move examples into a dedicated 'serialport' directory. This is in line with what the other modules do, and makes sure that the examples show up in a sensible place even for the 'combined' source packages. Task-number: QTBUG-30912 Change-Id: Iefa2b634df3d2eb34f655b34f6fb24a224b78869 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Add accessor methods for checking the availability of the PID/VIDLaszlo Papp2013-03-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As mentioned in the previous change, this is necessary for those end users who would like to explicitly know if the device on the serial port has a valid vendor or/and product identifier. This is now providing a nice and convenient API for having a dedicated boolean method for making this query possible. It is a lot more readable and convenient to use than other alternatives including the extended scope for the integer query method and so forth. It is more explicit and clear about the intention that one checks if the device has a valid identifier. It would be more vague with error codes and so forth. One somewhat reasonable alternative could be this, albeit this is also more inconvenient: a) bool vendorIdentifier(quint16 &vendorIdentifier) const; b) bool productIdentifier(quint16 &vendorIdentifier) const; ... as this would require an additional variable from the user, and this could not be used with ternary operators so easily, et cetera. There are even worse ideas like how the exceptional conversion happens in QString and so forth, but that also requires an explicit variable or zero if one is sure the conversion should succeed. One can pass zero in there, but that is still inconvenient and more than passing nothing, and zero can become unclear what it supposed to present half or one year later. The change has been tested on Linux with Qt4 and Qt5, and cenumerator works as expected. The documentation has been added accodingly. Task-number: QTPLAYGROUND-21 Change-Id: I905708ce0e67307bf89d69e645462486ad869b0c Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Add local echo support for the terminal exampleDenis Shienkov2013-03-261-0/+3
| | | | | | | | | | | | | | | | | | | Earlier, by default when put a characters for the transfer, this characters is always displayed on the console, i.e. can be said that has always worked the local echo mode. This led to the problem with duplication of input characters on the console, in case if the remote device (e.g. a modem) was enabled the echo mode by default. For example, when typing the command "AT", the console displays "AATT". To fix this problem, to the settings dialog was added the checkbox "Local echo" in which can turn off the display of input characters to the console. Change-Id: Iebc9384bab97e313a954a8f8c00ea22129913280 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Fix crash the Terminal example when trying to select the custom baud rateDenis Shienkov2013-03-251-1/+1
| | | | | | | | | | | | | Attempting to choose from QComboBox the custom baud rate leads to crash because the null pointer is returned to the QLineEdit and call the method for setup the validator by null pointer. Only editable combo boxes have a line edit, so trying to set a non-editable is dereferencing a null ptr. Change-Id: Ia9aaef64ef908b1b2d95090a203dc223d12f0b76 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Change the return type of the vendor/productIdentifier() APILaszlo Papp2013-03-251-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API was established with a bit of insanity, namely: it returns raw strings for the 16-bit vendor and product _numbers_. This brings lots of limitations into the system aside from its silly nature, like how to handle lower and upper case hex letters (a-f, A-F) and so forth. Also, it is not clear whether the API should return zero aligned strings, or whether or not to return the leading indicator of the hex format (0x). This is now all being eliminated by switching to the 16-bit unsigned integer use. There are mostly two use cases for the usage of this: a) Comparison or mapping to find the requested port and device This is getting very simple because it will mean a simple 16-bit unsigned integer comparison which is cross-platform by its nature for sure. b) Display the string to the end user This is for instance with an enumerator or terminal emulator application, but in this special case the user can format the output of the integer as wished. Then, it can easily become a cross-platform display. Even customizing is simple enough to provide the native look'n feel without the library forcing one particular type. The documentation is being changed correspondingly. As for the future, if the need even arises, the following methods could be considered for the info provider class (QSerialPortInfo): bool hasVendorIdentifier() const; bool hasProductIdentifier() const; ... both can be added without any issues (i.e. in a binary compatible way). The examples are updated now as well with presenting the usage of the new API. The GUI emulator example got the string management a bit updated to be in line with the console based emulator (cenumerator). In general, it is also a way more reasonable way of putting a string together with so many placeholders. Also, the argument and list management got a bit nicer formatting style per line break. Testing: the change has been tested on Linux with Qt4 and Qt5. Task-number: QTPLAYGROUND-21 Change-Id: I33683061787af94a797685794be9ebcfa90c499a Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Remove the QtSerialPort namespace define and hence namespace usageLaszlo Papp2013-02-071-0/+2
| | | | | | | | | | * This is for following the convention in the Qt Project with the rest. * This fixes examples and tests to build now as all of them are broken due to the regression. Change-Id: I3f4d64d97466520aea621da582a64a0d97e32136 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Refactor certain variable names, remove useless comments and so forthLaszlo Papp2013-02-011-5/+5
| | | | | Change-Id: Id8af629c2b488050b8accd4c552e9b0ebf366e32 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Make the cross Qt4/5 versions experience better with forward headersLaszlo Papp2013-01-301-1/+1
| | | | | | | | | | This is not a nice way, but quick of getting this feature done. For future reference, we should most likely do something as QtCreator does for instance with "QMAKE_SUBSTITUTES". Change-Id: I3df23ac019552f9586aede336296079109066da1 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Improve terminal example handling of custom baud rate.Thiago A. Correa2013-01-281-2/+3
| | | | | | | | | | This makes the custom baud rate handling independent on the index of the last entry in the QComboBox. Change-Id: I5f0bfa148595e4312a8721a690e87e2fc36906d9 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Make all the file renames and relevant changesLaszlo Papp2013-01-271-1/+1
| | | | | | | | "git log --follow /path/to/the/file/in/question" can be used, for instance, for the renamed files to get the whole history. Change-Id: I20da087ca88e2c179a6c3232772fa21575e0aa6a Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Change the QtCore reference in the copyright headers to QtSerialPortLaszlo Papp2013-01-271-1/+1
| | | | | Change-Id: Ic19f6843d32260404f72038cf77aa6f686e7a3ff Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Rename the SerialPort* classes to QSerialPort* including the internals.Laszlo Papp2013-01-271-25/+25
| | | | | | | | | | | | | | | Unfortunately, the rename has to happen in a separate commit because of the limitations of "git": "git does not track renames of files in history, git only records tree snapshots. It can try to guess whether a change was a rename, or just unrelated removal+addition, when asked. You can help this by making the rename in a different commit from a modification. See man git-log -C and -M" ... so the rename will happen in the next change. Change-Id: Ibe56eba0a0d2c7489db48a6c519d60d3315c00de Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Change Denis' email address in the copyrights headersLaszlo Papp2013-01-261-1/+1
| | | | | Change-Id: I8c564f68bb32423957f2171e1c76d8a428f16eb3 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Call the module QtSerialPort instead of QtAddOnSerialPortLaszlo Papp2013-01-261-1/+1
| | | | | | | | Use the QTSERIALPORT as a term for internal variables as well to remain consistent with the freshly chosen module name. Change-Id: Ia780b105649b39a1eca46702466da5bc31ec5af0 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Change the copyright headers to the Qt Project standard formLaszlo Papp2013-01-261-24/+24
| | | | | Change-Id: Id6414c91a0bc700734873cd798807868865cd453 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Use "BaudRate" instead of "Rate" and "BaudXXXX" instead of "RateXXXX"Laszlo Papp2013-01-261-20/+20
| | | | | Change-Id: Id5db378b6da89f672cb55fa312e325cd1e9b88ce Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Use first() instead of at(0) calls for lists except the imported ringbufferLaszlo Papp2012-11-191-1/+1
| | | | | | Change-Id: Iab98b7146b0d4de542c099162cac11a6408ad9de Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Unify the "#if (!)defined" handling into "#if(n)def"Laszlo Papp2012-08-061-1/+1
| | | | | Change-Id: I580a62dd52b4151f511042f7a382d9a4c1532fc9 Reviewed-by: Denis Shienkov <scapig@yandex.ru>
* Add license information to the header and source filesLaszlo Papp2012-05-031-0/+42
| | | | | | | | | | | | | | | | | | Having checked all the current Playground projects. This license selection seems to be the most appropriate according to the other playground project licenses: https://qt.gitorious.org/qtplayground/ In fact, QtSerialPort is the only Playground project which does not have license yet. This patch tries to amend that gap. It is going to provide more trustworthy situation about the usage of the module to commercial customers right away. As for now, it looks a bit undefined what license this project goes for in the end even if it is guessable. Commercial customers (perhaps even hobbyists) would like to make sure they can reuse this library the way, they wish (aka. No GPLvX and so forth). Change-Id: Ia3a4e48a5140696f749df9fb5a8391955afaa637 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Denis Shienkov <scapig@yandex.ru>
* To Terminal example changed the Label caption Vendor/Product IdentifierDenis Shienkov2012-04-281-2/+2
| | | | | | | Change-Id: I2f9fbf58d4b56729bc2dbe91f4b0e67ea00c374a Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <scapig@yandex.ru>
* Do not use the not preferred and actually unneccessary static_cast<int>Laszlo Papp2012-04-261-19/+19
| | | | | Change-Id: I6cfcb40016851f6b08f41f7949162fe10665234e Reviewed-by: Denis Shienkov <scapig@yandex.ru>
* Use the enumeration values instead of hard coded integer numbersLaszlo Papp2012-04-261-4/+4
| | | | | Change-Id: I24d6553410c8ccc60ef3bc1694b4f0850c03731b Reviewed-by: Denis Shienkov <scapig@yandex.ru>
* Use camelCase for flowControl just like at the other placesLaszlo Papp2012-04-131-1/+1
| | | | | | Change-Id: I29c1ec0a44e9631aba5d802428a67e7870f2dfc8 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <scapig@yandex.ru>
* To Terminal adds the ability to input custom baud rate.Denis Shienkov2012-04-081-3/+27
| | | | | Change-Id: I7947ebf437a8731d68f47966c6f21cccb03d3825 Reviewed-by: Denis Shienkov <scapig@yandex.ru>
* In example of Terminal fixed displayed vendor and product identifiersDenis Shienkov2012-04-071-1/+4
| | | | | | Change-Id: I7199c283142125af5e162373b6b146d9ee648ba9 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Denis Shienkov <scapig@yandex.ru>
* Show "Data bits: 8" in the settings of the terminal example by defaultLaszlo Papp2012-04-061-0/+1
| | | | | | | | | | | | It is probably better to show this value in the settings for the data bits since it is probably the most common usage out there. This way 8N1 would be available by default. Therefore, in most cases while testing or debugging the qtserialport codebase itself, it is not even needed to go to the settings, just press connect. Change-Id: I2cbe2e364ef488693c5687edf7658aa722e43a78 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <scapig@yandex.ru>
* Added simple GUI terminal example.Denis Shienkov2012-03-291-0/+125
Change-Id: Ic68be9d0c007dfd142deef37ab931f4b68f1f692 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <scapig@yandex.ru>