src/docs.cpp

changeset 493
16766ac1bbd9
parent 455
c5d14d112034
child 541
0e38beeb050a
equal deleted inserted replaced
492:e964085e6913 493:16766ac1bbd9
23 #include "common.h" 23 #include "common.h"
24 #include "types.h" 24 #include "types.h"
25 25
26 // ============================================================================= 26 // =============================================================================
27 // ----------------------------------------------------------------------------- 27 // -----------------------------------------------------------------------------
28 class DocumentViewer : public QDialog { 28 class DocumentViewer : public QDialog
29 public: 29 { public:
30 explicit DocumentViewer (QWidget* parent = null, Qt::WindowFlags f = 0) : QDialog (parent, f) { 30 explicit DocumentViewer (QWidget* parent = null, Qt::WindowFlags f = 0) : QDialog (parent, f)
31 te_text = new QTextEdit (this); 31 { te_text = new QTextEdit (this);
32 te_text->setMinimumSize (QSize (400, 300)); 32 te_text->setMinimumSize (QSize (400, 300));
33 te_text->setReadOnly (true); 33 te_text->setReadOnly (true);
34 34
35 QDialogButtonBox* bbx_buttons = new QDialogButtonBox (QDialogButtonBox::Close); 35 QDialogButtonBox* bbx_buttons = new QDialogButtonBox (QDialogButtonBox::Close);
36 QVBoxLayout* layout = new QVBoxLayout (this); 36 QVBoxLayout* layout = new QVBoxLayout (this);
37 layout->addWidget (te_text); 37 layout->addWidget (te_text);
38 layout->addWidget (bbx_buttons); 38 layout->addWidget (bbx_buttons);
39 39
40 connect (bbx_buttons, SIGNAL (rejected()), this, SLOT (reject())); 40 connect (bbx_buttons, SIGNAL (rejected()), this, SLOT (reject()));
41 } 41 }
42 42
43 void setText (const char* text) { 43 void setText (const char* text)
44 te_text->setText (text); 44 { te_text->setText (text);
45 } 45 }
46 46
47 private: 47 private:
48 QTextEdit* te_text; 48 QTextEdit* te_text;
49 }; 49 };
50 50
51 const char* g_docs_overlays = 51 const char* g_docs_overlays =
52 "<h1>Overlay images</h1><br />" 52 "<h1>Overlay images</h1><br />"
53 "<p>" APPNAME " supports drawing transparent images over the part model. This " 53 "<p>" APPNAME " supports drawing transparent images over the part model. This "
63 "<p>Finally, use the \"Set Overlay Image\" dialog and fill in the details. The " 63 "<p>Finally, use the \"Set Overlay Image\" dialog and fill in the details. The "
64 "overlay image should then be ready for use."; 64 "overlay image should then be ready for use.";
65 65
66 // ============================================================================= 66 // =============================================================================
67 // ----------------------------------------------------------------------------- 67 // -----------------------------------------------------------------------------
68 void showDocumentation (const char* text) { 68 void showDocumentation (const char* text)
69 DocumentViewer dlg; 69 { DocumentViewer dlg;
70 dlg.setText (text); 70 dlg.setText (text);
71 dlg.exec(); 71 dlg.exec();
72 } 72 }

mercurial