Modifying Qt Library

时间:2018-02-01 18:09:47

标签: c++ qt shared-libraries qt5

I am developing a project using the QCanBusDevice library provided by Qt in 5.10 version. However, the readFrame() API to read can frames from a QVector input buffer is too slow. It can't keep up with the amount of CAN messages the processor is throwing.

I want to be able to flush the buffer and obtain the latest data on the wire, however, the library doesn't provide any API to flush the input buffer (please let me know if I missed that).

Is it possible to modify this library and add a flush API?

Thanks!

1 个答案:

答案 0 :(得分:3)

"Is it possible to modify this library and add a flush API?"

Of course it is. Qt is open-source, you can download the source code, make the modification you need, recompile the library and then use your modified version with your application.

At the place I work we do exactly this to add a few bits and pieces we need and fix some bugs.

But if you do this, please submit your changes back to the project so a) others can benefit, and b) you don't have to maintain your own fork indefinitely (at my company we, of course, also do this).