FougTools  0.7.0dev-046fb6a
Handy tools for C++, Qt and OpenCascade
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
tree_combo_box.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 <QtCore/QModelIndex>
21 // QtWidgets
22 #include <QComboBox>
23 class QTreeView;
24 
25 namespace qtgui {
26 
27 class QTTOOLS_GUI_EXPORT TreeComboBox : public QComboBox
28 {
29  Q_OBJECT
30  Q_PROPERTY(QModelIndex currentModelIndex READ currentModelIndex WRITE setCurrentModelIndex)
31 
32 public:
33  TreeComboBox(QWidget *parent = NULL);
34 
35  void showPopup() Q_DECL_OVERRIDE;
36 
37  QTreeView* treeView() const;
38 
39  QModelIndex treeFindData(
40  const QVariant& data,
41  int role = Qt::UserRole,
42  Qt::MatchFlags flags = Qt::MatchRecursive) const;
43 
44  QModelIndex currentModelIndex() const;
45  Q_SLOT void setCurrentModelIndex(const QModelIndex& modelIndex);
46 };
47 
48 } // namespace qtgui
Definition: abstract_length_editor.cpp:20
#define QTTOOLS_GUI_EXPORT
Definition: gui.h:27
Provides a QComboBox able to display a tree model item.
Definition: tree_combo_box.h:27