-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdialog.h
45 lines (36 loc) · 1.09 KB
/
dialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef DIALOG_H
#define DIALOG_H
#include <QtWidgets>
#include <QtSql>
#include <QtXml>
class Dialog : public QDialog
{
Q_OBJECT
public:
Dialog(QSqlRelationalTableModel *albums, QDomDocument details,
QFile *output, QWidget *parent = nullptr);
private slots:
void revert();
void submit();
private:
int addNewAlbum(const QString &title, int artistId);
int addNewArtist(const QString &name);
void addTracks(int albumId, const QStringList &tracks);
QDialogButtonBox *createButtons();
QGroupBox *createInputWidgets();
int findArtistId(const QString &artist);
static int generateAlbumId();
static int generateArtistId();
void increaseAlbumCount(QModelIndex artistIndex);
QModelIndex indexOfArtist(const QString &artist);
QSqlRelationalTableModel *model;
QDomDocument albumDetails;
QFile *outputFile;
QLineEdit *artistEditor;
QLineEdit *titleEditor;
QSpinBox *yearEditor;
QLineEdit *tracksEditor;
};
#endif