#ifndef EXPERTSCREENCONNWIN_H
#define EXPERTSCREENCONNWIN_H

#include <QTableWidget>
#include <QSpinBox>
#include <QButtonGroup>

class CardTable;
class ExpertScreenConnWin : public QWidget {
    Q_OBJECT
public:
    explicit ExpertScreenConnWin(QWidget *parent = nullptr);
    void conn(int row, int column);
    void connBack();
    QButtonGroup *fdNet;
    QSpinBox *fdCardWidth;
    QSpinBox *fdCardHeight;
    CardTable *table;
    QList<QList<QPoint>> netss{QList<QPoint>{}, QList<QPoint>{}, QList<QPoint>{}, QList<QPoint>{}};
};

class CardTable : public QTableWidget {
public:
    explicit CardTable(QWidget *parent = nullptr) : QTableWidget{parent} {}
    CardTable(int rows, int columns, QWidget *parent = nullptr) : QTableWidget{rows, columns, parent} {}
    ExpertScreenConnWin *win;
private:
    void DrawLineWithArrow(QPainter& painter, QPen pen, QPoint start, QPoint end);

protected:
    void paintEvent(QPaintEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
};

#endif // EXPERTSCREENCONNWIN_H
