# QtUsb [![GitHub version](https://badge.fury.io/gh/fpoussin%2Fqtusb.svg)](https://badge.fury.io/gh/fpoussin%2Fqtusb) [![Total alerts](https://img.shields.io/lgtm/alerts/g/fpoussin/QtUsb.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/fpoussin/QtUsb/alerts/) [![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/fpoussin/QtUsb.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/fpoussin/QtUsb/context:cpp)
GCC: [![Build Status](https://jenkins.netyxia.net/buildStatus/icon?job=QtUsb%2Fmaster)](https://jenkins.netyxia.net/blue/organizations/jenkins/QtUsb/branches/)
MSVC: [![Build status](https://ci.appveyor.com/api/projects/status/4ns2jbdoveyj8n0y?svg=true)](https://ci.appveyor.com/project/fpoussin/qtusb)
A Cross-platform USB Module for Qt built around libusb-1.0 and libhidapi
Can be used as a library, or included directly into the project
## Features
- Bulk transfer
- Interrupt transfer
- Hotplug detection
- Device enumeration and filtering
- HID
## Install library
**Ubuntu** (stable versions only)
```
sudo add-apt-repository ppa:fpoussin/ppa
sudo apt install libqt5usb5 libqt5usb5-dev
```
**Windows**
Check the [releases](https://github.com/fpoussin/QtUsb/releases) page or [appveyor build artifacts](https://ci.appveyor.com/project/fpoussin/qtusb) for binary archives
## Build
**Unix**
You need libusb-1.0-0-dev, libhidapi-dev and pkg-config packages installed
```shell
mkdir build && cd build
qmake ..
make install
```
Alternatively build as static module (best for portability)
```shell
mkdir build && cd build
qmake CONFIG+=qtusb-static ..
make install
```
**MSVC**
You need the Windows SDKs to compile libusb
These are available from the Visual Studio Installer
The following script builds and deploys QtUsb into your Qt installation
```
build_msvc.bat 2017|2019 x64|x86 module|static QT_PATH
ie: build_msvc.bat 2017 x64 static C:\Qt\5.14.1\msvc2017_64
```
**Qt Creator**
The module can also be built normally within QT creator regardless of the platform.
All dependencies are built with qmake.
## Using
**Option 1: Using the module (static or dynamic)**
You'll need to add the module to your project file:
```
qt += usb
```
Include headers:
```
#include <QUsbDevice>
#include <QUsbEndpoint>
```
**Option 2: Importing the code in your project**
This will tie your app to a specific Qt version as it uses private headers
You need to include the pri file into your qmake file:
```
include(QtUsb/src/usb/files.pri)
```
Include headers:
```
#include "qusbdevice.h"
#include "qusbendpoint.h"
```
## Documentation
QCH files can be found with each release, they are also included in ubuntu packages.
You have to manually install them in Qt Creator on Windows.
Online documentation can be found here: https://fpoussin.github.io/doxygen/qtusb/0.6.x/
## Downloads
[Ubuntu PPA](https://launchpad.net/~fpoussin/+archive/ubuntu/ppa)
Windows binaries are [in the releases section](https://github.com/fpoussin/QtUsb/releases).
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
QtUsb GCC: MSVC: 基于libusb-1.0和libhidapi构建的Qt跨平台USB模块可以用作库,也可以直接包含在项目中 产品特点 批量转移 中断传输 热插拔检测 设备枚举和过滤 HID 安装库 Ubuntu (仅稳定版本) sudo add-apt-repository ppa:fpoussin/ppa sudo apt install libqt5usb5 libqt5usb5-dev 视窗检查页面或以获取二进制归档文件 建立 的Unix 您需要安装libusb-1.0-0-dev,libhidapi-dev和pkg-config软件包 mkdir build
资源详情
资源评论
资源推荐
收起资源包目录
QtUsb-master.zip (74个子文件)
QtUsb-master
.travis.yml 255B
.gitmodules 162B
make_deb.py 6KB
Jenkinsfile 1KB
.github
ISSUE_TEMPLATE
bug_report.md 524B
feature_request.md 606B
tests
auto
cmake
cmake.pro 109B
qhiddevice
qhiddevice.pro 102B
tst_qhiddevice.cpp 308B
qusb
qusb.pro 90B
tst_qusb.cpp 697B
auto.pro 76B
qusbendpoint
tst_qusbendpoint.cpp 2KB
qusbendpoint.pro 106B
qusbdevice
tst_qusbdevice.cpp 2KB
qusbdevice.pro 102B
tests.pro 35B
.qmake.conf 117B
LICENSE 7KB
debian
control 984B
qtusb-docs.docs 35B
compat 3B
libqt5usb5.install 24B
copyright 2B
changelog_template 139B
rules 917B
libqt5usb5-dev.install 428B
source
format 13B
appveyor.yml 2KB
src
src.pro 34B
deps
msvc
config.h 2KB
usb
qusb.cpp 14KB
qusbendpoint_p.h 1KB
qusb.h 2KB
qhiddevice.cpp 4KB
files.pri 3KB
usb.pro 400B
qhiddevice.h 889B
doc
style
style.css 2KB
src
qtusb-module.qdoc 2KB
qtusb-examples.qdoc 2KB
qtusb.qdocconf 1KB
qusbendpoint.cpp 19KB
qusbdevice.h 3KB
qhiddevice_p.h 363B
qusbendpoint.h 3KB
qusb_p.h 498B
qusbdevice.cpp 13KB
qusbdevice_p.h 817B
hidapi
.clang-format 3KB
libusb
sync.profile 136B
examples
examples.pro 40B
usb
SimpleBulkTransfer
usbexample.h 923B
SimpleBulkTransfer.pro 381B
main.cpp 391B
usbexample.cpp 3KB
ListDevices
usbexample.h 265B
ListDevices.pro 367B
main.cpp 200B
usbexample.cpp 229B
usb.pro 81B
UsbNotifications
usbexample.h 386B
UsbNotifications.pro 377B
main.cpp 205B
usbexample.cpp 635B
Hid
Hid.pro 351B
hidexample.cpp 1KB
main.cpp 376B
hidexample.h 444B
.gitignore 181B
QtUsb.pro 279B
build_msvc.bat 2KB
README.md 3KB
.gitattributes 89B
共 74 条
- 1
Mika.w
- 粉丝: 35
- 资源: 4590
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 技术资料分享TF卡资料很好的技术资料.zip
- 技术资料分享TF介绍很好的技术资料.zip
- 10、安徽省大学生学科和技能竞赛A、B类项目列表(2019年版).xlsx
- 9、教育主管部门公布学科竞赛(2015版)-方喻飞
- C语言-leetcode题解之83-remove-duplicates-from-sorted-list.c
- C语言-leetcode题解之79-word-search.c
- C语言-leetcode题解之78-subsets.c
- C语言-leetcode题解之75-sort-colors.c
- C语言-leetcode题解之74-search-a-2d-matrix.c
- C语言-leetcode题解之73-set-matrix-zeroes.c
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论2