FougTools  0.7.0dev-046fb6a
Handy tools for C++, Qt and OpenCascade
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
qstandard_item_explorer.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** FougTools
3 ** Copyright Fougue (30 Mar. 2015)
4 ** contact@fougue.pro
5 **
6 ** This software is a computer program whose purpose is to provide utility
7 ** tools for the C++ language and the Qt toolkit.
8 **
9 ** This software is governed by the CeCILL-C license under French law and
10 ** abiding by the rules of distribution of free software. You can use,
11 ** modify and/ or redistribute the software under the terms of the CeCILL-C
12 ** license as circulated by CEA, CNRS and INRIA at the following URL
13 ** "http://www.cecill.info".
14 ****************************************************************************/
15 
16 #pragma once
17 
18 #include "gui.h"
19 
20 #include "../../cpptools/tree_bfs_explorer.h"
21 
22 #include <QtGui/QStandardItem>
23 class QStandardItemModel;
24 
25 namespace qtgui {
26 
28 {
29  static bool isDeeper(const QStandardItem* current, const QStandardItem* previous);
30 
31  template<typename OUT_ITERATOR>
32  static void enqueueChildren(OUT_ITERATOR out, QStandardItem* parentItem)
33  {
34  for (int row = 0; row < parentItem->rowCount(); ++row) {
35  *out = parentItem->child(row);
36  ++out;
37  }
38  }
39 };
40 
42  public cpp::TreeBfsExplorer<QStandardItem, QStandardItemTreeBfsModel>
43 {
44 public:
46  QStandardItemExplorer(QStandardItem* rootItem);
47  QStandardItemExplorer(QStandardItemModel* model);
48 };
49 
50 } // namespace qtgui
static bool isDeeper(const QStandardItem *current, const QStandardItem *previous)
Definition: qstandard_item_explorer.cpp:59
Definition: abstract_length_editor.cpp:20
Provides a BFS (breadth-first search) exploration of a QStandardItemModel object. ...
Definition: qstandard_item_explorer.h:41
#define QTTOOLS_GUI_EXPORT
Definition: gui.h:27
Definition: tree_bfs_explorer.h:45
Definition: qstandard_item_explorer.h:27
static void enqueueChildren(OUT_ITERATOR out, QStandardItem *parentItem)
Definition: qstandard_item_explorer.h:32