1 // Copyright (C) 2014-2023 CEA, EDF
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Roman NIKOLAEV
21 /*========================================================================*/
22 #ifndef __pqArraysEditorPropertyWidget_h
23 #define __pqArraysEditorPropertyWidget_h
25 #include <pqPropertyWidget.h>
26 #include <vtkSmartPointer.h>
29 class vtkSMPropertyGroup;
30 class vtkEventQtSlotConnect;
38 /// pqArraysEditorPropertyWidget is the pqPropertyWidget used to edit
39 /// arrays and array's components.
40 class VTK_EXPORT pqArraysEditorPropertyWidget : public pqPropertyWidget
44 Q_PROPERTY(QList<QVariant> arrayInfo READ arraysInfo WRITE setArraysInfo NOTIFY arraysInfoChanged)
46 Q_PROPERTY(QList<QVariant> componentsInfo READ componentsInfo WRITE setComponentsInfo NOTIFY
47 componentsInfoChanged)
49 typedef pqPropertyWidget Superclass;
52 pqArraysEditorPropertyWidget(vtkSMProxy* proxy, vtkSMPropertyGroup* smgroup, QWidget* parent = nullptr);
53 virtual ~pqArraysEditorPropertyWidget();
55 /// Get/Set the arrays Info
56 QList<QVariant> arraysInfo() const;
57 void setArraysInfo(const QList<QVariant>&);
59 /// Get/Set the arrays Info
60 QList<QVariant> componentsInfo() const;
61 void setComponentsInfo(const QList<QVariant>&);
64 /// Fired when the arrays Info is changes.
65 void arraysInfoChanged();
66 void componentsInfoChanged();
69 /// called whenever the internal model's data changes.
70 void onDataChanged(const QModelIndex& topleft, const QModelIndex& btmright);
71 void onComponentsEdit();
73 /// called whenever the input changed.
74 void onInputDataChanged();
77 void updateArraysList();
80 vtkSmartPointer<vtkSMPropertyGroup> myPropertyGroup;
81 vtkEventQtSlotConnect* myConnection;
82 unsigned long myDataTime;
85 pqArraysModel* myArraysModel;
86 QTableView* myArraysTable;
89 #endif // __pqArraysEditorPropertyWidget_h