I wrote a custom plugin for QCanBus
, that simply is a copy of the socketcan plugin but has been renamed and the identifiers have been adjusted to that new name.
I did that copying to first get the plugin recognised before I alter it.
I changed the qmake project to look that way:
TEMPLATE = lib
TARGET = qtcopysocketcanbus
CONFIG += plugin
QT = core serialbus
HEADERS += \
copysocketcanbackend.h
SOURCES += \
main.cpp \
copysocketcanbackend.cpp
DISTFILES = plugin.json
and added the plugin.json
like so:
{
"Key": "copysocketcan"
}
I then renamed everything else from socketcan
to copysocketcan
in the main.cpp
, the copysocketcan.cpp
and the copysocketcan.h
as well.
When I build the project, I get my *.so file which i put into $QT_PLUGIN_PATH/canbus/
on my target.
However, a quick start reveals, that qt only lists the plugins that came with the installation, not my added custom one.
I tried putting QLoggingCategory::setFilterRules(QStringLiteral("qt.canbus* = true"));
as first line in my code and hoped getting more debug output, but I only get the debug output that my own application is producing. No output from the actual QCanBus
.
So my questions are
- How to enable the debug output for
qt.canbus
? Do I have to build QT with debug config for that? - Does my approach for creating a plugin reasonable?
- Any ideas, why the custom plugin is not listed?