SyntaxTutor
Educational app designed to help compiler students understand LL(1) and SLR(1) parsing algorithms.
 
Loading...
Searching...
No Matches
lltabledialog.h
Go to the documentation of this file.
1#ifndef LLTABLEDIALOG_H
2#define LLTABLEDIALOG_H
3
4#include <QDialog>
5#include <QGuiApplication>
6#include <QHeaderView>
7#include <QList>
8#include <QPair>
9#include <QPushButton>
10#include <QScreen>
11#include <QTableWidget>
12#include <QVBoxLayout>
13
22class LLTableDialog : public QDialog
23{
24 Q_OBJECT
25public:
33 LLTableDialog(const QStringList &rowHeaders,
34 const QStringList &colHeaders,
35 QWidget *parent,
36 QVector<QVector<QString>> *initialData = nullptr);
37
42 QVector<QVector<QString>> getTableData() const;
43
52 void setInitialData(const QVector<QVector<QString>> &data);
53
58 void highlightIncorrectCells(const QList<QPair<int, int>> &coords);
59
60signals:
65 void submitted(const QVector<QVector<QString>> &data);
66
67private:
68 QTableWidget *table;
69 QPushButton *submitButton;
70};
71
72#endif // LLTABLEDIALOG_H
LLTableDialog(const QStringList &rowHeaders, const QStringList &colHeaders, QWidget *parent, QVector< QVector< QString > > *initialData=nullptr)
Constructs the LL(1) table dialog with given headers and optional initial data.
Definition lltabledialog.cpp:16
void submitted(const QVector< QVector< QString > > &data)
Signal emitted when the user submits the table.
QVector< QVector< QString > > getTableData() const
Returns the contents of the table filled by the user.
Definition lltabledialog.cpp:146
void highlightIncorrectCells(const QList< QPair< int, int > > &coords)
Highlights cells that are incorrect based on provided coordinates.
Definition lltabledialog.cpp:179
void setInitialData(const QVector< QVector< QString > > &data)
Pre-fills the table with existing user data.
Definition lltabledialog.cpp:159