you can add test_encoder.cpp in mainwindow.cpp and should create a pointer of class in mainwindow.h like this:
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <rotary_encoder.h>
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
rotary_encoder *rc;
};
and use main.cpp as default:
#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}