summaryrefslogtreecommitdiffstats
path: root/examples/sql/books/bookwindow.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/sql/books/bookwindow.h')
-rw-r--r--examples/sql/books/bookwindow.h38
1 files changed, 30 insertions, 8 deletions
diff --git a/examples/sql/books/bookwindow.h b/examples/sql/books/bookwindow.h
index ba569292a6..46d3570df1 100644
--- a/examples/sql/books/bookwindow.h
+++ b/examples/sql/books/bookwindow.h
@@ -4,11 +4,15 @@
#ifndef BOOKWINDOW_H
#define BOOKWINDOW_H
-#include <QtWidgets>
-#include <QtSql>
-
-#include "ui_bookwindow.h"
-
+#include <QMainWindow>
+QT_FORWARD_DECLARE_CLASS(QComboBox)
+QT_FORWARD_DECLARE_CLASS(QGridLayout)
+QT_FORWARD_DECLARE_CLASS(QLabel)
+QT_FORWARD_DECLARE_CLASS(QLineEdit)
+QT_FORWARD_DECLARE_CLASS(QSpinBox)
+QT_FORWARD_DECLARE_CLASS(QSqlError)
+QT_FORWARD_DECLARE_CLASS(QSqlRelationalTableModel)
+QT_FORWARD_DECLARE_CLASS(QTableView)
class BookWindow: public QMainWindow
{
@@ -21,11 +25,29 @@ private slots:
private:
void showError(const QSqlError &err);
- Ui::BookWindow ui;
- QSqlRelationalTableModel *model;
- int authorIdx, genreIdx;
+ QSqlRelationalTableModel *model = nullptr;
+ int authorIdx = 0, genreIdx = 0;
+ void createLayout();
+ void createModel();
+ void configureWidgets();
+ void createMappings();
void createMenuBar();
+
+ QWidget *window = nullptr;
+
+ QGridLayout *gridLayout = nullptr;
+ QTableView *tableView = nullptr;
+ QLabel *titleLabel = nullptr;
+ QLineEdit *titleLineEdit = nullptr;
+ QLabel *authorLabel = nullptr;
+ QComboBox *authorComboBox = nullptr;
+ QLabel *genreLabel = nullptr;
+ QComboBox *genreComboBox = nullptr;
+ QLabel *yearLabel = nullptr;
+ QSpinBox *yearSpinBox = nullptr;
+ QLabel *ratingLabel = nullptr;
+ QComboBox *ratingComboBox = nullptr;
};
#endif