src/documentation.cpp

changeset 1217
314e12e23c3a
parent 984
a7b6f987d269
child 1222
34def2630300
equal deleted inserted replaced
1216:12f9ea615cbc 1217:314e12e23c3a
26 // ============================================================================= 26 // =============================================================================
27 // ============================================================================= 27 // =============================================================================
28 class DocumentViewer : public QDialog 28 class DocumentViewer : public QDialog
29 { 29 {
30 public: 30 public:
31 explicit DocumentViewer (QWidget* parent = nullptr, Qt::WindowFlags f = 0) : QDialog (parent, f) 31 explicit DocumentViewer(QWidget* parent = nullptr, Qt::WindowFlags f = 0) : QDialog(parent, f)
32 { 32 {
33 te_text = new QTextEdit (this); 33 te_text = new QTextEdit(this);
34 te_text->setMinimumSize (QSize (400, 300)); 34 te_text->setMinimumSize(QSize(400, 300));
35 te_text->setReadOnly (true); 35 te_text->setReadOnly(true);
36 36
37 QDialogButtonBox* bbx_buttons = new QDialogButtonBox (QDialogButtonBox::Close); 37 QDialogButtonBox* bbx_buttons = new QDialogButtonBox(QDialogButtonBox::Close);
38 QVBoxLayout* layout = new QVBoxLayout (this); 38 QVBoxLayout* layout = new QVBoxLayout(this);
39 layout->addWidget (te_text); 39 layout->addWidget(te_text);
40 layout->addWidget (bbx_buttons); 40 layout->addWidget(bbx_buttons);
41 41
42 connect (bbx_buttons, SIGNAL (rejected()), this, SLOT (reject())); 42 connect(bbx_buttons, SIGNAL(rejected()), this, SLOT(reject()));
43 } 43 }
44 44
45 void setText (const char* text) 45 void setText(const char* text)
46 { 46 {
47 te_text->setText (text); 47 te_text->setText(text);
48 } 48 }
49 49
50 private: 50 private:
51 QTextEdit* te_text; 51 QTextEdit* te_text;
52 }; 52 };
66 "<p>Finally, use the \"Set Overlay Image\" dialog and fill in the details. The " 66 "<p>Finally, use the \"Set Overlay Image\" dialog and fill in the details. The "
67 "overlay image should then be ready for use."; 67 "overlay image should then be ready for use.";
68 68
69 // ============================================================================= 69 // =============================================================================
70 // ============================================================================= 70 // =============================================================================
71 void showDocumentation (const char* text) 71 void showDocumentation(const char* text)
72 { 72 {
73 DocumentViewer dlg; 73 DocumentViewer dlg;
74 dlg.setText (text); 74 dlg.setText(text);
75 dlg.exec(); 75 dlg.exec();
76 } 76 }

mercurial