mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
extern "C"
{
#include <libusb-1.0/libusb.h>
}
namespace Ui {
class MainWindow;
}
{
Q_OBJECT
public:
explicit MainWindow
(QWidget *parent
= 0);
~MainWindow();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
extern "C"
{
#include <libusb-1.0/libusb.h>
}
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
To copy to clipboard, switch view to plain text mode
mainwindow.cpp
#include "mainwindow.h"
#include "ui_mainwindow.h"
extern "C"
{
#include <libusb-1.0/libusb.h>
}
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
#include "mainwindow.h"
#include "ui_mainwindow.h"
extern "C"
{
#include <libusb-1.0/libusb.h>
}
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
To copy to clipboard, switch view to plain text mode
main.c
#include "mainwindow.h"
#include <QApplication>
extern "C"
{
#include <libusb-1.0/libusb.h>
}
int main(int argc, char *argv[])
{
MainWindow w;
libusb_context ctx;
libusb_init( &ctx );
w.show();
return a.exec();
}
#include "mainwindow.h"
#include <QApplication>
extern "C"
{
#include <libusb-1.0/libusb.h>
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
libusb_context ctx;
libusb_init( &ctx );
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
test_libusb.pro
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = test_libusb
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
LIBS += -lusb-1.0
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = test_libusb
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
LIBS += -lusb-1.0
To copy to clipboard, switch view to plain text mode
Bookmarks