src/documentation.cc

branch
projects
changeset 935
8d98ee0dc917
parent 930
ab77deb851fa
parent 934
be8128aff739
child 936
aee883858c90
equal deleted inserted replaced
930:ab77deb851fa 935:8d98ee0dc917
1 /*
2 * LDForge: LDraw parts authoring CAD
3 * Copyright (C) 2013 - 2015 Teemu Piippo
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it 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 <http://www.gnu.org/licenses/>.
17 */
18
19 #include <QDialog>
20 #include <QTextEdit>
21 #include <QDialogButtonBox>
22 #include <QBoxLayout>
23 #include "main.h"
24 #include "basics.h"
25
26 // =============================================================================
27 // =============================================================================
28 class DocumentViewer : public QDialog
29 {
30 public:
31 explicit DocumentViewer (QWidget* parent = null, Qt::WindowFlags f = 0) : QDialog (parent, f)
32 {
33 te_text = new QTextEdit (this);
34 te_text->setMinimumSize (QSize (400, 300));
35 te_text->setReadOnly (true);
36
37 QDialogButtonBox* bbx_buttons = new QDialogButtonBox (QDialogButtonBox::Close);
38 QVBoxLayout* layout = new QVBoxLayout (this);
39 layout->addWidget (te_text);
40 layout->addWidget (bbx_buttons);
41
42 connect (bbx_buttons, SIGNAL (rejected()), this, SLOT (reject()));
43 }
44
45 void setText (const char* text)
46 {
47 te_text->setText (text);
48 }
49
50 private:
51 QTextEdit* te_text;
52 };
53
54 const char* g_docs_overlays =
55 "<h1>Overlay images</h1><br />"
56 "<p>" APPNAME " supports drawing transparent images over the part model. This "
57 "can be used to have, for instance, a photo of the part overlaid on top of the "
58 "model and use it for drawing curves somewhat accurately.</p>"
59 "<p>For this purpose, a specific photo has to be taken of the part; it should "
60 "represent the part as true as possible to the actual camera used for editing. "
61 "The image should be taken from straight above the part, at as an orthogonal "
62 "angle as possible. It is recommended to take a lot of pictures this way and "
63 "select the best candidate.</p>"
64 "<p>The image should then be cropped with the knowledge of the image's LDU "
65 "dimensions in mind. The offset should then be identified in the image in pixels.</p>"
66 "<p>Finally, use the \"Set Overlay Image\" dialog and fill in the details. The "
67 "overlay image should then be ready for use.";
68
69 // =============================================================================
70 // =============================================================================
71 void showDocumentation (const char* text)
72 {
73 DocumentViewer dlg;
74 dlg.setText (text);
75 dlg.exec();
76 }

mercurial