itom 2.0.0
ito::HelpTreeDockWidget Class Reference

List of all members.

Classes

struct  DisplayBool
struct  SqlItem

Public Types

enum  itemType {
  typeSqlItem = 1, typeFilter = 2, typeWidget = 3, typeFPlugin = 4,
  typeWPlugin = 5, typeCategory = 6, typeDataIO = 7, typeActuator = 8
}

Public Slots

void navigateBackwards ()
void navigateForwards ()
void expandTree ()
void collapseTree ()
void reloadDB ()
 Reload Database and clear search-edit and start the new Thread.
void liveFilter (const QString &filterText)
 slot invoked by toolbar
void showTreeview ()
void unshowTreeview ()
void propertiesChanged ()
 Load SQL-DatabasesList in m_ Variable when properties changed.
void showPluginInfo (const QString &name, int type, const QModelIndex &modelIndex, bool fromLink)
 slot invoked by different widgets to display a help page from extern
ito::RetVal showFilterWidgetPluginHelp (const QString &filtername, itemType type)
 Get the DocString from a Filter and parse is to html.

Public Member Functions

 HelpTreeDockWidget (QWidget *parent, ito::AbstractDockWidget *dock=0, Qt::WindowFlags flags=0)

Protected Member Functions

bool eventFilter (QObject *obj, QEvent *event)
 Filter the events for showing and hiding the treeview.

Private Slots

void on_splitter_splitterMoved (int pos, int index)
void on_textBrowser_anchorClicked (const QUrl &link)
void dbLoaderFinished (int index)
 This slot is called when the loading thread is finished.
void on_treeView_expanded (const QModelIndex &index)
void on_treeView_collapsed (const QModelIndex &index)
void selectedItemChanged (const QModelIndex &current, const QModelIndex &previous)

Private Member Functions

void CreateItem (QStandardItemModel &model, QStringList &items)
void saveIni ()
 Save Gui positions to Main-ini-File.
void loadIni ()
 Load Gui positions to Main-ini-File.
ito::RetVal displayHelp (const QString &path)
 Displayes the help text in the textbrowser after an element from the tree was clicked.
QStringList separateLink (const QUrl &link)
 Returns a list containing the protocol[0] and the real link[1].
ito::RetVal highlightContent (const QString &prefix, const QString &name, const QString &param, const QString &shortDesc, const QString &helpText, const QString &error, QTextDocument *document)
QModelIndex findIndexByPath (const int type, QStringList path, const QStandardItem *current)
 finds a Modelindex related to MainModel (not FilterModel)belonging to an Itemname
QString parseFilterWidgetContent (const QString &input)
 Reformats all help strings that come from the widgets and plugins.
ito::RetVal parseParamVector (const QString &sectionname, const QVector< ito::Param > &paramVector, QString &content)
 Creates the Parameter- and Return- sections in html-Code.
QString parseParam (const QString &tmpl, const ito::Param &param)
 Parses a single Parameter to html code (called by parseParamVector)
QString minText (int minimum) const
 This function detects if a range minimum of a variable is equal to the minimum of the type.
QString minText (double minimum) const
 This function detects if a range minimum of a variable is equal to the minimum of the type.
QString minText (char minimum) const
 This function detects if a range minimum of a variable is equal to the minimum of the type.
QString maxText (int minimum) const
 This function detects if a range maximum of a variable is equal to the maximum of the type.
QString maxText (double minimum) const
 This function detects if a range maximum of a variable is equal to the maximum of the type.
QString maxText (char minimum) const
 This function detects if a range maximum of a variable is equal to the maximum of the type.

Static Private Member Functions

static void createFilterWidgetNode (int fOrW, QStandardItemModel *model, const QMap< int, QIcon > *iconGallery)
 Get The Filters and put them into a node of the Tree.
static void createItemRek (QStandardItem &parent, const QString &parentPath, QList< SqlItem > &items, const QMap< int, QIcon > *iconGallery)
 Creates the model (tree) from the given data.
static ito::RetVal loadDBinThread (const QString &path, const QStringList &includedDBs, QStandardItemModel *mainModel, const QMap< int, QIcon > *iconGallery, const DisplayBool &show)
 Load the Databases in different Thread.
static ito::RetVal readSQL (const QString &file, QList< SqlItem > &items)
 Get Data from SQL File and store it in a table.

Private Attributes

QFutureWatcher< ito::RetValdbLoaderWatcher
Ui::HelpTreeDockWidget ui
QStandardItemModel * m_pMainModel
LeafFilterProxyModelm_pMainFilterModel
ito::AbstractDockWidgetm_pParent
QList< QModelIndex > m_history
QStringList m_includedDBs
QString m_dbPath
QMovie * m_previewMovie
QMap< int, QIcon > m_iconGallery
DisplayBool m_showSelection
int m_historyIndex
int m_autoCollTime
double m_percWidthVi
double m_percWidthUn
bool m_treeVisible
bool m_plaintext
bool m_openLinks
bool m_autoCollTree
bool m_forced
bool m_internalCall

Static Private Attributes

static const int m_urPath = Qt::UserRole + 1
static const int m_urType = Qt::UserRole + 2

Member Function Documentation

void ito::HelpTreeDockWidget::createFilterWidgetNode ( int  fOrW,
QStandardItemModel *  model,
const QMap< int, QIcon > *  iconGallery 
) [static, private]

Get The Filters and put them into a node of the Tree.

Parameters:
fOrW
model
iconGallery
void ito::HelpTreeDockWidget::createItemRek ( QStandardItem &  parent,
const QString &  parentPath,
QList< SqlItem > &  items,
const QMap< int, QIcon > *  iconGallery 
) [static, private]

Creates the model (tree) from the given data.

The function is recursiv. It always calles itself with the rest of the list that is not in the tree yet.

Parameters:
parentparent that might have children. This function is going to find them and add them from the list.
parentPathabsolute path of the parent
itemslist of all sql items that are not processed yet
iconGalleryGallery with icons for classes, modules etc.
void ito::HelpTreeDockWidget::dbLoaderFinished ( int  index) [private, slot]

This slot is called when the loading thread is finished.

When this slot is called, the database is loaded and the main model created

See also:
reloadDB, loadDBinThread
ito::RetVal ito::HelpTreeDockWidget::displayHelp ( const QString &  path) [private]

Displayes the help text in the textbrowser after an element from the tree was clicked.

This function looks for a entry in the database that is specified by the path parameter. This text is afterwards passed to all the different parser functions in this class.

Parameters:
pathPath to the entry, read from the model.
bool ito::HelpTreeDockWidget::eventFilter ( QObject *  obj,
QEvent *  event 
) [protected]

Filter the events for showing and hiding the treeview.

Parameters:
event
Returns:
bool
QModelIndex ito::HelpTreeDockWidget::findIndexByPath ( const int  type,
QStringList  path,
const QStandardItem *  current 
) [private]

finds a Modelindex related to MainModel (not FilterModel)belonging to an Itemname

Parameters:
typeof the item (for more information see type enumeration in header file)
pathpath to the item splitted into a list
currentitem whose children are searched
Returns:
QModelIndex
void ito::HelpTreeDockWidget::liveFilter ( const QString &  filterText) [slot]

slot invoked by toolbar

This is the Slot is called by the toolbar when the user enters a filter into the search edit.

Parameters:
filterTextthe text that the model is filtered with.
ito::RetVal ito::HelpTreeDockWidget::loadDBinThread ( const QString &  path,
const QStringList &  includedDBs,
QStandardItemModel *  mainModel,
const QMap< int, QIcon > *  iconGallery,
const DisplayBool show 
) [static, private]

Load the Databases in different Thread.

This function calls createItemRek for each Database. The show parameter is an enumeration from the headerfile. It stores which kind of help is included into the model. The options can be set in the properties dialog.

Parameters:
path
includedDBslist of database files (paths)
mainModelpointer to the mainmodel
iconGallerythe gallery is passed to createItemRek
showthis parameter is an enumeration that is filled by the settings dialog.
See also:
reloadDB, loadDBinThread, createItemRek
QString ito::HelpTreeDockWidget::maxText ( int  maximum) const [private]

This function detects if a range maximum of a variable is equal to the maximum of the type.

For example if a range is max 255 and itīs a byte, this function returns inf

Parameters:
maximum
Returns:
maximum as String or inf
QString ito::HelpTreeDockWidget::maxText ( double  maximum) const [private]

This function detects if a range maximum of a variable is equal to the maximum of the type.

For example if a range is max 255 and itīs a byte, this function returns inf

Parameters:
maximum
Returns:
maximum as String or inf
QString ito::HelpTreeDockWidget::maxText ( char  maximum) const [private]

This function detects if a range maximum of a variable is equal to the maximum of the type.

For example if a range is max 255 and itīs a byte, this function returns inf

Parameters:
maximum
Returns:
maximum as String or inf
QString ito::HelpTreeDockWidget::minText ( double  minimum) const [private]

This function detects if a range minimum of a variable is equal to the minimum of the type.

For example if a range is min 0 and itīs a byte, this function returns -inf

Parameters:
minimum
Returns:
double as String or -inf
QString ito::HelpTreeDockWidget::minText ( int  minimum) const [private]

This function detects if a range minimum of a variable is equal to the minimum of the type.

For example if a range is min 0 and itīs a byte, this function returns -inf

Parameters:
minimum
Returns:
QString int as String or -inf
QString ito::HelpTreeDockWidget::minText ( char  minimum) const [private]

This function detects if a range minimum of a variable is equal to the minimum of the type.

For example if a range is min 0 and itīs a byte, this function returns -inf

Parameters:
minimum
Returns:
char as String or -inf
QString ito::HelpTreeDockWidget::parseFilterWidgetContent ( const QString &  input) [private]

Reformats all help strings that come from the widgets and plugins.

All newLine characters are replaced by the html tag

Parameters:
inputThe text that is supposed to be reformated
Returns:
QString contains the reformated text
QString ito::HelpTreeDockWidget::parseParam ( const QString &  tmpl,
const ito::Param param 
) [private]

Parses a single Parameter to html code (called by parseParamVector)

Parameters:
tmpl
param
Returns:
QString
ito::RetVal ito::HelpTreeDockWidget::parseParamVector ( const QString &  sectionname,
const QVector< ito::Param > &  paramVector,
QString &  content 
) [private]

Creates the Parameter- and Return- sections in html-Code.

Parameters:
sectionname
paramVector
content
Returns:
RetVal
ito::RetVal ito::HelpTreeDockWidget::readSQL ( const QString &  file,
QList< SqlItem > &  items 
) [static, private]

Get Data from SQL File and store it in a table.

This function openes a sql database that contains all the static help informations. All these informations are written into a list. createItemRek creates the model from this list.

Parameters:
filethe path of the sql database
itemsthis parameter is filled with a list of SqlItems (struct from the header file)
Returns:
ito::RetVal
See also:
createItemRek
void ito::HelpTreeDockWidget::reloadDB ( ) [slot]

Reload Database and clear search-edit and start the new Thread.

This function starts a new thread that loads the database.

See also:
dbLoaderFinished
QStringList ito::HelpTreeDockWidget::separateLink ( const QUrl &  link) [private]

Returns a list containing the protocol[0] and the real link[1].

This functions looks for different protocols in the links that can be clicked inside the textBrowser

Parameters:
linklink link that is analysed
Returns:
returns a list of all parts of the link
ito::RetVal ito::HelpTreeDockWidget::showFilterWidgetPluginHelp ( const QString &  filterpath,
itemType  type 
) [slot]

Get the DocString from a Filter and parse is to html.

This function puts all information of a Widget or Plugin together and builds the html help text.

Parameters:
filterpathpath with all parents
typethe enumeration itemType is defined in the header file helpTreeDockWidget.h
Returns:
ito::RetVal
void ito::HelpTreeDockWidget::showPluginInfo ( const QString &  name,
int  type,
const QModelIndex &  modelIndex,
bool  fromLink 
) [slot]

slot invoked by different widgets to display a help page from extern

This is the Slot that can be externally called by other widgets to display filter or widget help ... i.a. AIManagerWidget

Parameters:
namename of the function that is supposed to be displayed
typeit decides wheather the help is stored in a database (1) or calls showFilterWidgetPluginHelp(...) (2-8)
modelIndexthat was clicked. If itīs empty, itīs a call from a link or from extern
fromLinkif true, a link called that slot

Member Data Documentation

after this time the tree automatically becomes smaller

path from where the databases are loaded

QList<QModelIndex> ito::HelpTreeDockWidget::m_history [private]

List to store the adresses of the last visited pages

If a page is called by the history buttons, this bool prevents from that this page is stored in the historylist again

decides if external links open when clicked

width of tree while small

width of three while visible

true: html code is displayed, false: normal help with style is displayed

Filtered Tree Model (between the model and the tree

QStandardItemModel* ito::HelpTreeDockWidget::m_pMainModel [private]

Model to store the tree with all database entries

pointer to helpDockWidget with Toolbar

turning circle to show "wait" status


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends