| 1 | // |
| 2 | // help.cpp - Built-in help file |
| 3 | // |
| 4 | // by James Hammons |
| 5 | // (C) 2011 Underground Software |
| 6 | // |
| 7 | // JLH = James Hammons <jlhamm@acm.org> |
| 8 | // |
| 9 | // Who When What |
| 10 | // --- ---------- ------------------------------------------------------------ |
| 11 | // JLH 08/01/2011 Created this file |
| 12 | // JLH 10/08/2011 Added Esc & Return as exit keys |
| 13 | // |
| 14 | |
| 15 | // STILL TO DO: |
| 16 | // |
| 17 | |
| 18 | #include "help.h" |
| 19 | |
| 20 | |
| 21 | HelpWindow::HelpWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog) |
| 22 | { |
| 23 | setWindowTitle(tr("Virtual Jaguar Help")); |
| 24 | |
| 25 | // Need to set the size as well... |
| 26 | resize(560, 480); |
| 27 | |
| 28 | layout = new QVBoxLayout(); |
| 29 | // layout->setSizeConstraint(QLayout::SetFixedSize); |
| 30 | setLayout(layout); |
| 31 | |
| 32 | text = new QTextBrowser; |
| 33 | text->setSource(QUrl("qrc:/res/help.html")); |
| 34 | layout->addWidget(text); |
| 35 | } |
| 36 | |
| 37 | void HelpWindow::keyPressEvent(QKeyEvent * e) |
| 38 | { |
| 39 | if (e->key() == Qt::Key_Escape || e->key() == Qt::Key_Return) |
| 40 | hide(); |
| 41 | } |