37 lines
872 B
C++
37 lines
872 B
C++
// mainwindow.h - the window: tabs CONTROLLER 1..3 on top, below them the selected controller.
|
|
// The PC keyboard arrows and Enter act as the cross pad of the selected controller.
|
|
|
|
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QList>
|
|
#include <QStringList>
|
|
#include <QWidget>
|
|
|
|
class QStackedWidget;
|
|
class DeviceView;
|
|
class TabBar;
|
|
|
|
class MainWindow : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
static constexpr int Devices = 3; // tabs CONTROLLER 1..3
|
|
|
|
// ports: serial ports to preselect for CONTROLLER 1, 2, 3
|
|
MainWindow(const QStringList &ports, int baudRate, QWidget *parent = nullptr);
|
|
~MainWindow() override;
|
|
|
|
protected:
|
|
bool eventFilter(QObject *watched, QEvent *event) override;
|
|
|
|
private:
|
|
void select(int index);
|
|
|
|
TabBar *m_tabs;
|
|
QStackedWidget *m_stack;
|
|
QList<DeviceView *> m_devices;
|
|
};
|
|
|
|
#endif // MAINWINDOW_H
|