21 const QString& strFileName,
25 QPushButton* pcmdBack =
new QPushButton(
"<<");
26 QPushButton* pcmdHome =
new QPushButton(
"Home");
27 QPushButton* pcmdForward =
new QPushButton(
">>");
28 QTextBrowser* ptxtBrowser =
new QTextBrowser;
30 connect(pcmdBack, SIGNAL(clicked()),
31 ptxtBrowser, SLOT(backward())
33 connect(pcmdHome, SIGNAL(clicked()),
34 ptxtBrowser, SLOT(home())
36 connect(pcmdForward, SIGNAL(clicked()),
37 ptxtBrowser, SLOT(forward())
39 connect(ptxtBrowser, SIGNAL(backwardAvailable(
bool)),
40 pcmdBack, SLOT(setEnabled(
bool))
42 connect(ptxtBrowser, SIGNAL(forwardAvailable(
bool)),
43 pcmdForward, SLOT(setEnabled(
bool))
46 ptxtBrowser->setSearchPaths(QStringList() << strPath);
47 ptxtBrowser->setSource(QString(strFileName));
50 QVBoxLayout* pvbxLayout =
new QVBoxLayout;
51 QHBoxLayout* phbxLayout =
new QHBoxLayout;
52 phbxLayout->addWidget(pcmdBack);
53 phbxLayout->addWidget(pcmdHome);
54 phbxLayout->addWidget(pcmdForward);
55 pvbxLayout->addLayout(phbxLayout);
56 pvbxLayout->addWidget(ptxtBrowser);
57 setLayout(pvbxLayout);
HelpBrowser(const QString &strPath, const QString &strFileName, QWidget *pwgt=0)