Book Shelf
Loading...
Searching...
No Matches
bookinput.h
Go to the documentation of this file.
1
10#ifndef BOOKINPUT_H
11#define BOOKINPUT_H
12
13#include <QDialog>
14
15class QDateEdit;
16class QGridLayout;
17class QGroupBox;
18class QLineEdit;
19class QListWidget;
20class QPushButton;
21class BookTableModel;
22
28class BookInput : public QDialog
29{
30 Q_OBJECT
31public:
38 explicit BookInput(BookTableModel *model, QWidget *parent = nullptr);
39
44 ~BookInput();
45
46private slots:
51 void addAuthor();
52
57 void removeAuthor();
58
63 void saveBook();
64
69 void cancel();
70
71private:
76 void setupUI();
77
82 void setupBookGroup();
83
88 void setupAuthorGroup();
89
94 void setupButtons();
95
102 bool isValidInput();
103
104 BookTableModel *bookTableModel;
105 QLineEdit *lineEditTitle;
106 QLineEdit *lineEditIsbn;
107 QDateEdit *dateEditPublicationDate;
108 QLineEdit *lineEditFirstName;
109 QLineEdit *lineEditLastName;
110 QPushButton *pushButtonAddAuthor;
111 QListWidget *listWidgetAuthors;
112 QPushButton *pushButtonRemoveAuthor;
113 QPushButton *pushButtonSave;
114 QPushButton *pushButtonCancel;
115 QGridLayout *mainLayout;
116 QGridLayout *gridLayoutBook;
117 QGridLayout *gridLayoutAuthor;
118 QGroupBox *groupBoxBook;
119 QGroupBox *groupBoxAuthor;
120};
121
122#endif // BOOKINPUT_H
The BookInput class is a dialog that allows the user to input a new book.
Definition bookinput.h:29
BookInput(BookTableModel *model, QWidget *parent=nullptr)
Construct a new BookInput object.
Definition bookinput.cpp:27
~BookInput()
Destroy the BookInput object.
Definition bookinput.cpp:55
The BookTableModel class is a table model that stores a list of books.
Definition booktablemodel.h:23