diff options
author | Lauro Neto <lauro.neto@openbossa.org> | 2010-04-27 18:12:50 -0300 |
---|---|---|
committer | Renato Filho <renato.filho@openbossa.org> | 2010-04-28 16:36:47 -0300 |
commit | aaece960d3cf1c9d19dd84fe8171769517647724 (patch) | |
tree | ea2e20d2c8738cc407f60b10b6cccfb4e1fc2b70 /doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qsimplexmlnodemodel.cpp | |
parent | 685246809debe672a0007b67fe78f7c77bad6739 (diff) |
Adding ./doc from boost
Reviewer: Lauro Moura <lauro.neto@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qsimplexmlnodemodel.cpp')
-rw-r--r-- | doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qsimplexmlnodemodel.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qsimplexmlnodemodel.cpp b/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qsimplexmlnodemodel.cpp new file mode 100644 index 000000000..0906328f8 --- /dev/null +++ b/doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qsimplexmlnodemodel.cpp @@ -0,0 +1,19 @@ +//! [0] +QXmlNodeModelIndex MyTreeModel::nextFromSimpleAxis(SimpleAxis axis, const QXmlNodeModelIndex &ni) const +{ + // Convert the QXmlNodeModelIndex to a value that is specific to what we represent. + const MyValue value = toMyValue(ni); + + switch(axis) + { + case Parent: + return toNodeIndex(value.parent()); + case FirstChild: + case PreviousSibling: + case NextSibling: + // and so on + ; + } + return QXmlNodeModelIndex(); +} +//! [0] |