src/widgets/headeredit.h

Thu, 21 Jun 2018 18:46:03 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Thu, 21 Jun 2018 18:46:03 +0300
changeset 1417
ed39bfca7a67
parent 1326
69a90bd2dba2
permissions
-rw-r--r--

refactored the segments/divisions editor in MainWindow to a new widget

1302
e14d7826373a added license headers
Teemu Piippo <teemu@hecknology.net>
parents: 1292
diff changeset
1 /*
e14d7826373a added license headers
Teemu Piippo <teemu@hecknology.net>
parents: 1292
diff changeset
2 * LDForge: LDraw parts authoring CAD
1326
69a90bd2dba2 Happy new year 2018
Teemu Piippo <teemu@hecknology.net>
parents: 1306
diff changeset
3 * Copyright (C) 2013 - 2018 Teemu Piippo
1302
e14d7826373a added license headers
Teemu Piippo <teemu@hecknology.net>
parents: 1292
diff changeset
4 *
e14d7826373a added license headers
Teemu Piippo <teemu@hecknology.net>
parents: 1292
diff changeset
5 * This program is free software: you can redistribute it and/or modify
e14d7826373a added license headers
Teemu Piippo <teemu@hecknology.net>
parents: 1292
diff changeset
6 * it under the terms of the GNU General Public License as published by
e14d7826373a added license headers
Teemu Piippo <teemu@hecknology.net>
parents: 1292
diff changeset
7 * the Free Software Foundation, either version 3 of the License, or
e14d7826373a added license headers
Teemu Piippo <teemu@hecknology.net>
parents: 1292
diff changeset
8 * (at your option) any later version.
e14d7826373a added license headers
Teemu Piippo <teemu@hecknology.net>
parents: 1292
diff changeset
9 *
e14d7826373a added license headers
Teemu Piippo <teemu@hecknology.net>
parents: 1292
diff changeset
10 * This program is distributed in the hope that it will be useful,
e14d7826373a added license headers
Teemu Piippo <teemu@hecknology.net>
parents: 1292
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e14d7826373a added license headers
Teemu Piippo <teemu@hecknology.net>
parents: 1292
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e14d7826373a added license headers
Teemu Piippo <teemu@hecknology.net>
parents: 1292
diff changeset
13 * GNU General Public License for more details.
e14d7826373a added license headers
Teemu Piippo <teemu@hecknology.net>
parents: 1292
diff changeset
14 *
e14d7826373a added license headers
Teemu Piippo <teemu@hecknology.net>
parents: 1292
diff changeset
15 * You should have received a copy of the GNU General Public License
e14d7826373a added license headers
Teemu Piippo <teemu@hecknology.net>
parents: 1292
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
e14d7826373a added license headers
Teemu Piippo <teemu@hecknology.net>
parents: 1292
diff changeset
17 */
e14d7826373a added license headers
Teemu Piippo <teemu@hecknology.net>
parents: 1292
diff changeset
18
1291
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
19 #pragma once
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
20 #include <QWidget>
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
21 #include "../lddocument.h"
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
22
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
23 class HeaderEdit : public QWidget
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
24 {
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
25 Q_OBJECT
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
26
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
27 public:
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
28 HeaderEdit(QWidget* parent = nullptr);
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
29 ~HeaderEdit();
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
30
1306
be85306198a2 red/green view rework complete
Teemu Piippo <teemu@hecknology.net>
parents: 1302
diff changeset
31 void setDocument(LDDocument* document);
1291
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
32 bool hasValidHeader() const;
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
33
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
34 signals:
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
35 void descriptionChanged(const QString& newDescription);
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
36
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
37 private:
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
38 class Ui_HeaderEdit& ui;
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
39 class HeaderHistoryModel* headerHistoryModel = nullptr;
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
40 LDHeader* m_header = nullptr;
1306
be85306198a2 red/green view rework complete
Teemu Piippo <teemu@hecknology.net>
parents: 1302
diff changeset
41 Model* m_model = nullptr;
1292
66d2050d3bd9 Part history can now be edited
Teemu Piippo <teemu@hecknology.net>
parents: 1291
diff changeset
42
66d2050d3bd9 Part history can now be edited
Teemu Piippo <teemu@hecknology.net>
parents: 1291
diff changeset
43 void moveRows(int direction);
1291
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
44 };

mercurial