开发者

How strict to be when using Qt framework?

开发者 https://www.devze.com 2022-12-29 04:07 出处:网络
I\'m building a Qt application that needs to use libssh, a SSH client library. libssh (und开发者_运维技巧erstandably) performs its own network connections, however Qt has its own infrastructure for ne

I'm building a Qt application that needs to use libssh, a SSH client library. libssh (und开发者_运维技巧erstandably) performs its own network connections, however Qt has its own infrastructure for network connections (QTcpSocket etc).

Should I worry about these differences? Should I be trying to make libssh make network connections via QTcpSocket... Or if it works fine on the platforms I'm targeting, is that good enough?


The only downside is that you have another library that your code depends on.
The primary rule though is if it works, go with it.


I think it depends on how the abstraction you get from libssh looks like. If it is a socket-like API, you could create an QAbstractSocket implementation for it. If it is just some structure or handle to read from and write to, you could create a QIODevice subclass. Most I/O can be implemented generically operating on QIODevices (instead of explicitely operating on QFile, sockets, etc.).

0

精彩评论

暂无评论...
验证码 换一张
取 消