Engauge Digitizer  2
Public Member Functions | List of all members
HelpWindow Class Reference

Dockable help window. More...

#include <HelpWindow.h>

Inheritance diagram for HelpWindow:
Inheritance graph
Collaboration diagram for HelpWindow:
Collaboration graph

Public Member Functions

 HelpWindow (QWidget *parent)
 Single constructor. More...
 

Detailed Description

Dockable help window.

Despite a lot of work trying to work with the OSX sandbox, support for the sandbox was never completed since QHelpEngine requires WRITE-access to the collection file. Even trying to create a temporary directory does not work since copying would involve QHelpEngine::copyCollectionFile which copys from the CURRENT collection file (versus just some arbitrary file name)

Definition at line 16 of file HelpWindow.h.

Constructor & Destructor Documentation

◆ HelpWindow()

HelpWindow::HelpWindow ( QWidget *  parent)

Single constructor.

Definition at line 22 of file HelpWindow.cpp.

22  :
23  QDockWidget (parent)
24 {
25  setMinimumWidth (MIN_WIDTH);
26  setMinimumHeight (MIN_HEIGHT);
27 
28 #if !defined(OSX_DEBUG) && !defined(OSX_RELEASE)
29  QHelpEngine *helpEngine = new QHelpEngine (helpPath());
30  helpEngine->setupData();
31 
32  QTabWidget *tabs = new QTabWidget;
33  tabs->addTab (helpEngine->contentWidget(),
34  tr ("Contents"));
35  tabs->addTab (helpEngine->indexWidget(),
36  tr ("Index"));
37 
38  HelpBrowser *browser = new HelpBrowser (helpEngine);
39 
40  // URL is constructed from <namespace>, <virtualFolder> and <file> in engauge.qhp. If this line shows
41  // the error message 'QTextBrowser: No document for qthelp...' then one of the following applies:
42  // (1) the qhc file has not been built and put into the bin/documentation folder
43  // (2) in qtcreator the build is getting put into some directory other than engauge-digitizer/bin
44  browser->setSource (QUrl ("qthelp://engaugedigitizer.net/doc/index.html"));
45 
46  connect (helpEngine->contentWidget (), SIGNAL (linkActivated (QUrl)), browser, SLOT (setSource (QUrl)));
47  connect (helpEngine->indexWidget (), SIGNAL (linkActivated (QUrl, QString)), browser, SLOT (setSource (QUrl)));
48 
49  QSplitter *splitter = new QSplitter (Qt::Horizontal);
50  splitter->insertWidget (0, tabs);
51  splitter->insertWidget (1, browser);
52 
53  setWidget (splitter);
54 #endif
55 }
Text browser with resource loading enhanced for use as help text browser.
Definition: HelpBrowser.h:15
const int MIN_HEIGHT
Definition: HelpWindow.cpp:20
const int MIN_WIDTH
Definition: HelpWindow.cpp:19

The documentation for this class was generated from the following files: