Version: 9.16.0
PropertyEditor.hxx
Go to the documentation of this file.
1// Copyright (C) 2006-2026 CEA, EDF
2//
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.
7//
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.
12//
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
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20#ifndef _PROPERTYEDITOR_HXX_
21#define _PROPERTYEDITOR_HXX_
22
23#include <QWidget>
24#include <QTableWidget>
25#include <QTableWidgetItem>
26#include <QToolBar>
27#include <QAction>
28
29namespace YACS
30{
31 namespace HMI
32 {
33 class Subject;
34
35 class PropertyEditor: public QWidget
36 {
37 Q_OBJECT
38
39 public:
40 PropertyEditor(Subject* subject,QWidget *parent = 0);
41 virtual ~PropertyEditor();
42 void updateMenu();
43 void update();
44 void setProperties();
45
46 public slots:
47 virtual void onAddProperty(QAction* action);
48 virtual void onRemoveProperty();
49 virtual void onItemChanged(QTableWidgetItem * item);
50 virtual void on_tb_options_toggled(bool checked);
51
52 protected:
54 QTableWidget* _table;
55 QToolBar* _bar;
56 QAction* _removeAction;
57 QAction* _addAction;
58 QStringList _knownProperties;
59 QStringList _propertyNames;
61 };
62 }
63}
64
65#endif
A class to edit properties of a subject.
virtual void onItemChanged(QTableWidgetItem *item)
Qt slot to change the value of a property item in the table.
virtual void onRemoveProperty()
Qt slot to remove the selected item in the table.
virtual void onAddProperty(QAction *action)
Qt slot to add a property item in the table.
void update()
Update the property items with their values in the subject.
PropertyEditor(Subject *subject, QWidget *parent=0)
void updateMenu()
Update the menu used to add properties with the already set properties.
void setProperties()
Update the subject properties with the values stored in the table.
virtual void on_tb_options_toggled(bool checked)