1 // Created on: 2017-06-16
2 // Created by: Natalia ERMOLAEVA
3 // Copyright (c) 2017 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef DFBrowserPane_AttributePaneSelector_H
17 #define DFBrowserPane_AttributePaneSelector_H
19 #include <Standard.hxx>
21 #include <Standard_WarningsDisable.hxx>
23 #include <QItemSelection>
24 #include <Standard_WarningsRestore.hxx>
28 class QItemSelectionModel;
30 //! \class DFBrowserPane_AttributePaneSelector
31 //! \brief Container of active selection models. It connects to selection changed signal of the models and
32 //! emits one signal for any selection.
33 class DFBrowserPane_AttributePaneSelector : public QObject
39 Standard_EXPORT DFBrowserPane_AttributePaneSelector(QObject* theParent);
42 Standard_EXPORT virtual ~DFBrowserPane_AttributePaneSelector();
44 //! Fills the pane selection by the given models. Disconnect it from the previous model and connect to new models
45 //! \param theModels a list of selection models
46 Standard_EXPORT void SetCurrentSelectionModels(const std::list<QItemSelectionModel*>& theModels);
48 //! Clears selection in all selection models using block for selection changed flag
49 Standard_EXPORT void ClearSelected();
53 //! Signal about selection changed in the model
54 //! \param theSelected selected items
55 //! \param theDeselected deselected items
56 //! \param theModel a selection model where the selection happens
57 void tableSelectionChanged (const QItemSelection& theSelected, const QItemSelection& theDeselected,
58 QItemSelectionModel* theModel);
61 //! Listens selectionChanged() of the model and emits signal tableSelectionChanged filled with the selection model
62 //! \param theSelected selected items
63 //! \param theDeselected deselected items
64 void onTableSelectionChanged (const QItemSelection& theSelected, const QItemSelection& theDeselected);
68 std::list<QItemSelectionModel*> mySelectionModels; //!< container of selection models
69 bool mySendSelectionChangeBlocked; //!< flag is selection processing should not performed, avoid cyclic dependency