diff options
author | Laszlo Papp <lpapp@kde.org> | 2013-11-01 03:47:13 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-01 15:14:59 +0100 |
commit | 93e887866c2a44957243d12b469ac0f74f3a7eef (patch) | |
tree | 312a646ca43a08f8712b45c7e42ae676bf993775 /dist | |
parent | 9181a898650158cd73f14edf105ee6d5b12eb7f7 (diff) | |
download | qtserialport-93e887866c2a44957243d12b469ac0f74f3a7eef.tar.gz |
Mark most of the the data error policy as deprecated
Unfortunately, this is a bit bad heritage of the QSerialDevice project. It is
not well-thought, and it was added in rush. If this feature ever comes back,
it has to be rethought and maybe redesigned. Currently, it is not much usable
nicely. It is done similarly to the following change:
https://codereview.qt-project.org/#patch,all,43441,7
Having done this, the users will get a warning, and they will hopefully stop
using it. Then, the feature redesign it for 5.3 or later. It can get
undeprecated anytime in Qt 5.X, but it cannot be removed with bumping the
library version. That should be the last resort.
In fact, this feature is very likely not to be redesigned. It is unfortunately a
broken concept. The following long-living serial port frameworks do not provide
"Policy" API either which is a clear sign for its usage pattern:
* PySerial
* Java SerialPort
* C#/.NET SerialPort
* QextSerialPort
... so to recap: it was not a good idea to introduce it.
Unfortunately, the side effect is that we have got warnings for the deprecated
method since moc cannot handle it properly. It needs to call it for internal
reasons.
Note that enum and Q_PROPERTY cannot be deprecated because Q_PROPERTY simply
cannot be, and the enum cannot be deprecated either since that would cause
further warnings for the library itself due its usage for the accessor and
mutator, etc. However, they can be put behind the QT_DEPRECATED_SINCE macro so
that the users can get compilation errors if they define
QT_DISABLE_DEPRECATED_BEFORE to get rid of old deprecated symbols easily by
getting errors instead of warnings.
The following coding can be run to show the expected warnings when used from a
QtSerialPort based application or library:
main.cpp:
int main()
{
QSerialPort serialPort;
serialPort.dataErrorPolicy();
return 0;
}
==============================================================================
1) Qt 5
g++ -fPIC -Wall -DQT_DEPRECATED_WARNINGS -I/usr/include/qt -lQt5SerialPort main.cpp
main.cpp: In function ‘int main()’:
main.cpp:6:32: warning: ‘QSerialPort::DataErrorPolicy QSerialPort::dataErrorPolicy() const’ is deprecated (declared at /usr/include/qt/QtSerialPort/qserialport.h:222) [-Wdeprecated-declarations]
serialPort.dataErrorPolicy();
Tested on Linux with Qt 4.8.5 and then Qt 5.1.1.
==============================================================================
2) Qt 4
g++ -fPIC -Wall -DQT_DEPRECATED_WARNINGS -I/usr/include/qt4/ -lQtSerialPort main.cpp
main.cpp: In function ‘int main()’:
main.cpp:6:32: warning: ‘QSerialPort::DataErrorPolicy QSerialPort::dataErrorPolicy() const’ is deprecated (declared at /usr/include/qt4/QtSerialPort/qserialport.h:222) [-Wdeprecated-declarations]
serialPort.dataErrorPolicy();
^
==============================================================================
Task-number: QTBUG-34429
Change-Id: Ia183817b841fb172d232f550b8402f7a314b8492
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'dist')
-rw-r--r-- | dist/changes-5.2.0 | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/dist/changes-5.2.0 b/dist/changes-5.2.0 index 63373f4..43c32a9 100644 --- a/dist/changes-5.2.0 +++ b/dist/changes-5.2.0 @@ -96,3 +96,7 @@ not used for finding udev again. - [QTBUG-32563] Motorola IMX support was added when udev and sysfs are not present. + +- [QTBUG-34429] Mark the the data error policy obsolete. End users should stop +using this feature now. It may be removed later in Qt 6.X, and there is a +warning now if it is used. |