• Stars
    star
    401
  • Rank 107,625 (Top 3 %)
  • Language
    C++
  • License
    GNU Lesser Genera...
  • Created over 10 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A cross-platform USB Module for Qt.

QtUsb GitHub version Total alerts Language grade: C/C++

GCC: Build Status
MSVC: Build status

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 page or appveyor build artifacts for binary archives

Build

Unix
You need libusb-1.0-0-dev, libhidapi-dev and pkg-config packages installed

mkdir build && cd build
qmake ..
make install

Alternatively build as static module (best for portability)

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

Downloads

Ubuntu PPA Windows binaries are in the releases section.

More Repositories

1

qtcreator-doxygen

Doxygen Plugin for Qt Creator
C++
193
star
2

QStlink2

Cross-platform STLink v2 GUI
C
187
star
3

Qt5-MSVC-Static

Batch scripts that download and build static Qt5 libs on Windows.
M4
113
star
4

MotoLink

K-line/Serial/CAN interface and fuel mapper for motorcycles.
C++
79
star
5

ChibiOS-Examples

Examples for using ChibiOS and its GFX extension (outdated)
C
26
star
6

appwrite-helm

Helm repo url: https://fpoussin.github.io/appwrite-helm
Smarty
16
star
7

OpenTCS

Open source traction control and strain gauge quickshifter for race bikes.
C
15
star
8

OWBC

Open source/hardware LSU 4.9 wideband controller
C
15
star
9

ChibiOS-Bootloader

ChibiOS based USB bootloader. (Outdated, see fpoussin/Motolink for examples)
C
13
star
10

pcb2jlc

Scripts to generate PCB assembly BOM/CPL from various EDAs
Python
5
star
11

nhost-helm

Helm repo url: https://fpoussin.github.io/nhost-helm
Smarty
5
star
12

mcu-knock-vr

MCU based Knock and VR sensor interface - powered by STM32F3
C
5
star
13

ChibiOS-Gwen

Gwen integration into ChibiOS
C++
3
star
14

OBDGate

ELM327 compatible interface for motorcycle diagnostic interfaces (Honda, Kawasaki)
Eagle
3
star
15

OVRI

Open source/hardware MCU based VR Sensor interface
Eagle
3
star
16

OpenQS

OSHW quick-shifter.
C
3
star
17

emstune

C++
2
star
18

UniTuner

C++
2
star
19

OpenTPU

Open source Timer processor built on top on a standard MCU. (Work in progress)
2
star
20

esp-binutils

C
1
star
21

QtRencode

Qt Rencode serialisation library based on QVariants. Untested.
C++
1
star
22

fpoussin

1
star
23

ubuntu-mainline-build

Python script that download and build Ubuntu mainline kernels with optional patches
Python
1
star
24

cm4-dsp-lib

C
1
star
25

OpenFlexFuel

Open hardware flex fuel controller
C
1
star
26

dockerfiles

Various docker files for my projects
Dockerfile
1
star