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/*
2 * SyntaxTutor - Interactive Tutorial About Syntax Analyzers
3 * Copyright (C) 2025 Jose R. (jose-rzm)
4 *
5 * This program is free software: you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
19#ifndef LLTABLEDIALOG_H
20#define LLTABLEDIALOG_H
21
22#include <QDialog>
23#include <QGuiApplication>
24#include <QHeaderView>
25#include <QList>
26#include <QPair>
27#include <QPushButton>
28#include <QScreen>
29#include <QTableWidget>
30#include <QVBoxLayout>
31
41class LLTableDialog : public QDialog {
42 Q_OBJECT
43 public:
52 LLTableDialog(const QStringList& rowHeaders, const QStringList& colHeaders,
53 QWidget* parent,
54 QVector<QVector<QString>>* initialData = nullptr);
55
60 QVector<QVector<QString>> getTableData() const;
61
70 void setInitialData(const QVector<QVector<QString>>& data);
71
76 void highlightIncorrectCells(const QList<QPair<int, int>>& coords);
77
78 signals:
83 void submitted(const QVector<QVector<QString>>& data);
84
85 private:
86 QTableWidget* table;
87 QPushButton* submitButton;
88};
89
90#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:34
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:104
void highlightIncorrectCells(const QList< QPair< int, int > > &coords)
Highlights cells that are incorrect based on provided coordinates.
Definition lltabledialog.cpp:137
void setInitialData(const QVector< QVector< QString > > &data)
Pre-fills the table with existing user data.
Definition lltabledialog.cpp:117